def build_model() :
model = models.Sequential()
model.add (layers.Dense (16 , activation = "relu" , input_shape = x.shape))
model.add (layers.Dense (16, activation = "relu"))
model.add (layers.Dense (1 , activation = "sigmoid"))
model.compile(optimizer = "adam" , loss = "binary_crossentropy" , metrics =["accuracy"])
return model
model = build_model ()
history = model.fit ( x_train, y_train, epochs = 100, batch_size = 5 , validation_data = (x_val, y_val) )
def build_model() :
model = models.Sequential()
model.add (layers.Dense (16 , activation = "relu" , input_shape = x.shape))
model.add (layers.Dense (16, activation = "relu"))
model.add (layers.Dense (1 , activation = "sigmoid"))
model.compile(optimizer = "adam" , loss = "binary_crossentropy" , metrics =["accuracy"])
return model
model = build_model ()
history = model.fit ( x_train, y_train, epochs = 1000, batch_size = 5 , validation_data = (x_val, y_val) )
file:///home/oem/Scaricati/MicrosoftTeams-image.png
file:///home/oem/Scaricati/MicrosoftTeams-image%20(1).png
def build_model() :
model = models.Sequential()
model.add (layers.Dense (16 , activation = "relu" , input_shape = x.shape))
model.add (layers.Dense (16, activation = "relu"))
model.add (layers.Dense (1 , activation = "sigmoid"))
model.compile(optimizer = "adam" , loss = "binary_crossentropy" , metrics =["accuracy"])
return model
model = build_model ()
history = model.fit ( x_train, y_train, epochs = 500, batch_size = 2 , validation_data = (x_val, y_val) )