<s> import pynet . layer as layer <EOL> from pynet . model import * <EOL> from pynet . layer import * <EOL> from pynet . datasets . mnist import Mnist , Mnist_Blocks <EOL> import pynet . datasets . spec as spec <EOL> import pynet . datasets . mnist as mnist <EOL> import pynet . datasets . transfactor as tf <EOL> import pynet . datasets . mapping as mapping <EOL> import pynet . learning_method as learning_methods <EOL> from pynet . learning_rule import LearningRule <EOL> from pynet . log import Log <EOL> from pynet . train_object import TrainObject <EOL> from pynet . cost import Cost <EOL> import pynet . datasets . preprocessor as preproc <EOL> import pynet . datasets . dataset_noise as noisy <EOL> import pynet . layer_noise as layer_noise <EOL> import cPickle <EOL> import os <EOL> from hps . models . model import AE <EOL> import theano <EOL> from theano . sandbox . cuda . var import CudaNdarraySharedVariable <EOL> floatX = theano . config . floatX <EOL> class Laura_Continue ( AE ) : <EOL> def __init__ ( self , state ) : <EOL> self . state = state <EOL> def build_model ( self ) : <EOL> with open ( os . environ [ '<STR_LIT>' ] + '<STR_LIT:/>' <EOL> + self . state . hidden1 . model + '<STR_LIT>' ) as f : <EOL> model = cPickle . load ( f ) <EOL> return model <EOL> def run ( self ) : <EOL> dataset = self . build_dataset ( ) <EOL> learning_rule = self . build_learning_rule ( ) <EOL> learn_method = self . build_learning_method ( ) <EOL> model = self . build_model ( ) <EOL> if self . state . fine_tuning_only : <EOL> for layer in model . layers : <EOL> layer . dropout_below = None <EOL> layer . noise = None <EOL> print "<STR_LIT>" <EOL> if self . state . log . save_to_database_name : <EOL> database = self . build_database ( dataset , learning_rule , learn_method , model ) <EOL> database [ '<STR_LIT>' ] [ '<STR_LIT>' ] = self . state . hidden1 . model <EOL> log = self . build_log ( database ) <EOL> train_obj = TrainObject ( log = log , <EOL> dataset = dataset , <EOL> learning_rule = learning_rule , <EOL> learning_method = learn_method , <EOL> model = model ) <EOL> train_obj . run ( ) <EOL> if not self . state . fine_tuning_only : <EOL> log . info ( "<STR_LIT>" ) <EOL> for layer in train_obj . model . layers : <EOL> layer . dropout_below = None <EOL> layer . noise = None <EOL> train_obj . setup ( ) <EOL> train_obj . run ( ) </s>
