Tabular Predictor - Jupyter Notebook

The train_tabular_predictor.ipynb example demonstrates Trains uploading tabular data stored as artifacts by another Task, and training a network with that data. It also shows Trains automatic logging with TensorBoard.

When the script runs, it creates an experiment named tabular prediction which is associated with the Table Example project.

Plots (tables)

In the example code, the outcome of each epoch's validation is reported as a table.

debug_categories = pd.DataFrame(x1.numpy(), columns=columns_categories_ordered.keys())
debug_numercal = pd.DataFrame(x2.numpy(), columns=columns_numerical)
debug_gt = pd.DataFrame(np.array([reveresed_outcome_dict[int(e)] for e in y]), columns=['GT'])
debug_pred = pd.DataFrame(np.array([reveresed_outcome_dict[int(e)] for e in pred.cpu()]), columns=['Pred'])
debug_table = debug_categories.join([debug_numercal, debug_gt, debug_pred])
Logger.current_logger().report_table(title='Trainset - after labels encoding',series='pandas DataFrame',iteration=epoch, table_plot=debug_table.head())

The tabular data appears in RESULTS > PLOTS.



Trains automatically logs training loss and learning. They appear in RESULTS > SCALARS.



Trains automatically logs TensorFlow DEFINES. A parameter dictionary is logged by connecting it to the Task using a call to the Task.connect method.

configuration_dict = {'number_of_epochs': 30, 'batch_size': 100, 'dropout': 0.3, 'base_lr': 0.1}
configuration_dict = task.connect(configuration_dict)

Parameter dictionaries appear in the General subsection.


The TensorFlow DEFINES appear in the TF_DEFINE subsection.



Output to the console appears in RESULTS > LOG.