from tensorflow.keras import Input, layers
input_tensor = Input(shape=(32, ))
dense = layers.Dense(32, activation='relu')
output_tensor = dense(input_tensor)
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras import layers, Input
import numpy as np
seq_model = Sequential()
seq_model.add(layers.Dense(32, activation='relu', input_shape=(64, )))
seq_model.add(layers.Dense(32, activation='relu'))
seq_model.add(layers.Dense(10, activation='softmax'))
input_tensor = Input(shape=(64, ))
x = layers.Dense(32, activation='relu')(input_tensor)
x = layers.Dense(32, activation='relu')(x)
output_tensor = layers.Dense(10, activation='softmax')(x)
model = Model(input_tensor, output_tensor)
model.summary()
model.compile(optimizer='rmsprop', loss='categorical_crossentropy')
x_train = np.random.random((1000, 64))
y_train = np.random.random((1000, 10))
history = model.fit(x_train, y_train, batch_size=128, epochs=10)
score = model.evaluate(x_train, y_train)
print('\n', score)