From 01f7eccb82c5833979d1b72e34def774d47d8c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dudziak?= Date: Wed, 10 May 2023 11:35:53 +0200 Subject: [PATCH] Zaktualizuj 'sacred.py' --- sacred.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/sacred.py b/sacred.py index 6c35de4..d9c2c48 100644 --- a/sacred.py +++ b/sacred.py @@ -34,33 +34,25 @@ def run_experiment(): feature_cols = ['year', 'mileage', 'vol_engine'] inputs = tf.keras.Input(shape=(len(feature_cols),)) - # Warstwy sieci neuronowej x = tf.keras.layers.Dense(10, activation='relu')(inputs) x = tf.keras.layers.Dense(10, activation='relu')(x) outputs = tf.keras.layers.Dense(1, activation='linear')(x) - # Utworzenie modelu model = tf.keras.Model(inputs=inputs, outputs=outputs) - # Kompilacja modelu model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.001), loss='mse', metrics=['mae']) - # Trenowanie modelu model.fit(cars_train[feature_cols], cars_train['price'], epochs=100) - # Zapis plików wejściowych ex.add_resource('train_data.csv') ex.add_resource('test_data.csv') - # Zapis kodu źródłowego ex.add_artifact(__file__) - # Zapis modelu do pliku model.save('model.h5') ex.add_artifact('model.h5') - # Zapisanie metryk metrics = model.evaluate(cars_train[feature_cols], cars_train['price']) ex.log_scalar('mse', metrics[0]) ex.log_scalar('mae', metrics[1]) \ No newline at end of file