mt_metadata.features.weights.monotonic_weight_kernel

Classes

ThresholdEnum

str(object='') -> str

StyleEnum

str(object='') -> str

MonotonicWeightKernel

MonotonicWeightKernel

Module Contents

class mt_metadata.features.weights.monotonic_weight_kernel.ThresholdEnum

Bases: mt_metadata.common.enumerations.StrEnumerationBase

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

low_cut = 'low cut'
high_cut = 'high cut'
class mt_metadata.features.weights.monotonic_weight_kernel.StyleEnum

Bases: mt_metadata.common.enumerations.StrEnumerationBase

str(object=’’) -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.__str__() (if defined) or repr(object). encoding defaults to ‘utf-8’. errors defaults to ‘strict’.

taper = 'taper'
activation = 'activation'
class mt_metadata.features.weights.monotonic_weight_kernel.MonotonicWeightKernel(**data)

Bases: mt_metadata.features.weights.base.Base

MonotonicWeightKernel

Base class for monotonic weight kernels. Handles bounds, normalization, and direction.

A weighting kernel that applies a monotonic activation/taper function between defined lower and upper bounds, based on a given threshold direction.

There are two main types of monotonic kernels: taper and activation. The taper function is used to smoothly transition between the lower and upper bounds over some finite interval, while the activation style offers options that asymptote to 0 or 1, such as sigmoid or tanh. Thus the activation style supports +/- infinity bounds, while the taper style requires finite bounds.

threshold: Annotated[ThresholdEnum, Field(default=ThresholdEnum.low_cut, description='Which side of a threshold should be downweighted.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['low cut']})]
style: Annotated[StyleEnum, Field(default=StyleEnum.taper, description='Tapering/activation function to use between transition bounds.', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['activation']})]
transition_lower_bound: Annotated[float, Field(default=-1000000000.0, description='Start of the taper region (weight begins to change).', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['-inf']})]
transition_upper_bound: Annotated[float, Field(default=1000000000.0, description='End of the taper region (weight finishes changing).', alias=None, json_schema_extra={'units': None, 'required': True, 'examples': ['+inf']})]