MCPcopy Create free account
hub / github.com/VivekPa/AIAlpha / train_model

Method train_model

models/autoencoder.py:30–41  ·  view source on GitHub ↗
(self, model, data, epochs, model_name, save_model=True)

Source from the content-addressed store, hash-verified

28 self.encoder = Model(input_data, encoded3)
29
30 def train_model(self, model, data, epochs, model_name, save_model=True):
31
32 model.compile(loss="mean_squared_error", optimizer="adam", metrics=['acc', 'mae'])
33
34 train = data
35 ntrain = np.array(train)
36 train_data = np.reshape(ntrain, (len(ntrain), 1, self.input_shape))
37
38 model.fit(train_data, train_data, epochs=epochs)
39
40 if save_model:
41 model.save(f"models/saved_models/{model_name}.h5")
42
43 def test_model(self, model, data):
44 test = data

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected