opytimizer.core.block

Block.

class opytimizer.core.block.Block(type: str, pointer: callable, n_input: int, n_output: int)

A Block serves as the foundation class for all graph-based optimization techniques.

__init__(type: str, pointer: callable, n_input: int, n_output: int) → None

Initialization method.

Parameters:
  • type – Type of the block.
  • pointer – Any type of callable to be applied when block is called.
  • n_input – Number of input arguments.
  • n_output – Number of output arguments.
__call__(*args) → callable

Callable to avoid using the pointer property.

Returns:Input arguments applied to callable pointer.
type

Type of the block.

pointer

Points to the actual function when block is called.

n_input

Number of input arguments.

n_output

Number of output arguments.

class opytimizer.core.block.InputBlock(n_input: int, n_output: int)

An InputBlock defines a block that is only used for entry points.

__init__(n_input: int, n_output: int) → None

Initialization method.

Parameters:
  • n_input – Number of input arguments.
  • n_output – Number of output arguments.
class opytimizer.core.block.InnerBlock(pointer: callable, n_input: int, n_output: int)

An InnerBlock defines a block that is used for inner points (between input and output).

__init__(pointer: callable, n_input: int, n_output: int) → None

Initialization method.

Parameters:
  • pointer – Any type of callable to be applied when block is called.
  • n_input – Number of input arguments.
  • n_output – Number of output arguments.
class opytimizer.core.block.OutputBlock(n_input: int, n_output: int)

An OutputBlock defines a block that is only used for output points.

__init__(n_input: int, n_output: int) → None

Initialization method.

Parameters:
  • n_input – Number of input arguments.
  • n_output – Number of output arguments.