Giter Site home page Giter Site logo

stg_energy's Introduction

Energy-efficient network activity from disparate circuit parameters

Purpose of this repostitory

This repository contains all code and data to create the figures in the paper Energy-efficient network activity from disparate circuit parameters by Deistler, Macke*, Goncalves* (2022). If you only want to use the machine learning tools developed in this work, see the sbi repository and the corresponding tutorial. If you only need the pyloric simulator, see this repo.

Installation

First, create a conda environment:

conda env create --file environment.yml
conda activate stg-energy

Then clone and install this package:

git clone [email protected]:mackelab/STG_energy.git
cd STG_energy
pip install -e .

Please note that all neural networks were trained on sbi v0.14.0. In v0.15.0, the training routine of sbi changed (z-score only using train data). Thus, training on a newer version give slightly different results.

Structure of this repository

Roughly, the workflow for this work can be divided into three sections: (1) Running the pyloric simulator for many parameter sets, (2) Training the neural density estimator to approximate the posterior and (3) Generating plots.

(1) is implemented in stg_energy/generate_data/simulate... and was run on a compute cluster with SLURM. (2) is implemented in stg_energy/generate_data/train... (3) is implemented in paper/

Commands to generate data and train the network

cd stg_energy/generate_data/simulate_11deg
python simulate_11deg.py
python 01_merge_simulated_data.py

python train_classifier.py

cd stg_energy/generate_data/simulate_11deg_R2
python simulate_11deg.py
python 01_merge_simulated_data.py

python train_classifier_R2.py

cd stg_energy/generate_data/simulate_11deg_R3
python simulate_11deg.py
python 01_merge_simulated_data.py

python train_flow_R3.py

Git LFS

To store the data files, we use Git LFS.

Citation

@article{deistler2022energy,
  title={Energy efficient network activity from disparate circuit parameters},
  author={Deistler, Michael and Macke, Jakob H and Gon{\c{c}}alves, Pedro J},
  journal={bioRxiv},
  pages={2021--07},
  year={2022},
  publisher={Cold Spring Harbor Laboratory}
}

Contact

If you have any questions regarding the code, please contact [email protected]

stg_energy's People

Contributors

michaeldeistler avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

stg_energy's Issues

Name for effective prior

We need a name for the distribution implied by the classifier.

The classifier happens without knowledge of the observation x_o. It only looks at simulations. Hence, a good name might be:
simulation informed prior

We think that the name is great, but it's a bit wordy.

Other options:
effective prior / simulation prior / usable prior

Merge figure 0 and figure 1

Storytelling: how do you build models???
Well, you search for parameters, but often they give bad results (prior samples)
Then, you find parameters that give realistic activity (simulation-informed prior)
Then, you look at data -> posterior

in fig2, show more samples

To demonstrate that we have a HUGE database of models that fit the data, we could show many more samples than just 4

do we need the name active subspace?

People do not like it when one uses a new term for something simple. Hence, we should say something like:

We search for directions that correlate with energy. We find that it is one. We call this the active direction. Then cite active subspaces.

Storytelling for temperature

We will fit to experimental data at 27 degree.

Then, we'll make the following observations:

  1. For any parameter set, it is possible to find Q10 values that allow it to be robust and thus energy consumption is not really influenced.
  2. we checked how energy efficiency at 11 is related to efficiency at 27 degree. We find that some models are equally efficient at 11 degree but very different at 27 degree. This adds yet another layer of complexity to identifying optimal solutions

Illustrate the posterior within the active subspace

The active subspace only gives the dimension in which energy is expected to change. But it does not necessarily mean that the parameters can change along this direction. We should plot a contour of a posterior in the sketch of the active subspace.

We really need to redo figure4e

they are not orthogonal.

At least explain clearly

Oblique projections / pictorial

Decomposing things onto axes that are not orthogonal

Gradient in fig4e is the one shown in fig3

Murphy miller 2009. Trefethen might be an overkill (non-normal dynamics)

We can make this a feature and visualize this nicely

Labels for fig2a

To Jakob, it seemed as if in fig2a (histogram figure) the second row would also be spikes. We need ylabels to show that it is energy

Wrong untis in figure 3a

In the correlation plot, we say that the unit is in /cm**2. But it's not because we have already multiplied by the area.

start_val is not always the same

The initialization for the gating variables has been 0.5 in my MSc thesis but is 0.0 for all energy experiments I have run so far.

Thus, the functions simulate and simulate_energyscape currently use 0.0, whereas simulate_general uses 0.5.

re-order summary stats

when I plot the summary stats (e.g. fig1 supp), we have to change the order of the names to match the new order of the summary stats.

Also, make sure that AppFig2 is good and summstats are ordered in the same way for panel a and b

label in 4e is confusing

we say 11 and 27 degree when, what we mean is "Posterior fit to 11 degree" and "Samples that are temperature robust". We should also add titles to the panels.

Additional figures

Two more figures would be possible:

  1. Independence of energy consumption
  2. Sample from the conditional and check if the pairs can get you "all" the way from least to most energy efficient.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.