Jensen-holm commited on
Commit
1936952
·
1 Parent(s): 88a3c01

cleaning up readme, now moving on to building clustering algorithms from scratch

Browse files
Files changed (3) hide show
  1. README.md +3 -237
  2. app.py +1 -2
  3. neural_network/backprop.py +0 -3
README.md CHANGED
@@ -11,10 +11,10 @@ import json
11
  request_params = {
12
  "algorithm": "neural-network",
13
  "arguments": {
14
- "epochs": 20,
15
  "activation_func": "tanh",
16
- "hidden_size": 12,
17
- "learning_rate": 0.1
18
  }
19
  }
20
 
@@ -31,237 +31,3 @@ r = requests.post(
31
  model_data = r.json()
32
  print(model_data)
33
  ```
34
-
35
- ```json
36
- {
37
- "activation_func": "tanh",
38
- "b1": [
39
- [
40
- 602.2458551757542,
41
- -683.446253227002,
42
- 650.3183189757099,
43
- -523.2155000337558,
44
- 609.3366256008726,
45
- 639.2267460958211,
46
- 695.2165647208506,
47
- -606.7936305551088,
48
- 657.4012435144655,
49
- 711.4633443525767,
50
- -471.4445655803913,
51
- -630.9028119023186
52
- ]
53
- ],
54
- "b2": [
55
- [
56
- 67.47031899621929
57
- ]
58
- ],
59
- "epochs": 20,
60
- "func_prime": "tanh_prime",
61
- "hidden_size": 12,
62
- "learning_rate": 0.1,
63
- "loss_history": [
64
- 7.461892920397806,
65
- 3.5105095887100286,
66
- 3.3859446278971737,
67
- 3.4806412166759375,
68
- 3.371428625854261,
69
- 3.4857142857142858,
70
- 3.3714285714285714,
71
- 3.48730595787098,
72
- 3.485714285485333,
73
- 3.3714285714285714,
74
- 3.4857142857142858,
75
- 3.4857142857142858,
76
- 3.4857142857142858,
77
- 3.3714285714285714,
78
- 3.5428571428571427,
79
- 3.4857142857142858,
80
- 3.485714285632444,
81
- 3.3714285714285714,
82
- 3.4857142857142858,
83
- 3.4857142857142858
84
- ],
85
- "mse": 4.366666666666666,
86
- "w1": [
87
- [
88
- 207.21370782767613,
89
- -234.36758639516955,
90
- 223.138392823433,
91
- -181.15547589171842,
92
- 209.25701811587953,
93
- 212.01236197395147,
94
- 222.77599062157392,
95
- -209.86998324411556,
96
- 223.21606629672203,
97
- 240.23438173347404,
98
- -152.44942030486683,
99
- -204.9225317835803
100
- ],
101
- [
102
- 229.63220261470508,
103
- -263.50359108398936,
104
- 248.70108057424608,
105
- -200.62149189864414,
106
- 233.2719960712533,
107
- 244.95992976697852,
108
- 264.002073506371,
109
- -233.06264745543191,
110
- 250.09188502741318,
111
- 272.63944378494415,
112
- -182.2009679976884,
113
- -240.4510248021291
114
- ],
115
- [
116
- 138.18702051907664,
117
- -156.58749787870684,
118
- 147.69195397715987,
119
- -119.38899990797744,
120
- 139.13330931089936,
121
- 148.72414234071377,
122
- 160.8962313494786,
123
- -138.41372650228243,
124
- 152.08258913831452,
125
- 162.33017016825823,
126
- -107.55668307217107,
127
- -145.40927349021786
128
- ],
129
- [
130
- 80.41290811507756,
131
- -90.13436061161102,
132
- 84.13085847223971,
133
- -68.30212833885442,
134
- 79.47595245611743,
135
- 83.21680900863142,
136
- 86.27896789463828,
137
- -80.74680560543842,
138
- 83.83413687806267,
139
- 90.56585130892569,
140
- -57.458134412543025,
141
- -80.8434826355516
142
- ],
143
- [
144
- 81.11703964929961,
145
- -92.44245617525553,
146
- 88.49474524464306,
147
- -72.04388326457483,
148
- 82.98034898452103,
149
- 81.15849551944248,
150
- 85.2116748195986,
151
- -83.20067331132182,
152
- 86.0305118859619,
153
- 93.16829004526869,
154
- -56.72096416244479,
155
- -77.60518356776531
156
- ],
157
- [
158
- -1.2378552385524266,
159
- 1.0036304366192623,
160
- -1.6090159995321964,
161
- 2.0394495973086006,
162
- -2.0180183762339814,
163
- -1.3873816606742801,
164
- -1.0921076991064267,
165
- 1.4708199557617438,
166
- -1.5610521257407746,
167
- -1.9666673209706442,
168
- 1.9076517668995745,
169
- -1.040341749903375
170
- ],
171
- [
172
- -140.07549569653207,
173
- 159.79258368372882,
174
- -151.127437087266,
175
- 121.71130403554734,
176
- -141.38828696302818,
177
- -150.83274265279388,
178
- -164.8700178408228,
179
- 140.14741802182937,
180
- -155.16546152004372,
181
- -166.64050877887058,
182
- 112.77911212222166,
183
- 148.51991496622043
184
- ],
185
- [
186
- -192.41268009408034,
187
- 220.8347733584644,
188
- -210.0422475439458,
189
- 167.97957633446296,
190
- -195.6193849250513,
191
- -202.8005919557673,
192
- -216.60363528226284,
193
- 195.88577794127278,
194
- -207.56261064595896,
195
- -225.72144673652377,
196
- 143.59365538519984,
197
- 197.0929821983936
198
- ],
199
- [
200
- -28.16557705608608,
201
- 33.10058982579867,
202
- -30.42362586778765,
203
- 25.463967855559,
204
- -30.037162594547162,
205
- -27.1780221951157,
206
- -29.012190600654534,
207
- 29.46055196419518,
208
- -28.545992349262605,
209
- -30.547444878206573,
210
- 14.326183936375225,
211
- 22.847682776553654
212
- ],
213
- [
214
- -52.927836819688835,
215
- 59.928298086414046,
216
- -57.63233394130635,
217
- 45.77995718777185,
218
- -52.10930825304532,
219
- -54.41806454664905,
220
- -56.50225247051461,
221
- 52.78060231673277,
222
- -54.86575873235864,
223
- -60.2703962373473,
224
- 39.00509354075285,
225
- 50.7498660995501
226
- ]
227
- ],
228
- "w2": [
229
- [
230
- 52.018661530077026
231
- ],
232
- [
233
- -55.44086180940142
234
- ],
235
- [
236
- 54.045741372334284
237
- ],
238
- [
239
- -48.61944689242345
240
- ],
241
- [
242
- 52.311190899741064
243
- ],
244
- [
245
- 55.50646368409345
246
- ],
247
- [
248
- 56.132466993080044
249
- ],
250
- [
251
- -52.31844356040513
252
- ],
253
- [
254
- 55.59854459451529
255
- ],
256
- [
257
- 58.05680177825883
258
- ],
259
- [
260
- -48.22523804471059
261
- ],
262
- [
263
- -54.561775545109555
264
- ]
265
- ]
266
- }
267
- ```
 
11
  request_params = {
12
  "algorithm": "neural-network",
13
  "arguments": {
14
+ "epochs": 100,
15
  "activation_func": "tanh",
16
+ "hidden_size": 8,
17
+ "learning_rate": 0.01
18
  }
19
  }
20
 
 
31
  model_data = r.json()
32
  print(model_data)
33
  ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -1,6 +1,5 @@
1
  from flask import Flask, request, jsonify, make_response, render_template
2
 
3
- from dataset.random import random_dataset
4
  from dataset.iris import iris
5
  from opts import options
6
 
@@ -52,4 +51,4 @@ def index():
52
 
53
 
54
  if __name__ == "__main__":
55
- app.run()
 
1
  from flask import Flask, request, jsonify, make_response, render_template
2
 
 
3
  from dataset.iris import iris
4
  from opts import options
5
 
 
51
 
52
 
53
  if __name__ == "__main__":
54
+ app.run(debug=False)
neural_network/backprop.py CHANGED
@@ -65,9 +65,6 @@ def bp(
65
 
66
 
67
  def compute_node(arr, w, b, func):
68
- """
69
- Computes nodes during forward prop
70
- """
71
  return func(np.dot(arr, w) + b)
72
 
73
 
 
65
 
66
 
67
  def compute_node(arr, w, b, func):
 
 
 
68
  return func(np.dot(arr, w) + b)
69
 
70