Giter VIP home page Giter VIP logo

philippbaumeister / mdn_exoplanets Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 1.0 14.11 MB

Trained models for the paper "Machine-learning inference of interior structures of low-mass exoplanets" (Baumeister et al. 2020)

License: MIT License

Jupyter Notebook 67.95% Python 32.05%
machine-learning planetary-science exoplanets mixture-density-networks numerical-modelling machinelearning-python tensorflow keras

mdn_exoplanets's Introduction

Inferring interior structures of exoplanets with Mixture Density Networks

MIT License DOI


โ— An improved version of this model is available at https://github.com/philippbaumeister/ExoMDN โ—


This repository contains the trained machine learning models and python notebooks for the paper Machine-learning inference of the interior structure of low-mass exoplanets (Baumeister et al. 2020).

Required packages

This project requires Python 3.

  • keras = 2.2.4
  • numpy = 1.18.0
  • scipy >= 1.2.0
  • matplotlib >= 3.0.2
  • tensorflow = 1.15.2
  • tensorflow-probability = 0.7.0
  • ipywidgets >= 7.4.2
  • joblib >= 0.13.2
  • scikit-learn = 0.22.1

Installing the required packages

Using anaconda (preferred)
conda env create -f requirements.yml

Activate with

conda activate tf1.15
Using pip
pip install -r requirements.txt

How to use

  • MDN_exoplanets.ipynb contains all the code to load the trained MDN models and predict the distribution of possible interior structures of a planet.
  • The mdn directory contains the MDN layer code adopted from https://github.com/cpmpercussion/keras-mdn-layer.
  • The models directory contains data scalers and the MDN models trained either with mass and radius of the planet, or with mass, radius, and k2.

mdn_exoplanets's People

Contributors

philippbaumeister avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

leelu74

mdn_exoplanets's Issues

Error in MDN_exoplanets notebook?

Hi, I am getting the following error with the MDN_exoplanets notebook when I click the "load model" button. It looks like the error is related to the keras package, but I verified that I have the right version installed (2.2.4) and am using Python 3.7. Any advice for resolving this issue would be appreciated. Thank you!

Chosen model: MR
Loading model ./models/MR_mdn_model.hd5 ...

AttributeError Traceback (most recent call last)
in on_button_clicked(self, b)
53 p = file_parameters(self.select.value)
54 self.use_k2 = p["k2"]
---> 55 self.mdn_model, self.scaler = self.load_model(p["path"])
56
57 def load_model(self, path):

in load_model(self, path)
58 print(f"Loading model {path}_mdn_model.hd5 ...")
59 mdn_model = keras.models.load_model(f"{path}_mdn_model.hd5",
---> 60 custom_objects={"MDN": mdn.MDN, "loss_func": mdn.get_mixture_loss_func(1, self.num_components)})
61
62 print(f"Loading scaler {path}_scaler.pkl ...")

~/anaconda3/envs/tf1.15/lib/python3.7/site-packages/keras/engine/saving.py in load_model(filepath, custom_objects, compile)

~/anaconda3/envs/tf1.15/lib/python3.7/site-packages/keras/engine/saving.py in _deserialize_model(f, custom_objects, compile)

AttributeError: 'str' object has no attribute 'decode'

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.