Skip to content

Commit abc173c

Browse files
committed
Refactor SOM class to RSOM class
1 parent 0504adc commit abc173c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,45 @@ Rectifying Self Organizing Map (RSOM)
88
RSOM is an algorithm as an extension of well-known Self Organizing Map (SOM). It mimics SOM clustering and additionally detects outliers in the given dataset in the cluster level or instance level.
99
It is mainly used with image tasks but works as good with any other type of data.
1010

11+
## Installation
12+
13+
```
14+
git clone https://github.com/erogol/RSOM.git
15+
cd RSOM
16+
python setup.py install
17+
```
18+
19+
or
20+
21+
```
22+
pip install git+https://github.com/erogol/RSOM.git
23+
```
24+
25+
## Usage
26+
27+
Check ```sample_run.py``` for more.
28+
29+
```python
30+
from rsom import RSOM
31+
32+
# Load Iris dataset
33+
data = load_digits().data
34+
data = torch.from_numpy(data).float()
35+
print(data.shape)
36+
37+
# Initialize SOM
38+
som = RSOM(data, alpha_max=0.05, num_units=49)
39+
40+
# Train SOM
41+
som.train_batch(num_epoch=1000, verbose=True)
42+
43+
# Get salient instances and units
44+
salient_insts = som.salient_insts()
45+
salient_units = som.salient_units()
46+
```
47+
48+
49+
1150
## Citation
1251

1352
```

0 commit comments

Comments
 (0)