Api extras
Models
Classes:
Name | Description |
---|---|
ConditionalInteraction |
|
DoubleConditionalInteraction |
|
ConditionalInteraction()
Bases: Base
Define a simple model.
\(f(x_1, x_2, x_3) = -x_1^2\mathbb{1}_{x_2 < 0} + x_1^2\mathbb{1}_{x_2 \geq 0} + e^{x_3}\)
Methods:
Name | Description |
---|---|
jacobian |
Calculate the Jacobian of the model. |
predict |
Predict. |
Source code in effector/models.py
18 19 20 21 22 23 24 |
|
jacobian(x)
Calculate the Jacobian of the model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Input data, shape (N, 3) |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Jacobian of the model, shape (N, 3) |
Source code in effector/models.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
predict(x)
Predict.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Input data, shape (N, 3) |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Output of the model, shape (N,) |
Source code in effector/models.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
|
DoubleConditionalInteraction()
Bases: Base
Define a simple model.
\(f(x_1, x_2, x_3) = -3x_1^2\mathbb{1}_{x_2 < 0}\mathbb{1}_{x_3 < 0} + +x_1^2\mathbb{1}_{x_2 < 0}\mathbb{1}_{x_3 \geq 0} -e^{x_1}\mathbb{1}_{x_2 \geq 0}\mathbb{1}_{x_3 < 0} +e^{3x_1}\mathbb{1}_{x_2 \geq 0}\mathbb{1}_{x_3 \geq 0}\) $
Methods:
Name | Description |
---|---|
jacobian |
Calculate the Jacobian of the model. |
predict |
Predict. |
Source code in effector/models.py
58 59 60 61 62 63 64 65 66 67 68 |
|
jacobian(x)
Calculate the Jacobian of the model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Input data, shape (N, 3) |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Jacobian of the model, shape (N, 3) |
Source code in effector/models.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
predict(x)
Predict.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Input data, shape (N, 3) |
required |
Returns:
Type | Description |
---|---|
ndarray
|
Output of the model, shape (N,) |
Source code in effector/models.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
Datasets
Classes:
Name | Description |
---|---|
Base |
|
IndependentUniform |
|
Base(name, dim, axis_limits)
Methods:
Name | Description |
---|---|
generate_data |
Generate N samples |
Source code in effector/datasets.py
5 6 7 8 |
|
generate_data(n, seed=21)
Generate N samples Args: n : int Number of samples seed : int Seed for generating samples
Returns:
Type | Description |
---|---|
array
|
ndarray, shape: [n,2] The samples |
Source code in effector/datasets.py
10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
IndependentUniform(dim=2, low=0, high=1)
Bases: Base
Methods:
Name | Description |
---|---|
generate_data |
Generate N samples |
Source code in effector/datasets.py
26 27 28 |
|
generate_data(n, seed=21)
Generate N samples
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
int Number of samples |
required | |
seed
|
int Seed for generating samples |
21
|
Returns:
Type | Description |
---|---|
array
|
ndarray, shape: [n,2] The samples |
Source code in effector/datasets.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|