modules.networks
networks
¶
Classes:
| Name | Description |
|---|---|
CSSM |
|
CDiagR |
Diagonal matrix-based generator with real-valued transformations. |
CDiagC |
Diagonal matrix-based generator with complex-valued transformations. |
CTE |
Antisymmetric Matrix Exponential Generator implementing continuous-time dynamics. |
CTB |
Block Antisymmetric Generator using 2x2 parameterized rotation blocks. |
CTBE |
Antisymmetric Generator with Exact Matrix Exponential Blocks. |
Classes¶
CSSM
¶
CSSM(u_shape: tuple[int], d_dim: int, y_dim: int, h_dim: int, sigma: Callable = tanh, project_every: int = 0, local: bool = False, batch_size: int = 1, seed: int = -1)
Bases: ModuleWrapper
Methods:
| Name | Description |
|---|---|
adjust_eigs |
Placeholder for eigenvalue adjustment method. |
forward |
Forward pass that updates the hidden state and computes the output. |
Source code in unaiverse/modules/networks.py
Methods:¶
adjust_eigs
¶
forward
¶
Forward pass that updates the hidden state and computes the output.
Source code in unaiverse/modules/networks.py
CDiagR
¶
CDiagR(u_shape: tuple[int], d_dim: int, y_dim: int, h_dim: int, sigma: Callable = lambda x: x, project_every: int = 0, local: bool = False, batch_size: int = 1, seed: int = -1)
Bases: ModuleWrapper
Diagonal matrix-based generator with real-valued transformations.
Methods:
| Name | Description |
|---|---|
adjust_eigs |
Normalize the diagonal weight matrix by setting signs. |
forward |
Forward pass with diagonal transformation. |
Source code in unaiverse/modules/networks.py
Methods:¶
adjust_eigs
¶
forward
¶
Forward pass with diagonal transformation.
Source code in unaiverse/modules/networks.py
CDiagC
¶
CDiagC(u_shape: tuple[int], d_dim: int, y_dim: int, h_dim: int, sigma: Callable = lambda x: x, project_every: int = 0, local: bool = False, batch_size: int = 1, seed: int = -1)
Bases: ModuleWrapper
Diagonal matrix-based generator with complex-valued transformations.
Methods:
| Name | Description |
|---|---|
adjust_eigs |
Normalize the diagonal weight matrix by dividing by its magnitude. |
forward |
Forward pass with complex-valued transformation. |
Source code in unaiverse/modules/networks.py
Methods:¶
adjust_eigs
¶
forward
¶
Forward pass with complex-valued transformation.
Source code in unaiverse/modules/networks.py
CTE
¶
CTE(u_shape: tuple[int], d_dim: int, y_dim: int, h_dim: int, delta: float, sigma: Callable = lambda x: x, project_every: int = 0, local: bool = False, cnu_memories: int = 0, batch_size: int = 1, seed: int = -1)
Bases: ModuleWrapper
Antisymmetric Matrix Exponential Generator implementing continuous-time dynamics.
Uses antisymmetric weight matrix with matrix exponential for stable hidden state evolution.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u_shape
|
tuple[int]
|
Input shape (tuple of integers) |
required |
d_dim
|
int
|
Input descriptor dimension |
required |
y_dim
|
int
|
Output dimension |
required |
h_dim
|
int
|
Hidden state dimension |
required |
delta
|
float
|
Time step for discrete approximation |
required |
local
|
bool
|
Local computations (bool) |
False
|
seed
|
int
|
Random seed (positive int) |
-1
|
Methods:
| Name | Description |
|---|---|
adjust_eigs |
Placeholder for eigenvalue adjustment method |
forward |
Forward pass through the system dynamics. |
Source code in unaiverse/modules/networks.py
Methods:¶
adjust_eigs
¶
forward
¶
Forward pass through the system dynamics.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u
|
Tensor
|
Input tensor of shape (batch_size, u_dim) |
required |
du
|
Tensor
|
Input descriptor tensor of shape (batch_size, du_dim) |
required |
first
|
bool
|
Flag indicating first step (resets hidden state) |
True
|
last
|
bool
|
Flag indicating last step (does nothing) |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
y |
Tensor
|
Output tensor of shape (batch_size, y_dim) |
Source code in unaiverse/modules/networks.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 | |
CTB
¶
CTB(u_shape: tuple[int], d_dim: int, y_dim: int, h_dim: int, delta: float = None, alpha: float = 0.0, sigma: Callable = lambda x: x, project_every: int = 0, local: bool = False, batch_size: int = 1, seed: int = -1)
Bases: ModuleWrapper
Block Antisymmetric Generator using 2x2 parameterized rotation blocks.
Implements structured antisymmetric dynamics through learnable rotational frequencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u_shape
|
tuple[int]
|
Input shape (tuple of integers) |
required |
d_dim
|
int
|
Input descriptor dimension |
required |
y_dim
|
int
|
Output dimension |
required |
h_dim
|
int
|
Hidden state dimension |
required |
delta
|
float
|
Time step for discrete approximation |
None
|
alpha
|
float
|
Dissipation added on the diagonal (also controls the eigenvalue projections method) |
0.0
|
Methods:
| Name | Description |
|---|---|
reset_parameters |
Initialize rotational frequencies with uniform distribution |
adjust_eigs |
Adjust eigenvalues to maintain stability |
forward |
Forward pass through block-structured dynamics |
Source code in unaiverse/modules/networks.py
Methods:¶
reset_parameters
¶
adjust_eigs
¶
Adjust eigenvalues to maintain stability
Source code in unaiverse/modules/networks.py
forward
¶
Forward pass through block-structured dynamics
Source code in unaiverse/modules/networks.py
CTBE
¶
CTBE(u_shape: tuple[int], d_dim: int, y_dim: int, h_dim: int, delta: float, sigma: Callable = lambda x: x, project_every: int = 0, local: bool = False, cnu_memories: int = 0, batch_size: int = 1, seed: int = -1)
Bases: ModuleWrapper
Antisymmetric Generator with Exact Matrix Exponential Blocks.
Implements precise rotational dynamics using trigonometric parameterization.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
u_shape
|
tuple[int]
|
Input shape (tuple of integers) |
required |
d_dim
|
int
|
Input descriptor dimension |
required |
y_dim
|
int
|
Output dimension |
required |
h_dim
|
int
|
Hidden state dimension |
required |
delta
|
float
|
Time step for discrete approximation |
required |
Methods:
| Name | Description |
|---|---|
reset_parameters |
Initialize rotational frequencies |
adjust_eigs |
Placeholder for eigenvalue adjustment |
forward |
Exact matrix exponential forward pass |
Source code in unaiverse/modules/networks.py
Methods:¶
reset_parameters
¶
adjust_eigs
¶
forward
¶
Exact matrix exponential forward pass