def on_train_begin(self, logs={}): Callback.on_train_begin(self, logs=logs) # initialize list of losses self.losses = [] self.val_losses = [] # initialize plotting plt.ion() fig = plt.figure() self.ax = fig.add_subplot(111)
def on_train_begin(self, logs={}): Callback.on_train_begin(self, logs=logs) fig = plt.figure() self.axFig = fig.add_subplot(111) # DO PCA self.pca = decomposition.PCA(n_components=2) self.pca.fit(self.xTarget) self.targetEmbedding = np.dot(self.xTarget, self.pca.components_[[0, 1]].transpose())