Last active
June 5, 2017 02:24
-
-
Save akelleh/26ed5e50fa336d11b0a96cb7aee32ccc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from keras.models import Model | |
from keras.layers import Dense, Input | |
x_in = Input(shape=(2,)) | |
h1 = Dense(2, activation='relu')(x_in) | |
y = Dense(1, activation='linear')(h1) | |
model = Model(input=x_in, output=y) | |
model.compile(optimizer='rmsprop', | |
loss='mean_squared_error') | |
model.fit(x=[[0,0],[0,1],[1,0],[1,1]], y=[[0],[1],[1],[0]], nb_epoch=2000) | |
model.predict([[0,0],[0,1],[1,0],[1,1]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment