tangram.mapping_optimizer.MapperConstrained.train

MapperConstrained.train(num_epochs, learning_rate=0.1, print_each=100)

Run the optimizer and returns the mapping outcome.

Parameters
  • num_epochs (int) – Number of epochs.

  • learning_rate (float) – Optional. Learning rate for the optimizer. Default is 0.1.

  • print_each (int) – Optional. Prints the loss each print_each epochs. If None, the loss is never printed. Default is 100.

Returns

M (ndarray): is the optimized mapping matrix, shape = (number_cells, number_spots). f (ndarray): is the optimized filter, shape = (number_cells,). training_history (dict): loss for each epoch

Return type

A tuple (output, F_out, training_history), with