pymoto.Module

class pymoto.Module

Main class: Module Transforms input signal to output signal and output signal sensitivity to input signal sensitivity

Initialize using Module() >> Module(input, output)

Multiple inputs and outputs: >> Module([input1, input2], [output1, output2])

No tag: >> Module([input1, input2], [output1, output2])

No outputs: >> Module([inputs])

Using keywords: >> Module(sig_in=[inputs], sig_out=[outputs])

__init__()

Methods

__init__()

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

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

Connect without automatic adding to a function network

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__()

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

reset()

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

get_input_states(as_list=False)
get_output_states(as_list=False)
get_input_sensitivities(as_list=False)
get_output_sensitivities(as_list=False)