Giter Club home page Giter Club logo

iob_cmb's Introduction

IOB for CMB spectra

Information ordered bottleneck (IOB) to interpret the CMB power spectra

Environment: Run Conda env create -f operon.yaml to replicate the environment I have tested. All dependence including torch are in operon.yaml; may need to pip install some package, please check the operon.yaml

Data source: infinity: /data77/xiaosheng/IOB_cmb_data/camb_new_TT.zip

cp and unzip camb_new_TT.zip under the ./data/camb_new/ folder; There are 10000 raw TT samples that is about 196 Mb. Data format: data[:6] are the 6 cosmological parameters; data[6:] are the TT power spectrum with l={2,3,...2500}

Similarly, for Polarized CMB:

  • TE: /data77/xiaosheng/IOB_cmb_data/camb_new_TE.zip;
  • EE: /data77/xiaosheng/IOB_cmb_data/camb_new_EE.zip;

can unzip under the ./data/camb_new/ folder for further use

With command lines:

  • python generate_ps.py (optionally)
  • python create_noised_data.py --cmb_type=TT(optionally, need run at the first time)
  • python train.py --model_name=shallow96 --epoch=2048 --cmb_type=TT (may need to comment os.environ["CUDA_VISIBLE_DEVICES"] in the beginning)
  • python test.py --model_name=shallow96 --cmb_type=TT (may need to comment os.environ["CUDA_VISIBLE_DEVICES"] in the beginning)
  • python operon.py --model_name=shallow96 --cmb_type=TT --operon_name=run1
  • python replace.py --model_name=shallow96 --cmb_type=TT --operon_name=run1 --thin=200 . For better visualization, check the inspect the data space section in the IOB_for_CMB_spectra.ipynb. (may need to comment os.environ["CUDA_VISIBLE_DEVICES"] in the beginning)

the last command will output two csv files "pareto_good_model_*" and "individuals_good_model_" under the ./data/sr/ folder. They are the "good" expressions of the first latent from operon. When replacing the first latent with the outputs from these expressions, the final weighted mse in the data space is less than 1. The two files correspond to the expressions from the pareto front and all 2000 individual expressions during each operon run.

File structure under IOB_cmb: has a trained model for TT in model, which can be used for testing directly.

IOB_cmb
└───README.md
└───operon.yaml (environment)
└───data
|    └─── camb_new (raw data)
|    └─── camb_new_processed (processed data)
|    └─── sr (outputs of symbolic regression)
└───model (save the best checkpoint during training) 
└───process files
|    └─── generate_ps.py
|    └─── create_noised_data.py
|    └─── train.py
|    └─── test.py
|    └─── operon.py
|    └─── replace.py   
└───functional files
|    └─── operon_sklearn.py
|    └─── pytorchtools.py
|    └─── model_cmb.py
|    └─── load_data_cmb.py
└───example notebook
|    └─── IOB_for_CMB_spectra.ipynb

References

iob_cmb's People

Contributors

xiaosheng-zhao avatar

Stargazers

Anything avatar Deaglan Bartlett avatar

Watchers

Matt Ho avatar  avatar

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.