December 2018
Beginner to intermediate
226 pages
7h 59m
English
Like MAML, Reptile is also compatible with any algorithms that can be trained with gradient descent. So, we use a simple two-layered neural network with 64 hidden units.
First, let's reset the TensorFlow graph:
tf.reset_default_graph()
We initialize the network parameters:
num_hidden = 64num_classes = 1num_feature = 1
Next, we define the placeholders for our input and output:
X = tf.placeholder(tf.float32, shape=[None, num_feature])Y = tf.placeholder(tf.float32, shape=[None, num_classes])
We randomly initialize our model parameters:
w1 = tf.Variable(tf.random_uniform([num_feature, num_hidden]))b1 = tf.Variable(tf.random_uniform([num_hidden]))w2 = tf.Variable(tf.random_uniform([num_hidden, num_classes])) ...
Read now
Unlock full access