Check my code trainer=Trainer( epochs=numepochs, learningrate=1e-3,…
- User
Check my code
trainer=Trainer( epochs=num_epochs, learning_rate=1e-3, num_batches_per_epoch=100, add_default_callbacks=True )
estimator = DeepAREstimator( prediction_length=prediction_length, context_length=context_length, freq=time_freq, trainer=trainer, num_layers=4, num_cells=40, cell_type='lstm', dropout_rate=0.1, use_feat_static_cat=True, cardinality=[2], batch_size=batch_size, embedding_dimension=[10], )
Инициализация оптимизатора
num_epoch = 100 run_name = f'deepAR prob_forecast datasetstep={step_in_dataset} lag={lag_freq} in={context_length} out={prediction_length}' model_rev = 'deepAR_model_rev_1_0' model_path = f'{work_model_path}/{model_rev}'
if TRAINING:
with mlflow.start_run(experiment_id=experiment_id, run_name=run_name): mlflow.log_param("num_epoch", num_epoch) mlflow.log_param("batch_size", batch_size) mlflow.log_param("model_architecture", str(estimator)) predictor = estimator.train(train_dataset) mlflow.log_metric("Loss -LNN", loss, step=epoch) predictor.serialize(path=model_path) mlflow.log_artifact(model_path) mlflow.end_run()estimator
how can i get metrics in this line mlflow.log_metric("Loss -LNN", loss, step=epoch)?
- Assistant