May 2018
Intermediate to advanced
576 pages
14h 42m
English
For our Python example, we are going to use the same dataset already created for the Sanger's network (which is expected to be available in the variable Xs). Therefore, we can start setting up all the constants and variables:
import numpy as npn_components = 2learning_rate = 0.0001max_iterations = 1000stabilization_cycles = 5threshold = 0.00001W = np.random.normal(0.0, 0.5, size=(Xs.shape[1], n_components))V = np.tril(np.random.normal(0.0, 0.01, size=(n_components, n_components)))np.fill_diagonal(V, 0.0)prev_W = np.zeros((Xs.shape[1], n_components))t = 0
At this point, it's possible to implement the training loop:
while(np.linalg.norm(W - prev_W, ord='fro') > threshold and t < max_iterations): prev_W = W.copy() ...
Read now
Unlock full access