This project demonstrates the process of training a neural network to fit various mathematical functions, including sine, rectangle, sawtooth, and polynomial functions. The project allows for the visualization of the learning process through animated plots.
@quantech_ai is my second nickname 😜
This project uses a simple neural network implemented in PyTorch to fit different types of functions. The functions include sinusoidal, rectangle, sawtooth, and polynomial functions. The neural network's learning process is visualized using animated plots created with Matplotlib.
You can install the required packages using pip:
pip install -r requirements.txt
Run the script with the desired parameters to generate and visualize the function fitting process. Below is the basic usage with all available arguments explained.
python main.py --start <START> --stop <STOP> --resolution <RESOLUTION> --amplitude <AMPLITUDE> --function <FUNCTION> --epochs <EPOCHS> --interval <INTERVAL> --noise_level <NOISE_LEVEL> --save
- --start: X axis start value.
- --stop: X axis end value.
- --resolution: Resolution of the generated data.
- --amplitude: Amplitude of the sinusoidal function.
- --function: Type of function to learn. Options: sin, rectangle, sawtooth, polynomial. Default: sin.
- --epochs: Number of training epochs.
- --interval: Interval for plotting results.
- --noise_level: Noise level added to the data.
- --save: Save gif file