- ivy.reptile_step(batch, cost_fn, variables, inner_grad_steps, inner_learning_rate, /, *, inner_optimization_step=<function gradient_descent_update>, batched=True, return_inner_v=False, num_tasks=None, stop_gradients=True)[source]#
Perform step of Reptile.
Container) – The input batch
Callable) – callable for the cost function, receivng the task-specific sub-batch and variables
Container) – Variables to be optimized
int) – Number of gradient steps to perform during the inner loop.
float) – The learning rate of the inner loop.
Callable) – The function used for the inner loop optimization. (default:
<function gradient_descent_update at 0x7f517c8ec160>) Default is ivy.gradient_descent_update.
bool) – Whether to batch along the time dimension, and run the meta steps in batch. (default:
True) Default is
bool]) – Either ‘first’, ‘all’, or False. ‘first’ means the variables for the first task (default:
False) inner loop will also be returned. variables for all tasks will be returned with ‘all’. Default is
int]) – Number of unique tasks to inner-loop optimize for the meta step. Determined from (default:
None) batch by default.
bool) – Whether to stop the gradients of the cost. Default is
- Return type:
ret – The cost and the gradients with respect to the outer loop variables.