Skip to content

Sayed-Hossein-Hosseini/Neural_Cosine_Approximator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 Neural Cosine Approximator

Approximate the cosine function using a simple neural network from scratch!

This project demonstrates how a neural network can learn to approximate the mathematical cos(x) function using supervised learning.

🚀 Features

  • 📚 Implemented entirely in Python and Jupyter Notebook.
  • 🧮 Uses a simple fully connected neural network.
  • 🏗️ Built from scratch — no deep learning frameworks (such as TensorFlow or PyTorch) required!
  • 📈 Visualizes both the training process and the approximation performance.
  • 🎓 Great for educational purposes and understanding how neural networks learn mathematical functions.

📝 Project Structure

  • Neural_Cosine_Approximator.ipynb — Main notebook containing:
    • Data preparation
    • Neural network implementation
    • Training loop
    • Evaluation & visualization

📦 Dependencies

  • Python >= 3.8
  • NumPy
  • Matplotlib
  • Jupyter Notebook

You can install the required libraries using:

pip install numpy matplotlib jupyter

🏃‍♂️ Usage

  1. Clone the repository:
git clone https://github.com/YOUR_USERNAME/YOUR_REPOSITORY.git
cd YOUR_REPOSITORY
  1. Launch the notebook:
jupyter notebook Neural_Cosine_Approximator.ipynb
  1. Run the cells and enjoy watching your neural network approximate cos(x)!

📚 Learning Goals

  • Understand how neural networks can approximate continuous functions.
  • Learn how to implement a basic neural network without external frameworks.
  • Visualize model learning and performance.

📜 License

This project is licensed under the MIT License.

✨ Author

Sayyed Hossein Hosseini DolatAbadi


🌟 If you like this project, consider giving it a ⭐ on GitHub!

About

In this project, without using neural network libraries such as pytorch and tensorflow, we design a neural network with an arbitrary number of hidden layers that predicts the value of the cosine function. Note that the input is in radians.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors