GithubHelp home page GithubHelp logo

ndexter / mlfa Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 5.0 687.74 MB

Machine Learning Function Approximation: This code implements the fully-connected Deep Neural Network (DNN) architectures considered in the paper "The gap between theory and practice in function approximation with deep neural networks" available at https://arxiv.org/abs/2001.07523

License: MIT License

Python 83.13% Shell 16.87%
relu-network deep-neural-networks dnn paper theory

mlfa's Introduction

MLFA

(M)achine (L)earning (F)unction (A)pproximation

This code implements the fully-connected Deep Neural Network (DNN) architectures considered in the paper "The gap between theory and practice in function approximation with deep neural networks" available at https://arxiv.org/abs/2001.07523

The DNN.py code accepts a variety of command line inputs, specifying everything from the optimizer to use in solving to the width, depth, and activation function of the networks. Various building-blocks are available for constructing the networks, including the default activation block and ResNet blocks in resnet_v1 and resnet_v2. The DNN code accepts MATLAB .mat format data files containing an array X of points and Y of function values, and generates "run_data.mat" and "ensemble_data.mat" files containing information about the runs and testing data, respectively.

Use

This package is compatible with version 1.13 of Tensorflow. Arguments are specified on the command line as follows:

python DNN.py --nb_layers 10 
              --nb_nodes_per_layer 100 
              --nb_train_points 750 
              --train_pointset uniform_random 
              --nb_epochs 50000 
              --batch_size 750 
              --nb_trials 20 
              --train 0 
              --make_plots 0 
              --nb_test_points 609025 
              --test_pointset CC_sparse_grid 
              --blocktype default 
              --activation relu 
              --example exp_cos 
              --optimizer Adam 
              --quiet 0 
              --input_dim 8 
              --output_dim 1 
              --MATLAB_data 1 
              --trial_num 1 
              --precision single 
              --run_ID test_exp_cos 
              --use_regularizer 0 
              --reg_lambda 1e-3 
              --error_tol 5e-7 
              --initializer normal 
              --sigma 1e-1 
              --lrn_rate_schedule exp_decay

We also include a shell script "run_train_test_local.sh" to simplify running ensembles of trials in testing DNN performance. To use the script, modify the variables as desired and type:

bash run_train_test_local.sh

Examples

Difficulty of approximating a piecewise continuous function with a ReLU DNN with 15 layers and 200 nodes per layer: difficulty of approximating a piecewise continuous function with a ReLU DNN

Training a ReLU network with 2 layers and 200 nodes per layer: training a ReLU network with 2 layers and 200 nodes per layer

Training a ReLU network to approximate a smooth function: training a relu network to approximate a smooth function

Training a ReLU network to approximate a more oscillatory function: oscillatory function

mlfa's People

Contributors

ndexter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.