Skip to content

Instantly share code, notes, and snippets.

@PratyushTripathy
Last active September 3, 2019 11:16
Show Gist options
  • Save PratyushTripathy/4d6ae0ce799b5f96e01ed4f178597cec to your computer and use it in GitHub Desktop.
Save PratyushTripathy/4d6ae0ce799b5f96e01ed4f178597cec to your computer and use it in GitHub Desktop.
from tensorflow import keras
# Define the parameters of the model
model = keras.Sequential([
keras.layers.Flatten(input_shape=(1, nBands)),
keras.layers.Dense(14, activation='relu'),
keras.layers.Dense(2, activation='softmax')])
# Define the accuracy metrics and parameters
model.compile(optimizer="adam", loss="sparse_categorical_crossentropy", metrics=["accuracy"])
# Run the model
model.fit(xTrain, yTrain, epochs=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment