File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Setup
2
+
3
+ This code was tested with python 3.7, however, it should work with any python 3.
4
+
5
+ 1 . Create and activate virtual environment for experiments with t-SNE.
6
+
7
+ ``` bash
8
+ python3 -m venv venv
9
+ source venv/bin/activate
10
+ ```
11
+
12
+ 2 . install the dependencies
13
+
14
+ ``` bash
15
+ python3 -m pip install -r requirements.txt
16
+ ```
17
+
18
+ # Data downloading
19
+
20
+ Download data from Kaggle and unzip it.
21
+ The easiest way is to use kaggle console API. To setup it, follow [ this guide] ( https://www.kaggle.com/general/74235 ) .
22
+ However, you can download the data using your browser - results will be the same.
23
+
24
+ After that, execute the following commands:
25
+
26
+ ``` bash
27
+
28
+ kaggle datasets download alessiocorrado99/animals10
29
+
30
+ mkdir -p data
31
+
32
+ cd data
33
+
34
+ unzip ../animals10.zip
35
+
36
+ cd ..
37
+
38
+ ```
39
+
40
+ # Executing the T-SNE visualization
41
+
42
+ ``` bash
43
+
44
+ python3 tsne.py
45
+
46
+ ```
47
+
48
+ Additional options:
49
+
50
+ ``` bash
51
+ python3 tsne.py -h
52
+
53
+ usage: tsne.py [-h] [--path PATH] [--batch BATCH] [--num_images NUM_IMAGES]
54
+
55
+ optional arguments:
56
+ -h, --help show this help message and exit
57
+ --path PATH
58
+ --batch BATCH
59
+ --num_images NUM_IMAGES
60
+
61
+ ```
62
+
63
+ You can change the data directory with ` --path ` argument.
64
+
65
+ Tweak the ` --num_images ` to speed-up the process - by default it is 500, you can make it smaller.
66
+
67
+ Tweak the ` --batch ` to better utilize your PC's resources. The script uses GPU automatically if it available. You may
68
+ want to increase the batch size to utilize the GPU better or decrease it if the default batch size does not fit your
69
+ GPU.
You can’t perform that action at this time.
0 commit comments