Repository: htjb/margarine (language: python)

Issue:
Temperamental tests
Some of the tests occasionally fail because of poor training.


Discussion / hints:
Okay, in the tests we calculate the accuracy of the MAFs and I think KDEs too by running a series of two sample KS tests between samples drawn from the DE and the original samples used to train. Occasionally one of these KS tests fails because the training is poor (training varies with the random seed since the weights are initialised differently). 

A simpler thing to do would be a KS test between the predicted distributions of log-probability vs the log-probability of the original samples. Might be more robust. Also I think the tests currently work with a NS run but should use something from the scipy.stats package.

Also appears there is a bug with tensorflow too after their recent updates (identified in #59 I think).

Fix patch:
diff --git a/README.rst b/README.rst
index 8130eeb..e072cbc 100755
--- a/README.rst
+++ b/README.rst
@@ -7,7 +7,7 @@ Introduction
 
 :margarine: Marginal Bayesian Statistics
 :Authors: Harry T.J. Bevins
-:Version: 1.2.7
+:Version: 1.2.8
 :Homepage:  https://github.com/htjb/margarine
 :Documentation: https://margarine.readthedocs.io/
 
diff --git a/requirements.txt b/requirements.txt
index fb504ca..758aeab 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,9 +1,8 @@
 numpy
-tensorflow-macos; sys_platform == 'darwin'
-tensorflow; sys_platform != 'darwin'
-tensorflow_probability
+tensorflow-macos<2.14.0; sys_platform == 'darwin'
+tensorflow<2.14.0; sys_platform != 'darwin'
+tensorflow_probability<0.21.0
 anesthetic
 scipy
-pandas
 scikit-learn
 tqdm


Test patch:
diff --git a/requirements_test.txt b/requirements_test.txt
index 49ef00b..08ed5ee 100644
--- a/requirements_test.txt
+++ b/requirements_test.txt
@@ -1,3 +1,1 @@
-https://github.com/handley-lab/anesthetic/archive/master.zip
-pandas
-torch
+torch
\ No newline at end of file