<s> '''<STR_LIT>''' <EOL> import climate <EOL> import numpy as np <EOL> climate . enable_default_logging ( ) <EOL> np . random . seed ( <NUM_LIT> ) <EOL> NUM_EXAMPLES = <NUM_LIT:64> <EOL> NUM_INPUTS = <NUM_LIT:7> <EOL> NUM_HID1 = <NUM_LIT:8> <EOL> NUM_HID2 = <NUM_LIT:12> <EOL> NUM_OUTPUTS = <NUM_LIT:5> <EOL> NUM_CLASSES = <NUM_LIT:6> <EOL> INPUTS = np . random . randn ( NUM_EXAMPLES , NUM_INPUTS ) . astype ( '<STR_LIT:f>' ) <EOL> INPUT_WEIGHTS = abs ( np . random . randn ( NUM_EXAMPLES , NUM_INPUTS ) ) . astype ( '<STR_LIT:f>' ) <EOL> OUTPUTS = np . random . randn ( NUM_EXAMPLES , NUM_OUTPUTS ) . astype ( '<STR_LIT:f>' ) <EOL> OUTPUT_WEIGHTS = abs ( np . random . randn ( NUM_EXAMPLES , NUM_OUTPUTS ) ) . astype ( '<STR_LIT:f>' ) <EOL> CLASSES = np . random . randint ( NUM_CLASSES , size = NUM_EXAMPLES ) . astype ( '<STR_LIT:i>' ) <EOL> CLASS_WEIGHTS = abs ( np . random . rand ( NUM_EXAMPLES ) ) . astype ( '<STR_LIT:f>' ) <EOL> AE_DATA = [ INPUTS ] <EOL> WAE_DATA = [ INPUTS , INPUT_WEIGHTS ] <EOL> AE_LAYERS = [ NUM_INPUTS , NUM_HID1 , NUM_HID2 , NUM_INPUTS ] <EOL> CLF_DATA = [ INPUTS , CLASSES ] <EOL> WCLF_DATA = [ INPUTS , CLASSES , CLASS_WEIGHTS ] <EOL> CLF_LAYERS = [ NUM_INPUTS , NUM_HID1 , NUM_HID2 , NUM_CLASSES ] <EOL> REG_DATA = [ INPUTS , OUTPUTS ] <EOL> WREG_DATA = [ INPUTS , OUTPUTS , OUTPUT_WEIGHTS ] <EOL> REG_LAYERS = [ NUM_INPUTS , NUM_HID1 , NUM_HID2 , NUM_OUTPUTS ] <EOL> class RNN : <EOL> NUM_TIMES = <NUM_LIT> <EOL> INPUTS = np . random . randn ( NUM_EXAMPLES , NUM_TIMES , NUM_INPUTS ) . astype ( '<STR_LIT:f>' ) <EOL> INPUT_WEIGHTS = abs ( <EOL> np . random . randn ( NUM_EXAMPLES , NUM_TIMES , NUM_INPUTS ) ) . astype ( '<STR_LIT:f>' ) <EOL> OUTPUTS = np . random . randn ( NUM_EXAMPLES , NUM_TIMES , NUM_OUTPUTS ) . astype ( '<STR_LIT:f>' ) <EOL> OUTPUT_WEIGHTS = abs ( <EOL> np . random . randn ( NUM_EXAMPLES , NUM_TIMES , NUM_OUTPUTS ) ) . astype ( '<STR_LIT:f>' ) <EOL> CLASSES = np . random . randn ( NUM_EXAMPLES , NUM_TIMES ) . astype ( '<STR_LIT:i>' ) <EOL> CLASS_WEIGHTS = abs ( np . random . rand ( NUM_EXAMPLES , NUM_TIMES ) ) . astype ( '<STR_LIT:f>' ) <EOL> AE_DATA = [ INPUTS ] <EOL> WAE_DATA = [ INPUTS , INPUT_WEIGHTS ] <EOL> CLF_DATA = [ INPUTS , CLASSES ] <EOL> WCLF_DATA = [ INPUTS , CLASSES , CLASS_WEIGHTS ] <EOL> REG_DATA = [ INPUTS , OUTPUTS ] <EOL> WREG_DATA = [ INPUTS , OUTPUTS , OUTPUT_WEIGHTS ] <EOL> class CNN : <EOL> NUM_WIDTH = <NUM_LIT> <EOL> NUM_HEIGHT = <NUM_LIT:15> <EOL> FILTER_WIDTH = <NUM_LIT:4> <EOL> FILTER_HEIGHT = <NUM_LIT:3> <EOL> FILTER_SIZE = ( FILTER_WIDTH , FILTER_HEIGHT ) <EOL> INPUTS = np . random . randn ( <EOL> NUM_EXAMPLES , NUM_WIDTH , NUM_HEIGHT , NUM_INPUTS ) . astype ( '<STR_LIT:f>' ) <EOL> CLF_DATA = [ INPUTS , CLASSES ] <EOL> WCLF_DATA = [ INPUTS , CLASSES , CLASS_WEIGHTS ] <EOL> REG_DATA = [ INPUTS , OUTPUTS ] <EOL> WREG_DATA = [ INPUTS , OUTPUTS , OUTPUT_WEIGHTS ] <EOL> def assert_progress ( model , data , algo = '<STR_LIT>' ) : <EOL> trainer = model . itertrain ( <EOL> data , algo = algo , momentum = <NUM_LIT:0.5> , batch_size = <NUM_LIT:3> , max_gradient_norm = <NUM_LIT:1> ) <EOL> train0 , valid0 = next ( trainer ) <EOL> train1 , valid1 = next ( trainer ) <EOL> assert train1 [ '<STR_LIT>' ] < valid0 [ '<STR_LIT>' ] <EOL> assert valid1 [ '<STR_LIT>' ] == valid0 [ '<STR_LIT>' ] <EOL> def assert_shape ( actual , expected ) : <EOL> if not isinstance ( expected , tuple ) : <EOL> expected = ( NUM_EXAMPLES , expected ) <EOL> assert actual == expected </s>
