Operations¶
asarray(node: Node[ArrayLike]) -> Node[Array]
¶
Cast a 'Node[ArrayLike]' object to 'Node[Array]'.
Equivalent to 'jax.numpy.asarray' but with nodes.
Source code in src/bayinx/ops.py
cos(node: Node[T] | T) -> Node[T]
¶
Apply the cosine transformation (jnp.cos) to a node.
Source code in src/bayinx/ops.py
exp(node: Node[T] | T) -> Node[T]
¶
Apply the exponential transformation (jnp.exp) to a node.
Source code in src/bayinx/ops.py
fori_loop(lower: int | Node[int], upper: int | Node[int], f: Callable[[int], Node[PyTree] | PyTree | None]) -> Node[PyTree] | None
¶
Loop from lower to upper with a function f.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lower
|
int | Node[int]
|
The starting index (inclusive). |
required |
upper
|
int | Node[int]
|
The ending index (exclusive). |
required |
f
|
Callable[[int], Node[PyTree] | PyTree | None]
|
A function accepting an integer index |
required |
Returns:
| Type | Description |
|---|---|
Node[PyTree] | None
|
A |
Source code in src/bayinx/ops.py
ilr_inv(node: Node[T] | T) -> Node[T]
¶
Apply the inverse isometric log-ratio transformation (map to unit simplex).
Source code in src/bayinx/ops.py
log(node: Node[T] | T) -> Node[T]
¶
Apply the natural logarithm transformation (jnp.log) to an object.
Source code in src/bayinx/ops.py
map(f: Callable[..., PyTree | None], *args: ...) -> Node[PyTree] | None
¶
Map a function over the leading axis of the arguments.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
f
|
Callable[..., PyTree | None]
|
A user-defined function that accepts slices of the input positional arguments. |
required |
args
|
...
|
Additional positional arguments that are sliced and passed to |
()
|
Returns:
| Type | Description |
|---|---|
Node[PyTree] | None
|
A |
Source code in src/bayinx/ops.py
obj(node: Node[T]) -> T
¶
sigmoid(node: Node[T] | T) -> Node[T]
¶
Apply the sigmoid transformation to a node.
Source code in src/bayinx/ops.py
sin(node: Node[T] | T) -> Node[T]
¶
Apply the sine transformation (jnp.sin) to a node.
Source code in src/bayinx/ops.py
tanh(node: Node[T] | T) -> Node[T]
¶
Apply the hyperbolic tangent transformation (jnp.tanh) to a node.