smoother.models.reduction._utils ================================ .. py:module:: smoother.models.reduction._utils Functions --------- .. autoapisummary:: smoother.models.reduction._utils.iterate smoother.models.reduction._utils.broadcast_labels smoother.models.reduction._utils.get_max_epochs_heuristic smoother.models.reduction._utils.set_params_online_update Module Contents --------------- .. py:function:: iterate(obj, func) Iterates over an object and applies a function to each element. .. py:function:: broadcast_labels(o, n_broadcast=-1) Utility for the semi-supervised setting. If y is defined(labelled batch) then one-hot encode the labels (no broadcasting needed) If y is undefined (unlabelled batch) then generate all possible labels (and broadcast other arguments if not None) .. py:function:: get_max_epochs_heuristic(n_obs: int, epochs_cap: int = 400, decay_at_n_obs: int = 20000) -> int Compute a heuristic for the default number of maximum epochs. If `n_obs <= decay_at_n_obs`, the number of maximum epochs is set to `epochs_cap`. Otherwise, the number of maximum epochs decays according to `(decay_at_n_obs / n_obs) * epochs_cap`, with a minimum of 1. :param n_obs: The number of observations in the dataset. :param epochs_cap: The maximum number of epochs for the heuristic. :param decay_at_n_obs: The number of observations at which the heuristic starts decaying. :returns: A heuristic for the default number of maximum epochs. :rtype: `int` .. py:function:: set_params_online_update(module, unfrozen, freeze_decoder_first_layer, freeze_batchnorm_encoder, freeze_batchnorm_decoder, freeze_dropout, freeze_expression, freeze_classifier) Freeze parts of network for scArches.