nifty8.re.misc module#

doc_from(original)[source]#
hvp(f, primals, tangents)[source]#
interpolate(xmin=-7.0, xmax=7.0, N=14000) Callable[source]#

Replaces a local nonlinearity such as jnp.exp with a linear interpolation

Interpolating functions speeds up code and increases numerical stability in some cases, but at a cost of precision and range.

Parameters:
  • xmin (float) – Minimal interpolation value. Default: -7.

  • xmax (float) – Maximal interpolation value. Default: 7.

  • N (int) – Number of points used for the interpolation. Default: 14000

is_iterable_of_non_iterables(ls: Any) bool[source]#

Indicates whether the input is one dimensional.

An object is considered one dimensional if it is an iterable of non-iterable items.

isiterable(candidate)[source]#
split(mappable, keys)[source]#

Split a dictionary into one containing only the specified keys and one with all of the remaining ones.

wrap(call: Callable[[I], O], name: Hashable) Callable[[Mapping[Hashable, I]], O][source]#
wrap_left(call: Callable[[I], O], name: Hashable) Callable[[I], Dict[Hashable, O]][source]#