leniax.kernels package

class leniax.kernels.KernelMapping(nb_channels, nb_kernels)[source]

Explicit mapping of the computation graph

Parameters
  • nb_channels (int) –

  • nb_kernels (int) –

cin_kernels

list of kernel indexes grouped by channel of shape [nb_channels, max_nb_kernels]

Type

List[List[int]]

cin_k_params

list of kernel parameters grouped by channel of shape [nb_channels, max_nb_kernels]

Type

List[List]

cin_kfs

list of kernel functions grouped by channel of shape [nb_channels, max_nb_kernels]

Type

List[List[str]]

cin_gfs

list of growth function slugs grouped by channel of shape [nb_channels, max_nb_kernels]

Type

List[List[str]]

gf_params

list of growth function slug grouped by channel of shape [nb_channels, max_nb_kernels]

kernels_weight_per_channel

list of weights grouped by channel of shape [nb_channels, nb_kernels]

Type

List[List[float]]

leniax.kernels.raw(R, k_params, kf_slug, kf_params)[source]

Returns k_params as an array

Parameters
  • R – World radius (not used)

  • k_params (List) – Kernel parameters

  • kf_slug (str) – Kernel function slug

  • kf_params (jax._src.numpy.ndarray.ndarray) – Kernel function params

Returns

A kernel of shape k_params

Return type

jax._src.numpy.ndarray.ndarray

leniax.kernels.circle_2d(R, k_params, kf_slug, kf_params)[source]

Build a circle kernel

Parameters
  • R – World radius

  • k_params (List) – Kernel parameters

  • kf_slug (str) – Kernel function slug

  • kf_params (jax._src.numpy.ndarray.ndarray) – Kernel function params

Returns

A kernel of shape [1, world_dims...]

Return type

jax._src.numpy.ndarray.ndarray