AlgoVision Core
- Var
alias of
algovision.core.Variable
- VarInt
alias of
algovision.core.VariableInt
- class State(input_names, input_values, variables, variable_ints, batch_size)[source]
-
- return_outputs(outputs: List[algovision.core.Output]) Union[torch.Tensor, Tuple[torch.Tensor]] [source]
- merge(to_merge, p)[source]
(Internal) Merges two states with where the new tensor is used to the extent of \(p\) .
For any tensors \(t_1, t_2\) (self, to_merge) and probability \(p\) , the new tensor and probability \(t^\prime\) is defined as
\[t^\prime = t_1 \cdot (p-1) + t_2 \cdot p\]
- add(to_add, p)[source]
(Internal) Merges two states by adding to_add weighted by p. Except of VariableInt types; there, the new value is used.
- class Algorithm(*sequence, beta=10.0, max_iter=1024, epsilon=1e-05, hard=False, debug=False)[source]
- __init__(*sequence, beta=10.0, max_iter=1024, epsilon=1e-05, hard=False, debug=False)[source]
Initializes internal Module state, shared by both nn.Module and ScriptModule.
- forward(*inputs: torch.Tensor) Union[torch.Tensor, Tuple[torch.Tensor]] [source]
Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.