(self, metadata)
Read relevant results and log into MLflow.
Read relevant results and log into MLflow.
Read relevant results and log into MLflow .
def on_epoch_end(self, metadata):
        """Read relevant results and log into MLflow."""
        epoch = metadata.get('epoch')

        with ChangeWorkingDirectory(self.mlflow_path):
            # log some metadata
            if self.experiment_name is not None:
                mlflow.set_experiment(self.experiment_name)

            with mlflow.start_run(run_id=self._run_id):
                try:
                    df = self.run.history.metrics_per_epoch(epoch)

                    metrics = {'_'.join(list(map(lambda x: str(x), k))): v for k, v in
                               df.groupby(['dataloader', 'metric', 'lookback'])['value'].mean().items()}
                    mlflow.log_metrics(metrics, step=epoch)

                except KeyError:
                    return
def on_epoch_end ( self , metadata ) : epoch = metadata . get ( 'epoch' ) with ChangeWorkingDirectory ( self . mlflow_path ) : # log some metadata if self . experiment_name is not None : mlflow . set_experiment ( self . experiment_name ) with mlflow . start_run ( run_id = self . _run_id ) : try : df = self . run . history . metrics_per_epoch ( epoch ) metrics = { '_' . join ( list ( map ( lambda x : str ( x ) , k ) ) ) : v for k , v in df . groupby ( [ 'dataloader' , 'metric' , 'lookback' ] ) [ 'value' ] . mean ( ) . items ( ) } mlflow . log_metrics ( metrics , step = epoch ) except KeyError : return