Model

class baikal.Model(inputs, outputs, targets=None, name=None)

Bases: baikal._core.step.Step

A Model is a network (more precisely, a directed acyclic graph) of Steps, and it is defined from the input/output specification of the pipeline. Models have fit and predict routines that, together with graph-based engine, allow the automatic (feed-forward) computation of each of the pipeline steps when fed with data.

Parameters
  • inputs – Inputs to the model.

  • outputs – Outputs of the model.

  • targets – Targets of the model.

  • name – Name of the model (optional). If no name is passed, a name will be automatically generated.

Methods

fit(X[, y])

Trains the model on the given input and target data.

get_compute_func_at(port)

Get compute function at the specified port.

get_data_placeholder(name)

Get a data placeholder (graph half-edge) in the model by name.

get_fit_compute_func_at(port)

Get fit-compute function at the specified port.

get_inputs_at(port)

Get inputs at the specified port.

get_outputs_at(port)

Get outputs at the specified port.

get_params([deep])

Get the parameters of the model.

get_step(name)

Get a step (graph node) in the model by name.

get_targets_at(port)

Get targets at the specified port.

get_trainable_at(port)

Get trainable flag at the specified port.

predict(X[, output_names])

Predict by applying the model on the given input data.

set_compute_func_at(port, value)

Set compute function at the specified port.

set_fit_compute_func_at(port, value)

Set fit-compute function at the specified port.

set_params(**params)

Set the parameters of the model.

set_trainable_at(port, value)

Set trainable flag at the specified port.

__call__(inputs[, targets, compute_func, …])

Call the step on input(s) (from previous steps) and generates the output(s) to be used in further steps.

Attributes

compute_func

Get the compute function of the step.

fit_compute_func

Get the fit-compute function of the step.

graph

Get the graph associated to the model.

inputs

Get the inputs of the step.

n_outputs

Get the number of outputs the step produces.

name

Get the name of the step.

outputs

Get the outputs of the step.

targets

Get the targets of the step.

trainable

Get trainable flag of the step.