Skip to content

Commit cab554b

Browse files
committed
check codecov secret
1 parent 6082715 commit cab554b

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

effector/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def predict(self, x: np.ndarray) -> np.ndarray:
125125
Returns:
126126
Output of the model, shape (N,)
127127
"""
128-
y = np.exp(x[:, 3])
128+
y = np.exp(x[:, 2])
129129

130130
mask1 = (x[:, 1] < 0) & (x[:, 2] < 0)
131131
mask2 = (x[:, 1] < 0) & (x[:, 2] >= 0)
@@ -150,7 +150,7 @@ def jacobian(self, x: np.ndarray) -> np.ndarray:
150150
"""
151151
y = np.zeros(x.shape)
152152

153-
y[:, 3] = np.exp(x[:, 3])
153+
y[:, 2] = np.exp(x[:, 2])
154154

155155
mask1 = (x[:, 1] < 0) & (x[:, 2] < 0)
156156
mask2 = (x[:, 1] < 0) & (x[:, 2] >= 0)

tests/test_models.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import effector
2+
3+
def test_models():
4+
# Test ConditionalInteraction model
5+
for model in [
6+
effector.models.ConditionalInteraction(),
7+
effector.models.DoubleConditionalInteraction(),
8+
effector.models.ConditionalInteraction4Regions(),
9+
effector.models.GeneralInteraction()
10+
]:
11+
x = effector.datasets.IndependentUniform(dim=3, low=-1, high=1).generate_data(1000, seed=21)
12+
13+
# Test predict method
14+
y_pred = model.predict(x)
15+
assert y_pred.shape == (1000,)
16+
17+
# Test jacobian method
18+
jacobian = model.jacobian(x)
19+
assert jacobian.shape == (1000, 3)

0 commit comments

Comments
 (0)