November 2017
Intermediate to advanced
274 pages
6h 16m
English
The following is the code of the Additive Gaussian autoencoder:
import numpy as npimport tensorflow as tfdef xavier_init(fan_in, fan_out, constant = 1): low = -constant * np.sqrt(6.0 / (fan_in + fan_out)) high = constant * np.sqrt(6.0 / (fan_in + fan_out)) return tf.random_uniform((fan_in, fan_out), minval = low, maxval = high, dtype = tf.float32)class AdditiveGaussianNoiseAutoEncoder(object): def __init__(self, num_input, num_hidden, transfer_function=tf.nn.sigmoid, optimizer=tf.train.AdamOptimizer(), scale=0.1): self.num_input = num_input self.num_hidden = num_hidden self.transfer = transfer_function self.scale = tf.placeholder(tf.float32) self.training_scale = scale n_weights = self._initialize_weights() ...
Read now
Unlock full access