Skip to content

Commit 7318658

Browse files
committed
update
1 parent aff046a commit 7318658

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

Diff for: tf2.0/extra_reading.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Gradient Descent: Convergence Analysis
2+
http://www.stat.cmu.edu/~ryantibs/convexopt-F13/scribes/lec6.pdf
3+
14
Deep learning improved by biological activation functions
25
https://arxiv.org/pdf/1804.11237.pdf
36

Diff for: tf2.0/xor3d.py

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import numpy as np
2+
import matplotlib.pyplot as plt
3+
from mpl_toolkits.mplot3d import Axes3D
4+
5+
6+
7+
def get_label(x, i1, i2, i3):
8+
# x = sequence
9+
if x[i1] < 0 and x[i2] < 0 and x[i3] < 0:
10+
return 1
11+
if x[i1] < 0 and x[i2] > 0 and x[i3] > 0:
12+
return 1
13+
if x[i1] > 0 and x[i2] < 0 and x[i3] > 0:
14+
return 1
15+
if x[i1] > 0 and x[i2] > 0 and x[i3] < 0:
16+
return 1
17+
return 0
18+
19+
20+
N = 2000
21+
X = np.random.random((N, 3))*2 - 1
22+
23+
Y = np.zeros(N)
24+
for i in range(N):
25+
x = X[i]
26+
y = get_label(x, 0, 1, 2)
27+
Y[i] = y
28+
29+
30+
fig = plt.figure()
31+
ax = fig.add_subplot(111, projection='3d')
32+
ax.scatter(X[:,0], X[:,1], X[:,2], c=Y)
33+
plt.show()

0 commit comments

Comments
 (0)