Skip to content

Commit f90f82f

Browse files
add dlc url to ann2
1 parent a0c87de commit f90f82f

File tree

13 files changed

+34
-19
lines changed

13 files changed

+34
-19
lines changed

ann_class2/dropout_tensorflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
1+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
2+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
23
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
34
import numpy as np
45
import tensorflow as tf

ann_class2/dropout_theano.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# This code is not optimized for speed.
33
# It's just to get something working, using the principles we know.
44

5-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
5+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
6+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
67
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
78

89
import numpy as np

ann_class2/mlp.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Simple multi-layer preceptron / neural network in Python and Numpy
2-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
2+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
3+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
34
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
45

56
import numpy as np
67

78
def forward(X, W1, b1, W2, b2):
8-
# Z = 1 / (1 + np.exp(-( X.dot(W1) + b1 )))
9+
Z = 1 / (1 + np.exp(-( X.dot(W1) + b1 )))
910

1011
# rectifier
11-
Z = X.dot(W1) + b1
12-
Z[Z < 0] = 0
12+
# Z = X.dot(W1) + b1
13+
# Z[Z < 0] = 0
1314
# print "Z:", Z
1415

1516
A = Z.dot(W2) + b2
@@ -26,9 +27,9 @@ def derivative_b2(T, Y):
2627
return (Y - T).sum(axis=0)
2728

2829
def derivative_w1(X, Z, T, Y, W2):
29-
# return X.T.dot( ( ( Y-T ).dot(W2.T) * ( Z*(1 - Z) ) ) ) # for sigmoid
30-
return X.T.dot( ( ( Y-T ).dot(W2.T) * np.sign(Z) ) ) # for relu
30+
return X.T.dot( ( ( Y-T ).dot(W2.T) * ( Z*(1 - Z) ) ) ) # for sigmoid
31+
# return X.T.dot( ( ( Y-T ).dot(W2.T) * np.sign(Z) ) ) # for relu
3132

3233
def derivative_b1(Z, T, Y, W2):
33-
# return (( Y-T ).dot(W2.T) * ( Z*(1 - Z) )).sum(axis=0) # for sigmoid
34-
return (( Y-T ).dot(W2.T) * np.sign(Z)).sum(axis=0) # for relu
34+
return (( Y-T ).dot(W2.T) * ( Z*(1 - Z) )).sum(axis=0) # for sigmoid
35+
# return (( Y-T ).dot(W2.T) * np.sign(Z)).sum(axis=0) # for relu

ann_class2/momentum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Compare momentum with regular gradient descent
2-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
2+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
3+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
34
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
45

56
# NOTE: MUST restrict initial values of W by dividing by #

ann_class2/rmsprop.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Compare RMSprop vs. constant learning rate
2-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
2+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
3+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
34
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
45

56
import numpy as np

ann_class2/sgd.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
# (but not actually waiting for convergence) and what the cost looks like at
1111
# each iteration.
1212
#
13-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
13+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
14+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
1415
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
1516

1617
import numpy as np

ann_class2/tensorflow1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# I compare this to theano1.py multiple times.
55
# So you might want to check that out first.
66

7-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
7+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
8+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
89
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
910

1011
import numpy as np

ann_class2/tensorflow2.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
# This code is not optimized for speed.
33
# It's just to get something working, using the principles we know.
44

5-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
5+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
6+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
67
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
78

89
import numpy as np

ann_class2/tf_with_save.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
12
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
23

34
import json

ann_class2/theano1.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Theano basics.
2-
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFLow
2+
# For the class Data Science: Practical Deep Learning Concepts in Theano and TensorFlow
3+
# https://deeplearningcourses.com/c/data-science-deep-learning-in-theano-tensorflow
34
# https://www.udemy.com/data-science-deep-learning-in-theano-tensorflow
45

56
import theano.tensor as T

0 commit comments

Comments
 (0)