sage.core.manager

Filename : manager.py Description : Short description of the file

Created on 2026-01-19 16:47:21

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, Sage __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Classes

ProbabilityManager

Internal manager to handle probabilities of classes/options.

Module Contents

class ProbabilityManager[source]

Internal manager to handle probabilities of classes/options.

probs[source]
register(cls, prob)[source]

Assign a sampling probability to a class.

Parameters:
  • cls (type) – Class whose name is used as the registry key.

  • prob (float) – Desired sampling probability in [0, 1].

get_normalized_probs(classes)[source]

Return normalized probability array for a list of classes

Parameters:

classes (List[Type])

Return type:

numpy.ndarray

sample(classes)[source]

Draw one class from classes weighted by registered probabilities.

Unregistered classes share the remaining probability mass equally.

Parameters:

classes (list[type]) – Candidate classes to sample from.

Returns:

The sampled class.

Return type:

type