Skip to content

Commit

Permalink
PyPi release (1.0.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
Manciukic committed Aug 11, 2020
1 parent ef9a38b commit bfd6cb5
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 6 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
include Readme.md
include LICENSE
23 changes: 23 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ SOM is a type of Artificial Neural Network able to convert complex, nonlinear st
Installation
---------------------

You can download XPySom from PyPi:

pip install xpysom

By default, dependencies for GPU execution are not downloaded.
You can also specify a CUDA version to automatically download also those
requirements. For example, for CUDA Toolkit 10.2 you would write:

pip install xpysom[cuda102]

Alternatively, you can manually install XPySom.
Download XPySom to a directory of your choice and use the setup script:

git clone https://github.com/Manciukic/xpysom.git
Expand Down Expand Up @@ -46,6 +57,18 @@ You can obtain the position of the winning neuron on the map for a given sample
som.winner(data[0])
```

By default, XPySom executes on the GPU if available (and required packages are
correctly installed). You can override this behaviour by passing the `xp`
parameter to XPySom set to the package you want to use (only Numpy and Cupy
have been tested, but in theory any Numpy-compliant package would work).

```python
from xpysom import XPySom
import numpy as np

som = XPySom(6, 6, 4, sigma=0.3, learning_rate=0.5, xp=np)
```

Differences with MiniSom
---------------------
- The batch SOM algorithm is used (instead of the online used in MiniSom). Therefore, use only `train` to train the SOM, `train_random` and `train_batch` are not present.
Expand Down
27 changes: 21 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
#!/usr/bin/env python
from distutils.core import setup
from setuptools import setup

# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'Readme.md'), encoding='utf-8') as f:
long_description = f.read()

description = 'Minimalistic implementation of batch Self Organizing Maps (SOM) for parallel execution on CPU or GPU.'
keywords = ['machine learning', 'neural networks', 'clustering', 'dimentionality reduction']

setup(name='XPySom',
version='1.0.0',
version='1.0.5',
description=description,
long_description=long_description,
long_description_content_type="text/markdown",
author='Riccardo Mancini',
author_email="[email protected]",
package_data={'': ['Readme.md']},
include_package_data=True,
license="GNU General Public License v3.0",
packages=['xpysom'],
install_requires=['numpy'],
extra_requires={'gpu': ['cupy']},
extras_require={
'cuda90': ['cupy-cuda90'],
'cuda92': ['cupy-cuda92'],
'cuda100': ['cupy-cuda100'],
'cuda101': ['cupy-cuda101'],
'cuda102': ['cupy-cuda102'],
},
url='https://github.com/Manciukic/xpysom',
download_url='https://github.com/Manciukic/xpysom/archive/v1.0.0.tar.gz',
download_url='https://github.com/Manciukic/xpysom/archive/v1.0.5.tar.gz',
keywords=keywords,
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Programming Language :: Python :: 3',
Expand All @@ -28,5 +42,6 @@
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
],
zip_safe=False,
)

0 comments on commit bfd6cb5

Please sign in to comment.