pymoto.finite_difference

pymoto.finite_difference(fromsig: Signal | Iterable[Signal] = None, tosig: Signal | Iterable[Signal] = None, function: Module = None, dx: float = 1e-08, relative_dx: bool = False, tol: float = 1e-05, random: bool = True, use_df: list = None, test_fn: Callable = None, keep_zero_structure=True, verbose=True)

Performs a finite difference check on the given Module or Network

Parameters:
  • fromsig (optional) – Specify input signals of interest

  • tosig (optional) – Specify output signals of interest

  • function (optional) – The module or network

Keyword Arguments:
  • dx – Perturbation size

  • relative_dx – Use a relative perturbation size or not

  • tol – Tolerance

  • random – Randomize sensitivity data

  • use_df – Give pre-defined sensitivity data

  • test_fn – A generic test function (x, dx, df_an, df_fd)

  • keep_zero_structure – If True variables that are 0 are not perturbed

  • verbose – Print extra information to console