#NEWLINE# def test_sgd_unsup( ) : #NEWLINE# #INDENT# dim = 3 #NEWLINE# m = 10 #NEWLINE# rng = np . random . RandomState ( [ 25 , 9 , 2012 ] ) #NEWLINE# X = rng . randn ( m , dim ) #NEWLINE# dataset = DenseDesignMatrix ( X = X ) #NEWLINE# m = 15 #NEWLINE# X = rng . randn ( m , dim ) #NEWLINE# monitoring_dataset = DenseDesignMatrix ( X = X ) #NEWLINE# model = SoftmaxModel ( dim ) #NEWLINE# learning_rate = 0.001 #NEWLINE# batch_size = 5 #NEWLINE# cost = DummyCost ( ) #NEWLINE# termination_criterion = EpochCounter ( 5 ) #NEWLINE# algorithm = SGD ( learning_rate , cost , batch_size = batch_size , monitoring_batches = 3 , monitoring_dataset = monitoring_dataset , termination_criterion = termination_criterion , update_callbacks = None , set_batch_size = False ) #NEWLINE# train = Train ( dataset , model , algorithm , save_path = None , save_freq = 0 , extensions = None ) #NEWLINE# train . main_loop ( )