Skip to content

Commit 91e5021

Browse files
authored
Merge pull request #22 from beringresearch/ivis-supvised-softmax
Ivis supvised softmax
2 parents ad76c2b + 75f6786 commit 91e5021

25 files changed

+728
-127
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __pycache__/
77
*.swp
88
.ipynb_checkpoints
99
_build
10+
*.pyc
1020 KB
Loading
1.03 MB
Loading
1.75 KB
Binary file not shown.
785 Bytes
Binary file not shown.
26.2 KB
Loading

docs/auto_examples/index.rst

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,27 @@ Several examples of how ivis can be used in common machine learning tasks.
1313

1414
.. raw:: html
1515

16-
<div class="sphx-glr-thumbcontainer" tooltip="Example of reducing dimensionality of the iris dataset using ivis. ">
16+
<div class="sphx-glr-thumbcontainer" tooltip="Ivis can be applied easily applied to unstructured datasets, including images. Here we visualis...">
17+
18+
.. only:: html
19+
20+
.. figure:: /auto_examples/images/thumb/sphx_glr_mnist_thumb.png
21+
22+
:ref:`sphx_glr_auto_examples_mnist.py`
23+
24+
.. raw:: html
25+
26+
</div>
27+
28+
29+
.. toctree::
30+
:hidden:
31+
32+
/auto_examples/mnist
33+
34+
.. raw:: html
35+
36+
<div class="sphx-glr-thumbcontainer" tooltip="Example of reducing dimensionality of the iris dataset using ivis.">
1737

1838
.. only:: html
1939

docs/auto_examples/iris.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"cell_type": "markdown",
1616
"metadata": {},
1717
"source": [
18-
"\niris dataset\n============\n\nExample of reducing dimensionality of the iris dataset using ivis.\n\n"
18+
"\niris dataset\n============\n\nExample of reducing dimensionality of the iris dataset using ivis.\n"
1919
]
2020
},
2121
{
@@ -26,7 +26,7 @@
2626
},
2727
"outputs": [],
2828
"source": [
29-
"import seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import load_iris\nfrom sklearn.preprocessing import MinMaxScaler\n\nfrom ivis import Ivis\n\nsns.set(context='paper', style='white')\n\nX = load_iris().data\nX = MinMaxScaler().fit_transform(X)\n\nivis = Ivis(k=3, batch_size=120, model='maaten')\nivis.fit(X)\n\nembeddings = ivis.transform(X)\n\nfig, ax = plt.subplots(figsize=(12, 10))\nplt.scatter(embeddings[:, 0],\n embeddings[:, 1],\n c=load_iris().target, cmap='Spectral', s=1)\nplt.setp(ax, xticks=[], yticks=[])\nplt.title('ivis embeddings of the iris dataset', fontsize=18)\n\nplt.show()"
29+
"import seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.datasets import load_iris\nfrom sklearn.preprocessing import MinMaxScaler\n\nfrom ivis import Ivis\n\nsns.set(context='paper', style='white')\n\nX = load_iris().data\nX = MinMaxScaler().fit_transform(X)\n\nivis = Ivis(k=5, model='maaten', verbose=0)\nivis.fit(X)\n\nembeddings = ivis.transform(X)\n\nplt.figure(figsize=(5, 5), dpi=100)\nplt.scatter(embeddings[:, 0],\n embeddings[:, 1],\n c=load_iris().target, s=20)\nplt.xlabel('ivis 1')\nplt.ylabel('ivis 2')\nplt.title('ivis embeddings of the iris dataset')\n\nplt.show()"
3030
]
3131
}
3232
],
@@ -46,7 +46,7 @@
4646
"name": "python",
4747
"nbconvert_exporter": "python",
4848
"pygments_lexer": "ipython3",
49-
"version": "3.6.7"
49+
"version": "3.7.3"
5050
}
5151
},
5252
"nbformat": 4,

docs/auto_examples/iris.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@
1717
X = load_iris().data
1818
X = MinMaxScaler().fit_transform(X)
1919

20-
ivis = Ivis(k=3, batch_size=120, model='maaten')
20+
ivis = Ivis(k=5, model='maaten', verbose=0)
2121
ivis.fit(X)
2222

2323
embeddings = ivis.transform(X)
2424

25-
fig, ax = plt.subplots(figsize=(12, 10))
25+
plt.figure(figsize=(5, 5), dpi=100)
2626
plt.scatter(embeddings[:, 0],
2727
embeddings[:, 1],
28-
c=load_iris().target, cmap='Spectral', s=1)
29-
plt.setp(ax, xticks=[], yticks=[])
30-
plt.title('ivis embeddings of the iris dataset', fontsize=18)
28+
c=load_iris().target, s=20)
29+
plt.xlabel('ivis 1')
30+
plt.ylabel('ivis 2')
31+
plt.title('ivis embeddings of the iris dataset')
3132

3233
plt.show()

docs/auto_examples/iris.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ iris dataset
1212

1313
Example of reducing dimensionality of the iris dataset using ivis.
1414

15-
1615
.. code-block:: default
1716
1817
@@ -28,17 +27,18 @@ Example of reducing dimensionality of the iris dataset using ivis.
2827
X = load_iris().data
2928
X = MinMaxScaler().fit_transform(X)
3029
31-
ivis = Ivis(k=3, batch_size=120, model='maaten')
30+
ivis = Ivis(k=5, model='maaten', verbose=0)
3231
ivis.fit(X)
3332
3433
embeddings = ivis.transform(X)
3534
36-
fig, ax = plt.subplots(figsize=(12, 10))
35+
plt.figure(figsize=(5, 5), dpi=100)
3736
plt.scatter(embeddings[:, 0],
3837
embeddings[:, 1],
39-
c=load_iris().target, cmap='Spectral', s=1)
40-
plt.setp(ax, xticks=[], yticks=[])
41-
plt.title('ivis embeddings of the iris dataset', fontsize=18)
38+
c=load_iris().target, s=20)
39+
plt.xlabel('ivis 1')
40+
plt.ylabel('ivis 2')
41+
plt.title('ivis embeddings of the iris dataset')
4242
4343
plt.show()
4444

0 commit comments

Comments
 (0)