This project simulates an experiment using Random Fourier Features (RFF) to approximate a non-linear function. The experiment is repeated multiple times, and the mean squared error (MSE) is calculated and plotted over iterations.
This simulation is inspired by the work of J. Dong, Y. Zheng, and B. Chen, titled "A Unified Framework of Random Feature KLMS Algorithms and Convergence Analysis," presented at the 2018 International Joint Conference on Neural Networks (IJCNN) in Rio de Janeiro, Brazil. Read the paper.
The project is divided into three main scripts:
-
data_generator.py
- Contains the
DataGenerator
class, which generates synthetic data for the experiment.
- Contains the
-
model.py
- Contains the
Model
class, which represents the RFF model and performs training.
- Contains the
-
main.py
- The main script that runs the experiment, collects MSE values, and plots the results.
-
Clone the repository:
git clone https://github.com/Parth-nXp/rff-experiment.git cd rff-experiment
-
Create a virtual environment and activate it:
python -m venv rff-klms source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
Run the main script to start the experiment:
python main.py
If you encounter any issues or errors while running the project, please check the following:
-
Ensure all dependencies are installed correctly by running
pip install -r requirements.txt
. -
Make sure you are using a compatible version of Python (e.g., Python 3.6 or higher).
-
If you encounter issues related to missing files or incorrect paths, verify that you are in the correct directory (
rff-experiment
).
If problems persist, feel free to open an issue on GitHub.
Contributions are welcome! If you have suggestions for improvements or bug fixes, please follow these steps:
-
Fork the repository.
-
Create a new branch (
git checkout -b feature-branch
). -
Make your changes and commit them (
git commit -m 'Add some feature'
). -
Push to the branch (
git push origin feature-branch
). -
Open a pull request.
Please ensure your code follows the existing style and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for details.