theseus.Objective.error
- Objective.error(input_tensors: Optional[Dict[str, Tensor]] = None, also_update: bool = False) Tensor
Evaluates the error vector.
- Parameters
input_tensors (Dict[str, torch.Tensor], optional) – if given, it must be a dictionary mapping variable names to tensors; if a variable with the given name is registered in the objective, its tensor will be replaced with the one in the dictionary (possibly permanently, depending on the value of
also_update). Defaults toNone, in which case the error is evaluated using the current tensors stored in all registered variables.also_update (bool, optional) – if
True, andinput_tensorsis given, the modified variables are permanently updated with the given tensors. Defaults toFalse, in which case the variables are reverted to the previous tensors after the error is evaluated.
- Returns
- a tensor of shape (batch_size x error_dim), with the
concatenation of all cost functions error vectors. The order corresponds to the order in which cost functions were added to the objective.
- Return type
torch.Tensor