Skip to content

Commit

Permalink
Fixing some whitespace linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jezsadler committed Apr 22, 2024
1 parent 015324f commit da6c316
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/omlt/neuralnet/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
\end{align*}
"""

import itertools

import numpy as np
Expand Down Expand Up @@ -254,7 +255,7 @@ class GNNLayer(DenseLayer):
.. math::
\begin{align*}
y_j = \sigma \left(\sum\limits_{i=0}^{F_{in}-1}A_{u,v}w_{ij}x_i+b_j\right), && \forall 0\le j<F_{out},
y_j = \sigma \left(\sum\limits_{i=0}^{F_{in}-1}A_{u,v}w_{ij}x_i+b_j\right), && \forall 0\le j<F_{out},
\end{align*}
Expand Down
15 changes: 11 additions & 4 deletions tests/neuralnet/test_nn_formulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,12 +544,16 @@ def test_partition_based_unbounded_below():
m.neural_net_block.build_formulation(formulation)
prev_layer_block = m.neural_net_block.layer[prev_layer_id]
prev_layer_block.z.setlb(-interval.inf)

split_func = lambda w: default_partition_split_func(w, 2)

with pytest.raises(ValueError) as excinfo:
partition_based_dense_relu_layer(
m.neural_net_block, net, m.neural_net_block.layer[test_layer_id], test_layer, split_func
m.neural_net_block,
net,
m.neural_net_block.layer[test_layer_id],
test_layer,
split_func,
)
expected_msg = "Expression is unbounded below."
assert str(excinfo.value) == expected_msg
Expand All @@ -568,12 +572,15 @@ def test_partition_based_unbounded_above():
prev_layer_block = m.neural_net_block.layer[prev_layer_id]
prev_layer_block.z.setub(interval.inf)


split_func = lambda w: default_partition_split_func(w, 2)

with pytest.raises(ValueError) as excinfo:
partition_based_dense_relu_layer(
m.neural_net_block, net, m.neural_net_block.layer[test_layer_id], test_layer, split_func
m.neural_net_block,
net,
m.neural_net_block.layer[test_layer_id],
test_layer,
split_func,
)
expected_msg = "Expression is unbounded above."
assert str(excinfo.value) == expected_msg
Expand Down

0 comments on commit da6c316

Please sign in to comment.