December 2017
Intermediate to advanced
536 pages
14h 23m
English
Here is how we proceed with the single layer perceptron:
import tensorflow as tf import numpy as np
# Hyper parameters eta = 0.4 # learning rate parameter epsilon = 1e-03 # minimum accepted error max_epochs = 100 # Maximum Epochs
# Threshold Activation function
def threshold (x):
cond = tf.less(x, tf.zeros(tf.shape(x), dtype = x.dtype))
out = tf.where(cond, tf.zeros(tf.shape(x)), tf.ones(tf.shape(x)))
return out
# Training Data Y = AB + BC, sum of two linear functions. T, F = 1., 0. X_in = [ [T, T, ...
Read now
Unlock full access