Skip to content

Commit

Permalink
Fix bug in ultrafilter test
Browse files Browse the repository at this point in the history
  • Loading branch information
thelogicalgrammar committed Jan 9, 2019
1 parent 7d28321 commit 393edf9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 28 deletions.
31 changes: 5 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
.idea/
.idea/

__pycache__/
multiple_simulations.sh
run_script.sh
__pycache__/
multiple_simulations.sh
run_script.sh
EDDIE_server/
comms/bottleneck512_ngen10000_nagt10_len10_trial{10}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{1}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{2}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{3}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{4}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{5}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{6}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{7}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{8}.out.npy
comms/bottleneck512_ngen10000_nagt10_len10_trial{9}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{10}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{1}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{2}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{3}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{4}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{5}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{6}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{7}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{8}.out.npy
comms/bottleneck715_ngen10000_nagt10_len10_trial{9}.out.npy
comms/bottleneck715_ngen1000_nagt10_len10.out.npy
comms/bottleneck715_ngen500_nagt10_len10.out.npy
other_tests/
7 changes: 5 additions & 2 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,11 @@ def check_quantifier_ultrafilter(all_models, quantifier):
"""
map_quant = np.around(quantifier).astype(int).reshape((-1,1))
tiled_quant = np.tile(map_quant, reps=(1, all_models.shape[1]))
identity = tiled_quant == all_models
columns_identical = np.all(identity, axis=0)
identity_positive = tiled_quant == all_models
identity_negative = tiled_quant == np.logical_not(all_models)
columns_identical_positive = np.all(identity_positive, axis=0)
columns_identical_negative = np.all(identity_negative, axis=0)
columns_identical = columns_identical_positive | columns_identical_negative
# relies on the fact that an ultrafilter can only depend on a single object, not more than one
# and therefore the output of nonzero will be unique if there is one at all
return np.nonzero(columns_identical)[0][0] if np.any(columns_identical) else -1
Expand Down

0 comments on commit 393edf9

Please sign in to comment.