pymoto.SoftMinMax

class pymoto.SoftMinMax(alpha=1.0, scaling: AggScaling = None, active_set: AggActiveSet = None)

Soft maximum/minimum function aggregation

\(S_a(x_1, x_2, \dotsc, x_n) = \frac{\sum_i (x_i \exp(a x_i))}{\sum_i (\exp(a x_i))}\)

When using as maximum, it underestimates the maximum It is exact however when \(x_1=x_2=\dotsc=x_n`\)

__init__(alpha=1.0, scaling: AggScaling = None, active_set: AggActiveSet = None)

Initialize soft min/max aggregation module

Parameters:
  • alpha (float, optional) – Scaling factor of the soft function. Approximate maximum for alpha>0 and minimum for alpha<0. Defaults to 1.0.

  • scaling (pymoto.AggScaling, optional) – Scaling strategy to improve approximation

  • active_set (pymoto.AggActiveSet, optional) – Active set strategy to improve approximation

Methods

__init__([alpha, scaling, active_set])

Initialize soft min/max aggregation module

aggregation_derivative(x)

" Calculates df(x) / dx

aggregation_function(x)

Calculates f(x)

connect(sig_in[, sig_out])

Connect without automatic adding to a function network

get_input_sensitivities([as_list])

get_input_states([as_list])

get_output_sensitivities([as_list])

get_output_states([as_list])

reset()

Reset the state of the sensitivities (they are set to zero or to None)

response()

Calculate the response from sig_in and output this to sig_out

sensitivity()

Calculate sensitivities using backpropagation

Attributes

n_in

Get the number of input signals

n_out

Get the number of output signals

sig_in

sig_out

aggregation_function(x)

Calculates f(x)

aggregation_derivative(x)

“ Calculates df(x) / dx

connect(sig_in: Signal | Iterable[Signal], sig_out: Signal | Iterable[Signal] = None)

Connect without automatic adding to a function network

get_input_sensitivities(as_list=False)
get_input_states(as_list=False)
get_output_sensitivities(as_list=False)
get_output_states(as_list=False)
property n_in: int

Get the number of input signals

property n_out: int

Get the number of output signals

Note: Cannot be used in the initial __call__()

reset()

Reset the state of the sensitivities (they are set to zero or to None)

response()

Calculate the response from sig_in and output this to sig_out

sensitivity()

Calculate sensitivities using backpropagation

Based on the sensitivity we get from sig_out, reverse the process and output the new sensitivities to sig_in

sig_in: List = None
sig_out: List = None