Skip to content

buptxz/EQL_Tensorflow

 
 

Repository files navigation

By Subham S. Sahoo, Christoph H. Lampert and Georg Martius

Implemented by Anselm Paulus, Arnab Bhattacharjee and Michal Rolínek.

Autonomous Learning Group, Max Planck Institute for Intelligent Systems.

Table of Contents

  1. Introduction
  2. Usage
  3. Dependencies
  4. Notes

Introduction

This repository contains TensorFlow implementation of the EQL-Div architecture presented in ICML 2018 paper "Learning Equations for Extrapolation and Control". This work proposes a neural network architecture for symbolic regression. There is also a Theano implementation, see martius-lab/EQL.

Usage

Prepare data

Either provide a python function to 'learn' by calling

python3 data_utils.py "{'file_name': 'F1data', 'fn_to_learn': 'F1', 'train_val_examples': 10000, 'test_examples': 5000}"

or use your own numpy arrays saved in training/evaluation data files.

Train individual model

Once the data is fixed train the model with

python3 train.py '{"train_val_file": "data/F1data_train_val", "test_file": "data/F1data_test"}'

Or possibly change some parameters with

python3 train.py '{"train_val_file": "data/F1data_train_val", "test_file": "data/F1data_test", "batch_size": 25}'

Perform model selection

In case you want to follow the model selection procedure from the paper, first generate runfiles for all the required settings with

python3 createjobs.py '{"train_val_file": "data/F1data_train_val", "test_file": "data/F1data_test"}'

Then run all scripts in the jobs folder.

Finally the model selection is performed by

python3 model_selection.py "{'results_path': 'results/model_selection'}"

Inspect the learned formulas

In each result folder one can find png files with latex and graph representations of the learned formulas.

Latex representation of function F1:
alt text
Graph representation of function F1:
alt text

Dependencies:

  • python>=3.5
  • tensorflow>=1.7
  • graphviz (including binaries)
  • latex

Notes

Disclaimer: This code is a PROTOTYPE and may contains bugs. Use at your own risk.

Contribute: If you spot some incompatibility of have some additional ideas, contribute via a pull request! Thank you!

About

Tensorflow implementation of equation learner

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%