Skip to content

Instantly share code, notes, and snippets.

@RafayAK
Created November 10, 2019 10:53
Show Gist options
  • Save RafayAK/007609a551f1ee644dad1592768dafef to your computer and use it in GitHub Desktop.
Save RafayAK/007609a551f1ee644dad1592768dafef to your computer and use it in GitHub Desktop.
Define layers for 1 layer nn to discriminate between Iris-virginica vs. others, using only petal length and petal width as input features
# define training constants
learning_rate = 1
number_of_epochs = 5000
np.random.seed(48) # set seed value so that the results are reproduceable
# (weights will now be initailzaed to the same pseudo-random numbers, each time)
# Our network architecture has the shape:
# (input)--> [Linear->Sigmoid] -->(output)
#------ LAYER-1 ----- define output layer that takes in training data
Z1 = LinearLayer(input_shape=X_train.shape, n_out=1, ini_type='plain')
A1 = SigmoidLayer(Z1.Z.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment