Module Import alias Import alias Import alias Expr Call AttributeLoad NameLoad attr Str Import alias identifier Expr Call AttributeLoad NameLoad attr ImportFrom alias identifier Import alias identifier Import alias identifier Import alias identifier ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Str body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad keyword Dict Str Num decorator_list Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Assign NameStore SubscriptLoad AttributeLoad Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Index Num attr Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body Expr Call NameLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad ExtSlice Slice Index NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num For NameStore Call NameLoad NameLoad body Expr Call NameLoad SubscriptLoad Call AttributeLoad NameLoad attr Slice UnaryOpUSub Call NameLoad BinOpMult Call NameLoad NameLoad Num SubscriptLoad SubscriptLoad NameLoad Slice UnaryOpUSub Call NameLoad BinOpMult Call NameLoad NameLoad Num ExtSlice Slice Index NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr BinOpMod Str AttributeLoad AttributeLoad NameLoad attr attr For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq Call NameLoad NameLoad Num body Return Assign NameStore Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Str For NameStore Call NameLoad Call NameLoad NameLoad body If BoolOpAnd UnaryOpNot CompareEq NameLoad Num CompareEq BinOpMod NameLoad NameLoad Num body AugAssignAdd NameStore Str AugAssignAdd NameStore BinOpAdd Str SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A logging N/A sys N/A matplotlib N/A N/A N/A matplotlib use Agg N/A matplotlib.pyplot plt N/A N/A N/A plt ioff utils env_paths paths N/A seaborn sns N/A numpy np N/A cPickle pkl Train N/A object N/A N/A 
    The :class:'Train' class general training functions.
    It should be subclassed when implementing new types of training loops.
     __init__ N/A N/A self model pickle_f_custom_freq custom_eval_func N/A None None N/A N/A 
        Initialisation of the basic architecture and programmatic settings of any training procedure.
        This method should be called from any subsequent inheriting training procedure.
        :param model: The model to train on.
        :param pickle_f_custom_freq: The number of epochs between each serialization, plotting etc.
        :param custom_eval_func: The custom evaluation function taking (model, output_path) as arguments.
         N/A N/A self model model N/A N/A self logger None N/A N/A N/A self init_logging N/A N/A self x_dist None N/A N/A self custom_eval_func custom_eval_func N/A N/A self eval_train N/A N/A N/A self eval_test N/A N/A N/A self eval_validation N/A N/A N/A self pickle_f_custom_freq pickle_f_custom_freq N/A train_model N/A N/A self N/A args N/A N/A 
        This is where the training of the model is performed.
        :param n_epochs: The number of epochs to train for.
         N/A NotImplementedError N/A dump_dicts N/A N/A self N/A N/A N/A 
        Dump the model evaluation dictionaries
         N/A p_train N/A N/A paths get_plot_evaluation_path_for_model N/A N/A N/A self model get_root_path train_dict.pkl N/A N/A N/A pkl dump N/A self eval_train N/A open p_train wb N/A p_test N/A N/A paths get_plot_evaluation_path_for_model N/A N/A N/A self model get_root_path test_dict.pkl N/A N/A N/A pkl dump N/A self eval_test N/A open p_test wb N/A p_val N/A N/A paths get_plot_evaluation_path_for_model N/A N/A N/A self model get_root_path validation_dict.pkl N/A N/A N/A pkl dump N/A self eval_validation N/A open p_val wb N/A plot_eval N/A N/A self eval_dict labels path_extension N/A N/A N/A 
        Plot the loss function in a overall plot and a zoomed plot.
        :param path_extension: If the plot should be saved in an incremental way.
         plot N/A N/A x y fit label N/A N/A N/A N/A N/A sns regplot N/A N/A np array x N/A N/A np array y fit_reg fit label label scatter_kws N/A s 5 N/A N/A N/A N/A plt clf N/A N/A N/A plt subplot 211 N/A idx N/A N/A N/A N/A np array N/A N/A N/A eval_dict values N/A 0 shape N/A 0 N/A x N/A N/A np array N/A N/A eval_dict values N/A i N/A range idx N/A N/A N/A plot N/A N/A eval_dict keys N/A x N/A N/A N/A i False N/A labels N/A i N/A N/A N/A plt legend N/A N/A N/A plt subplot 212 N/A i N/A range idx N/A N/A N/A plot N/A N/A N/A eval_dict keys N/A N/A N/A int N/A N/A len x 0.25 N/A N/A x N/A N/A N/A int N/A N/A len x 0.25 N/A N/A N/A i True N/A labels N/A i N/A N/A N/A plt xlabel Epochs N/A N/A N/A plt savefig N/A N/A paths get_plot_evaluation_path_for_model N/A N/A N/A self model get_root_path N/A path_extension .png N/A init_logging N/A N/A self N/A N/A N/A 
        Initiate the logging, so that all the training output will be saved in a .log file.
         N/A logger N/A N/A logging getLogger N/A %slogger N/A N/A self __class__ __name__ N/A hdlr N/A logger handlers N/A N/A N/A N/A logger removeHandler hdlr N/A hdlr N/A N/A logging FileHandler N/A N/A paths get_logging_path N/A N/A N/A self model get_root_path N/A formatter N/A N/A logging Formatter %(message)s N/A N/A N/A hdlr setFormatter formatter N/A N/A N/A logger addHandler hdlr N/A ch N/A N/A logging StreamHandler N/A sys stdout N/A N/A N/A ch setFormatter formatter N/A N/A N/A logger addHandler ch N/A N/A N/A logger setLevel N/A logging INFO N/A N/A self logger logger N/A write_to_logger N/A N/A self s N/A N/A N/A 
        Write a string to the logger and the console.
        :param s: A string with the text to print.
         N/A N/A N/A N/A self logger info s N/A add_initial_training_notes N/A N/A self s N/A N/A N/A 
        Add an initial text for the model as a personal
        note, to keep an order of experimental testing.
        :param s: A string with the text to print.
         N/A N/A N/A len s 0 N/A N/A N/A line_length 10 N/A N/A N/A self write_to_logger ### INITIAL TRAINING NOTES ### N/A w_lst N/A N/A s split N/A new_s N/A i N/A range N/A len w_lst N/A N/A N/A N/A N/A i 0 N/A N/A i line_length 0 N/A N/A new_s N/A new_s N/A N/A w_lst N/A i N/A N/A N/A self write_to_logger new_s N/A N/A