@keras_test
def test_temporal_regression():
 ((X_train, y_train), (X_test, y_test)) = get_test_data(nb_train=500, nb_test=400, input_shape=(3, 5), output_shape=(2,), classification=False)
 model = Sequential()
 model.add(GRU(y_train.shape[(-1)], input_shape=(X_train.shape[1], X_train.shape[2])))
 model.compile(loss='hinge', optimizer='adam')
 history = model.fit(X_train, y_train, nb_epoch=5, batch_size=16, validation_data=(X_test, y_test), verbose=0)
 assert (history.history['val_loss'][(-1)] < 1.0)

@ keras_test def test_temporal_regression ( ) : ( ( X_train , y_train ) , ( X_test , y_test ) ) = get_test_data ( nb_train = 500 , nb_test = 400 , input_shape = ( 3 , 5 ) , output_shape = ( 2 , ) , classification = False ) model = Sequential ( ) model . add ( GRU ( y_train . shape [ ( - 1 ) ] , input_shape = ( X_train . shape [ 1 ] , X_train . shape [ 2 ] ) ) ) model . compile ( loss = 'hinge' , optimizer = 'adam' ) history = model . fit ( X_train , y_train , nb_epoch = 5 , batch_size = 16 , validation_data = ( X_test , y_test ) , verbose = 0 ) assert ( history . history [ 'val_loss' ] [ ( - 1 ) ] < 1.0 )
predict float numbers based on sequences of float numbers of length 3 using a single layer of gru units .