-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrun.py
More file actions
168 lines (144 loc) · 3.87 KB
/
Copy pathrun.py
File metadata and controls
168 lines (144 loc) · 3.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
from sys import argv
# MNIST test #classic
if '--mnist' in argv:
from examples.mnist import *
start('--conv' in argv)
train()
try:
index = argv.index('-testn')
n = int(argv[index + 1])
test(n)
except:
test(5000)
# random 2D data classification test
if '--toy2D' in argv:
from examples.toy2D import *
train()
test()
# Cifar10 test
if '--cifar10' in argv:
from examples.cifar.cifar10 import *
start('-conv' in argv, '-crop' in argv, '-gray' in argv)
train()
test()
# Cifar10 autoencoder
if '--cifar10-ae' in argv:
from examples.cifar.autoencoder import *
start('-conv' in argv, '-crop' in argv, '-gray' in argv)
train()
test()
# Learns to predict the next letter in a sequence (trained on trigrams)
if '--nextletter' in argv:
from examples.next_letter import *
start()
train()
test()
# Autoencode mnist digits, display them with opencv
if '--autoencoder' in argv:
from examples.autoencoder import *
start()
train()
path, test_n = None, None
if '-path' in argv:
path = argv[argv.index('-path') + 1]
if '-testn' in argv:
test_n = int(argv[argv.index('-testn') + 1])
test(path=path, test_n=test_n)
# Uses an autoencoder trained on frequency distributions
# from project gutenberg to do topic modeling
# (using the assumption that words with highest activation == topics)
if '--topics' in argv:
from examples.topics import *
start()
train()
test()
# Uses an autoencoder trained on frequency distributions
# from project gutenberg to do semantic similarity search
# cos(v, qv) for v in doc, v = wieghts of 10 neuron sigmoid ("compressed code of text")
if '--sim' in argv:
from examples.similarity import *
start()
train()
test()
# Classify iris dataset, requires scikit-learn
if '--iris' in argv:
from examples.iris import *
load_data()
start()
train()
test()
# Classify labeled faces in the wild, requires scikit-learn
if '--faces' in argv:
from examples.faces import *
load_data()
start()
train()
test()
# Predict next word from bigram model
if '--nextword' in argv:
from examples.next_word import *
start()
train()
test()
# Predict dialogue class from frequency distribution of text
if '--dialogue' in argv:
from examples.dialogue import *
start()
train()
test()
# Predict next word based on word embeddings
if '--nextworde' in argv:
from examples.next_word_embeddings import *
start()
train()
test()
# Predict 1 of 4 sentiment tags, kaggle challenge
# https://www.kaggle.com/c/sentiment-analysis-on-movie-reviews
if '--sentiment' in argv:
from examples.sentiment import *
start()
train()
test()
fill()
# Based on Geoff Hinton's Dark Knowledge talk
# https://www.youtube.com/watch?v=EK61htlw8hY
# Train large net with dropout and jitter, use outputs (soft targets)
# as inputs to smaller neural net -- pretty amazing results
# Larger net has already learned a sort of similarity function btw. inputs
if '--dark-knowledge' in argv:
from examples.dark_knowledge import *
run_big_net()
run_small_net()
if '--udacity-terrain' in argv:
from examples.udacity_terrain import *
train()
test()
if '--darkencoder' in argv:
from examples.darkencoder import *
start()
train()
train2()
test()
# Autoencode mnist digits, display them in 2D with opencv
if '--autoencoder-vis' in argv:
from examples.autoencoder_vis import *
start()
test()
train()
test()
if '--titanic' in argv:
from examples.titanic import *
load_data()
start()
train()
test()
if '--mnist-n2i' in argv:
from examples.num2img import *
start()
train()
test()
if '--tae' in argv:
from examples.transforming_autoencoder import start, train, test
start()
train()
test()