Switched conjunctive network to Bivariate Fisher receptive fields

- Big change, lack of compatibility with previous launchers... Put in new branch for now. Will need to be merged back properly. Still need to find relationship between kappa and previous rcscale, the feature and mixed code are not adapted for now.
Switched conjunctive network to Bivariate Fisher receptive fields

- Big change, lack of compatibility with previous launchers... Put in new branch for now. Will need to be merged back properly. Still need to find relationship between kappa and previous rcscale, the feature and mixed code are not adapted for now.
Parameters for loaders, plot selections, size difference among datasets

- Add: Added parameters for the loaders.
- Add: Parameter added: list of desired plots for a loader.
- Add: Two new loaders, for data with new Bivariate Fisher receptive fields.
- Add: Try to handle different sizes in datasets results. Uses Slice, writes into/from the smallest slice possible.
- Add: Takes desired dataset index to load as script argument
- Fix: Checks if regular expression matches
Computed covariance for T>1, diagonal elements comparison for computed/measured covariance, test normalising constant for bivariate fisher

- Add: Computed KL covariance now takes T as input.
- Fix: beta contribution properly put in call to computed KL covariance. Should be in the function itself.
- Add: Plot comparing the evolution of the diagonal element as a function of T, between computed and measured.
- Add: Play with the normalising constant for Bivariate Fisher. Will introduce it into the Receptive fields in the next commit!
Compute Fisher Information for different kappas

- Add: Compute fisher information for different kappas. Fixed a few bugs in the computation. Still get exponential, whereas the measured is more linear/quadratic
Normalised Bivariate-Fisher receptive fields, refactoring of parameter computations

- ADD: Normalisation for Bivariate-fisher neurons now. Should avoid exponential growth, better theoretical match.
- FIX: Some parameters are precomputed properly (e.g. the normalising constant).
- FIX: Specified_neurons -> specific_neurons
Refactored Parametrisation, Normalised Bivariate Fishers, KL Covariance

- Fix: Parameters precomputation is now done properly, depending on the network_type. Wrong_wrap keeps the gaussian parameters computation, bivariate_fisher gets a function computing the normalisation constants.
- Add: Compute normalisation constant for bivariate fishers (for #13). There are overflows happening when the kappa become big (> 700), only happens when the random kappa hit the end of the tail... No problem there, as 1./inf = 0, so all works out.
- Checked that KL covariance model works properly (for #18). It does, the fit is nearly perfect! Can now start offering KL covariance matrices instead of measured ones, better.
cleaning
Effect of normalised receptive fields, use computed KL covariance

- Add: Now with normalised receptive fields. Get a square dependence on kappa. Still, the sampler seems to get a linear dependence on kappa. Weird.
- Add: Uses computed KL covariance now. Same results, super faster.
- Add: redid all computations, checking for discrepancies… Nothing weird.

work on #10 and #17
Classy refactoring, added datasets

- Add: Big refactor of curves_memorypowerlaw_100712. Now multiple plotting functions, getting called depending on different parameter choices. Quite modular, should be the skeleton for next plotting functions.
- Add: Sqrt of x, to cope with discrepancy between kappa in RandomFactorialNetwork and in the theory. Still get a weird linear instead of quadratic dependence…
- Add: Now correctly removes runs that didn't complete. Looks for results=0.0 exactly, only happens for unfinished runs (seems alright, but better/slower solution using repet_i commented out)
- Add: datasets for normalised receptive fields.
- Add: Save the arguments of datasets now.
Nanmedian, Fit Gaussian, Plot Spectrum

- Added: nanmedian function.
- Added: A function to fit a gaussian curve.
- Added A small plot of the Power spectrum for 2D data. Useful for images.
Receptive field scale for Bivariate Fisher, Mean activity function, Number of responding neurons, small tweaks

- Fixed: Removed the sqrt relationship between the desired receptive field scale and the effective one for Bivariate fisher populations. This means that we do not conserve the receptive field area anymore, but at least we can match the Fisher information easier.
- Added: get_mean_activity function, used in other places.
- Added: A function computing the number of neurons responding to a given stimulus. Good indication for coverage problem.
- Added: Plot the 2D FFT Power spectrum of the mean activity. Indicator for bad coverage, as new periodicity appear. But as the apparition is smooth, it is slightly hard to distinguish directly.
- Fixed: get_network_response gets a default stimulus if none is provided.

(Work on #13)
Estimate fisher information from posterior curvature, tweaks

- Added: Estimate the fisher information directly from the curvature of the posterior. This is to check where the discrepancy between the Sampler and the theo arises.
- Added: New launcher to compute and plot the Fisher information estimated from the curvature
- Bug: Removed the prior's contribution on the likelihood to check the theoretical fit.
- Fixed: removed a few useless variables, added debuging statements and checks.

(Work on #17, #10)
Fisher information from curvature of posterior, scale verification, big rewrite for 1D case

- Added: Estimate the fisher information from the curvature of the posterior, small try. Real use is in Sampler
- Added: Use the Sampler estimate of the Fisher information through the curvature to see if one can detect the discrepancy between the theory and the simulation (issue #17). Not successful for now.
- Added: Full rewrite of the entire inference and Fisher information estimation for a 1D code. This shows that the theory and simulation do correspond in 1D. We should now do the same in 2D.
Important bug in precision computation

This explains the missing square relationship between the rcscale and the fisher information estimated through the precision. This could actually make the simulations and the theory agree now, but this remains to be verified.
I'd rather reimplement the whole thing in 2D again to avoid loosing time tracing errors in the framework.

Work on #17, #15
Function to fit a Gaussian to samples

- Added: a function that takes samples and fit a Gaussian distribution to them. Plot the samples along with the fitted distribution if desired
Tweaks and try.
Tweak
Bug fixed Fisher information from posterior curvature

- Fixed: there was a bug in the posterior estimation and the fisher information computation. Now fits the theory very well.

This now doesn't correspond to the fisher information estimated from the precision. There seem to be a problem with the samples generated, they nearly alway overestimate the standard deviation. Hence more noise is in the system and we fail to achieve the Cramer-Rao bound. Hard to know what's causing it, still need to investigate.

The good fit between the curvature and the theory happens when the curvature uses a diagonal covariance (just like the model used in the theory, obviously). For the full covariance, the match is good for small sigma, but disapear afterwards.

work on #17, #10
Fisher information for 2D code redone entirely, profiling

- Added: Rewrote the entire inference process for a 2D population code. The Fisher information is a bit annoying to compute, and getting it form the curvature is extremely inefficient. There is no difference between the curvature estimation and the theoretical ones, so we do not really have to care about it. Interestingly, the FI given a clamped theta_2 gives a really close result to the large N limit, so the rest of the network contributes very little to information to a stimulus on the theta_2 line. This could simplifie analysis really strongly.

Work on #17, #10