master-thesis
Function generation from a Sum of Oscillator Signals
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.5%) to scientific vocabulary
Keywords
Repository
Function generation from a Sum of Oscillator Signals
Basic Info
- Host: GitHub
- Owner: Wehzie
- License: other
- Language: Python
- Default Branch: main
- Homepage: https://fse.studenttheses.ub.rug.nl/id/eprint/31138
- Size: 1.15 MB
Statistics
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Function generation from a Sum of Oscillator Signals
This code accompanies a master thesis.

Abstract
Energy demand in data-intensive applications is an ever-growing concern. Training a recent large language model consumes energy in the order of hundreds of US households per year. Remarkably, the human brain is orders of magnitude more energy efficient than modern day digital computers. Taking inspiration from the brain, the neuromorphic paradigm aims to build more efficient computing systems using analog devices.
In this work, an ensemble of oscillators is designed and simulated with the goal of arbitrary time-series approximation. Each oscillator-neuron is formed by a vanadium dioxide memristor in series with a resistor-capacitor (RC) circuit. Three approaches to simulate an ensemble are developed using the SPICE circuit simulator. Because the propagation of gradient information through electric circuits is a hard problem, multiple gradient-free optimization algorithms are explored which perturb oscillators' frequency, gain, phase and offset. We fit a range of real-world and synthetic target functions with varying frequency bands and durations. Root Mean Squared Error (RMSE) between a target and ensemble signal is used to evaluate fit. As a benchmark algorithm we rely on linear regression which produces an analytical solution for the choice of circuit parameters.
We show that a vanadium-dioxide oscillator ensemble is suitable for function generation when the target's frequency band lies within the frequency band of the oscillator-neurons. The approximation of chirp signals is difficult, none of the real-world targets can be fit. The system benefits from broad phase and frequency diversity. In contrast, a wide dynamic range leads to exponential loss growth for most algorithms. Surprisingly, an increase in the number of oscillators tends to increase loss. Of the gradient-free algorithms, a Las Vegas and a random walk algorithm perform best; they outperform advanced algorithms such as Simulated Annealing, Basin Hopping and Differential Evolution. We achieve a RMSE of 0.02 with the Las Vegas algorithm, fitting a sine target function of amplitude 1; this is our best result. Linear regression finds a RMSE that is 13 orders of magnitude smaller.
We identify plateaus and steep steps in oscillators' frequency band as one of two hinderances to better fit. The strongest argument for this are the diminishing returns in adding oscillators to an ensemble while solving analytically. Therefore, vanadium-dioxide oscillators alone seem insufficient for realizing an arbitrary function approximator in the frequency domain. Second, we find that gradient-free algorithms would benefit from negative oscillator gains, as this is where the distribution of circuit parameters between gradient-free algorithms and linear regression primarily differs.
Requirements
Install ngspice as a SPICE simulator.
Install the required Python libraries.
# you may want to create a virtual environment first
pip install -r requirements.txt
Pydot is used with NetworkX for drawing graphs. Pydot requires GraphViz to be installed. Installation instructions are found here.
# Debian/Ubuntu
sudo apt install graphviz
Running
To start the simulation execute
python src/main.py
For advice on parameters run.
python src/main.py -h
Detaching a terminal
Detaching a terminal is useful in order to close a terminal temporarily but being able to resume the terminal later to monitor progress of a simulation.
Some options to do this are tmux and screen, where tmux is more modern.
Instructions are geared towards Debian and Ubuntu hosts.
Install requirements
sudo apt install tmux
Start tmux session
tmux
Run desired commands, start simulation
python src/main.py
Detach tmux
# press Ctrl + b
# press d
Now the terminal running tmux can be closed or an SSH connection to a host can be terminated
To reattach a session
tmux ls # to list sessions
tmux attach-session -t <session-name>
Multiple sessions can be run by detaching with
# press Ctrl + b
# press $
# enter session name
Deployment on Slurm (High Performance Computing cluster)
First prepare a job according to https://wiki.hpc.rug.nl/habrok/job_management/running_jobs.
Complete job files are in the scripts directory.
Start a job; make sure the script is executed from the same directory as done during testing.
cd path/to/project
sbatch peregrine_job.sh
List active jobs.
squeue -u $USER
Get information about a running job.
jobinfo JobID
Testing
Static code analysis.
# easy-going
pyflakes src/
# pedantic
pylint --errors-only src/
Docstrings.
# easy-going
pydocstyle src/ --add-ignore=D103,D104,D105,D106,D107,D202,D400,D403
# pedantic
pydocstyle src/
Formatting.
black src/ -l 100
Static type checking.
mypy src/
Unit tests.
pytest src/tests
Owner
- Name: Rafael Tappe Maestro
- Login: Wehzie
- Kind: user
- Location: EU
- Company: itemis AG
- Website: sentimentfriend.com
- Repositories: 5
- Profile: https://github.com/Wehzie
Student in MSc Artifical Intelligence
Citation (CITATION.cff)
cff-version: 1.2.0
title: Function generation from a Sum of Oscillator Signals
message: >-
If you use this software, please cite it using these
metadata.
type: software
authors:
- family-names: Tappe Maestro
given-names: Rafael
orcid: 'https://orcid.org/0000-0002-7789-3527'
repository-code: 'https://github.com/Wehzie/master-thesis'
abstract: >-
Energy demand in data-intensive applications is an
ever-growing concern. Training a recent large language
model consumes energy in the order of hundreds of US
households per year. Remarkably, the human brain is orders
of magnitudes more energy efficient than modern day
digital computers. Taking inspiration from the brain, the
neuromorphic paradigm aims to build more efficient
computing systems using analog devices.
In this work, an ensemble of oscillators is designed and
simulated with the goal of arbitrary time-series
approximation. Each oscillator-neuron is formed by a
vanadium dioxide memristor in series with a
resistor-capacitor (RC) circuit. Multiple gradient-free
optimization algorithms are explored to perturb the
oscillator ensemble, in order to change their frequency,
gain, phase and offset. A range of real-world and
synthetic target functions are tested against the system.
We show that the vanadium-dioxide oscillator ensemble is
suitable for function generation across a range of
algorithms when the target's frequencies lie within the
frequency band of the oscillator-neurons. The system
benefits from broad phase and frequency diversity, in
particular from the addition of slower oscillators. In
contrast, a wide dynamic range leads to exponential loss
growth for a majority of algorithms. Furthermore, an
increase in the number of oscillators tends to increase
loss linearly.
license: Apache-2.0
commit: cb3f23b2b12ffbec9c53ac684698c62d296e8ef1
version: 1.0.0
date-released: '2023-06-01'
GitHub Events
Total
Last Year
Dependencies
- ubuntu rolling build
- numpy *
- scipy *
- black *
- cycler *
- matplotlib *
- mypy *
- networkx *
- numpy *
- pandas *
- pydocstyle *
- pydot *
- pyflakes *
- scikit-learn *
- scipy *
- tqdm *