SHARE
TWEET

Untitled

a guest May 1st, 2020 35 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import keras
  2. from keras.models import Sequential
  3. from keras.layers import Dense, Dropout, Flatten, Input
  4. import numpy as np
  5.  
  6. model = Sequential()
  7. model.add(Dense(32, input_dim=32, activation='relu'))
  8. model.add(Dense(5))
  9.  
  10. model.compile(loss=keras.losses.mean_squared_error,
  11.               optimizer=keras.optimizers.Adam())
  12.  
  13. data = np.random.normal(size=(512, 32))
  14. ans = np.random.normal(size=(512, 5))
  15.  
  16. while True:
  17.     model.fit(data, ans, epochs=100, verbose=0)
  18.     print (model.predict(data[10:11, :]), '\n', ans[10:11, :])
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top