def __init__(self, batch_size=100, ini_learning_rate=0.001, max_epochs=100, patience=10, y_tensor_type=T.ivector,
              L2=1e-4, objective=mean_categorical_crossentropy, adapt_learn_rate=get_constant(),
              update_function=get_update_adam(), valid_batch_iter=get_batch_iterator(),
              train_batch_iter=get_batch_iterator(), use_weights=False, samples_per_epoch=None,
              shuffle_train=True, report_dices=False, refinement_strategy=RefinementStrategy(),
              best_model_by_accurary=False, debug_mode=False, layer_update_filter=None, report_map=3):
     """
     Constructor
     """
     self.batch_size = batch_size
     self.ini_learning_rate = ini_learning_rate
     self.max_epochs = max_epochs
     self.patience = patience
     self.y_tensor_type = y_tensor_type
     self.L2 = L2
     self.objective = objective
     self.adapt_learn_rate = adapt_learn_rate
     self.update_function = update_function
     self.valid_batch_iter = valid_batch_iter
     self.train_batch_iter = train_batch_iter
     self.use_weights = use_weights
     self.samples_per_epoch = samples_per_epoch
     self.shuffle_train = shuffle_train
     self.report_dices = report_dices
     self.refinement_strategy = refinement_strategy
     self.best_model_by_accurary = best_model_by_accurary
     self.debug_mode = debug_mode
     self.layer_update_filter = layer_update_filter
     self.report_map = report_map
 def get_train_strategy():
     return TrainingStrategy(
         batch_size=BATCH_SIZE,
         ini_learning_rate=ini_learning_rate,
         max_epochs=max_epochs,
         patience=patience,
         y_tensor_type=T.matrix,
         L2=None,
         adapt_learn_rate=get_linear(start_decay, ini_learning_rate, max_epochs-start_decay),
         update_function=get_update_adam(),
         valid_batch_iter=get_valid_batch_iterator(),
         train_batch_iter=get_train_batch_iterator(),
         shuffle_train=True,
         best_model_by_accurary=best_model_by_accurary,
         refinement_strategy=RefinementStrategy(n_refinement_steps=0, refinement_patience=0, learn_rate_multiplier=0.0))