def test_empty_monitoring_datasets():
 learning_rate = 0.001
 batch_size = 5
 dim = 3
 rng = np.random.RandomState([25, 9, 2012])
 train_dataset = DenseDesignMatrix(X=rng.randn(10, dim))
 model = SoftmaxModel(dim)
 cost = DummyCost()
 algorithm = SGD(learning_rate, cost, batch_size=batch_size, monitoring_dataset={}, termination_criterion=EpochCounter(2))
 train = Train(train_dataset, model, algorithm, save_path=None, save_freq=0, extensions=None)
 train.main_loop()

def test_empty_monitoring_datasets ( ) : learning_rate = 0.001 batch_size = 5 dim = 3 rng = np . random . RandomState ( [ 25 , 9 , 2012 ] ) train_dataset = DenseDesignMatrix ( X = rng . randn ( 10 , dim ) ) model = SoftmaxModel ( dim ) cost = DummyCost ( ) algorithm = SGD ( learning_rate , cost , batch_size = batch_size , monitoring_dataset = { } , termination_criterion = EpochCounter ( 2 ) ) train = Train ( train_dataset , model , algorithm , save_path = None , save_freq = 0 , extensions = None ) train . main_loop ( )
test that handling of monitoring datasets dictionnary does not fail when it is empty .