def create_new_notebook(self): """ Create new notebook """ self.Notebook = notebook.Notebook()
wandb_logging_callback = LambdaCallback(on_epoch_end=log_generator) notebook_callback = notebook.KerasCallback(print.add_block(), len(train)) discriminator.trainable = False print("Training Generator", fmt='header') joint_model.summary(print_fn=small_print) joint_model.fit(train, labels, epochs=config.generator_epochs, batch_size=config.batch_size, callbacks=[wandb_logging_callback, notebook_callback]) generator.save(path.join(run.dir, "generator.h5")) with notebook.Notebook() as print: # init wandb # load the real training data (x_train, y_train), (x_test, y_test) = mnist.load_data() x_train = x_train / 255.0 * 2.0 - 1.0 x_test = x_test / 255.0 * 2.0 - 1.0 x_train = x_train.astype('float32') x_test = x_test.astype('float32') sgd = SGD(lr=0.01, decay=1e-6, momentum=0.9, nesterov=True) # only try to create 8s # x_train = x_train[y_train == 8] # x_test = x_test[y_test == 8] discriminator = create_discriminator()
def createInterior(self): return notebook.Notebook(self._panel, agwStyle=aui.AUI_NB_DEFAULT_STYLE & ~aui.AUI_NB_TAB_SPLIT & \ ~aui.AUI_NB_TAB_MOVE & ~aui.AUI_NB_DRAW_DND_TAB)
def make_notebook(self, **kwargs): """Make a Notebook""" import notebook return(notebook.Notebook(kwargs['window']))
''' print(obj) print('\n') print('Attributes and methods of Notebook instance:') print(dir(obj)) print('\n') print('Attributes and methods of Notebook instance method:') print(dir(obj.new_note('hello'))) print('\n') print('Attributes and methods of the attribute:') print(dir(obj.notes)) print('\n') print('Isinstance func shows that instance of the class and the method ' 'of the class are objects (actually, everything is an object): ') print(isinstance(obj, object)) print(isinstance(obj.new_note('hello'), object)) print(isinstance(obj.__init__(), object)) print(isinstance(obj.notes, object)) print('\n') print('Init and str methods have their attributes too: ') print(dir(obj.__init__())) print(dir(obj.__str__())) if __name__ == '__main__': obj = notebook.Notebook() notebook_researching(obj)