textgrad.autograd.algebra#
Classes
- class textgrad.autograd.algebra.Aggregate#
Bases:
Function
This function is WIP
- backward(aggregated_variable, backward_engine)#
- forward(variables)#
Aggregates a list of variables. In TextGrad, forward pass of aggregation is simply concatenation of the values of the variables. The backward pass performs a reduction operation on the gradients of the variables. This reduction is currently an LLM call to summarize the gradients.
- class textgrad.autograd.algebra.Sum#
Bases:
Function
Represents a sum operation on a list of variables. In TextGrad, sum is simply concatenation of the values of the variables.
- Parameters:
variables (List[Variable]) – The list of variables to be summed (concatenated).
- Returns:
A new variable representing the sum of the input variables.
- Return type:
- backward(summation, backward_engine)#
Performs the backward pass of the sum operation. This is simply an idempotent operation, where we pass the feedback to the predecessors variables.