Simulai activations
Activations #
Siren #
Bases: Module
Sinusoidal Representation Networks (SIREN)
Source code in simulai/activations.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
share_to_host: dict
property
#
Return the parameters of the SIREN model.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary containing the parameters 'omega_0' and 'c'. |
__init__(omega_0=None, c=None)
#
Initialize SIREN model with given parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
omega_0 |
float
|
(Default value = None) |
None
|
c |
float
|
(Default value = None) |
None
|
Source code in simulai/activations.py
29 30 31 32 33 34 35 36 37 38 39 40 |
|
forward(input)
#
Perform the forward pass of the SIREN model on the input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor
|
The input to the SIREN model. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: The output of the SIREN model. |
Source code in simulai/activations.py
53 54 55 56 57 58 59 60 61 62 63 |
|
sin #
Bases: Module
Sine activation function.
This module applies the sine function element-wise to the input.
Source code in simulai/activations.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
__init__()
#
Initialize the sine activation function.
Source code in simulai/activations.py
75 76 77 78 79 80 |
|
forward(input)
#
Perform the forward pass of the sine activation function on the input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor
|
The input to the sine activation function. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: The output of the sine activation function. |
Source code in simulai/activations.py
82 83 84 85 86 87 88 89 90 91 92 |
|
Wavelet #
Bases: TrainableActivation
Wavelet activation
Source code in simulai/activations.py
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
forward(input)
#
Perform the forward pass of the Wavelet activation on the input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input |
Tensor
|
The input to the sine activation function. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
torch.Tensor: The output of the sine activation function. |
Source code in simulai/activations.py
113 114 115 116 117 118 119 120 121 122 123 124 |
|