Skip to content

We fit a one-input, one-output function with a simple neural network model.

License

Notifications You must be signed in to change notification settings

javier-rozalen/ml-function-fitting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Function fitting with neural networks

Fancy Neural Network

What is this repository?

The repository is meant to serve as a tutorial for a first, simple project in PyTorch. The goal is to have a neural network learn a target function.

Repository structure:

.
├── assets/                                   # Images, logos
├── .gitignore
├── main.ipynb                                # code file
├── CITATION.cff                              # Citation file
├── LICENSE                                   # License
├── README.md
├── env.yml                                   # Conda environment
└── requirements.txt                          # requirements

Installation

To install this project in your computer, choose one of the following options:

Option 1. conda anaconda

  1. Clone the repository:

git clone https://github.com/javier-rozalen/ml-tools-for-qm.git && cd ml-tools-for-qm

  1. If conda is not installed in your system, you can download it from https://docs.conda.io/en/latest/miniconda.html.
  2. Create a conda environment from the .yml file in the repository:

conda env create -f env.yml

  1. Activate the environment:

conda activate ml-function-fitting

  1. Install further requirements:

pip install -r requirements.txt

Option 2. Docker anaconda

Coming soon...

Usage

There are three code files:

  • 1_harmonic_oscillator.ipynb
  • 2_double_well.ipynb
  • 3_hydrogen_atom.ipynb

They are all in the .ipynb format, designed to be open with Jupyter Notebook. To open each of them, run the command jupyter notebook file.ipynb, "file" being one of the three scripts in the list above. Each cell cell has been pre-run, so you should be able to see the outputs from the start, even before running the cells. Below is a demo of the first file being run:

Uninstall

To remove the virtual environment created with Option 1 follow the steps below:

  1. Make sure your current environment is not ml-tools-for-qm, or if it is, type:

conda deactivate

  1. Remove the environment.

conda remove -n ml-tools-for-qm --all

  1. Remove the local repository.

Windows: rmdir /S ml-tools-for-qm

Linux/MacOS: rm -r ml-tools-for-qm

Support

If you have any questions or issues, please contact us at [email protected].

About

We fit a one-input, one-output function with a simple neural network model.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published