This repository contains the implementation of a Physics-Informed Neural Network (PINN) model for predicting the behavior of Conductive Bridge Random Access Memory (CBRAM) devices. The model captures both the I-V characteristics and dynamic responses of the memristive devices, leveraging both experimental data and physical principles to improve accuracy and reliability.
- Introduction
- Project Structure
- Installation
- Usage
- Dataset
- Training
- Model Parameters
- Visualization
- References
This project provides a PINN framework tailored to model the switching dynamics of RRAM devices. It combines the benefits of physics-driven modeling and data-driven learning, enabling the model to generalize across different memristive devices and operational conditions.
- Physics-Informed Neural Network (PINN) implementation for RRAM devices.
- Predicts both static and dynamic behavior of CBRAM devices.
- Incorporates physical principles such as drift-diffusion and thermally-assisted ion migration.
- Scalable to various RRAM device configurations with different materials and structures.
The repository is structured as follows:
|-- Data_MoS2/ # Directory containing the data files
|-- pinn_rram_model.py # Main script containing the PINN model implementation
|-- pinn_rram_training.py # Script for training the PINN model
|-- visualization.py # Script for plotting and visualization of results
|-- utils.py # Utility functions for data preprocessing and scaling
|-- README.md # This README file
- Python 3.7+
- PyTorch: Install via
pip install torch - NumPy: Install via
pip install numpy - Matplotlib: Install via
pip install matplotlib - SciPy: Install via
pip install scipy - scikit-learn: Install via
pip install scikit-learn - Pandas: Install via
pip install pandas
git clone https://github.com/chipher-zero/CBRAM_PINN.git
cd pinn-rram-modelpip install -r requirements.txtPlace your dataset files (in .txt or .xls format) in the Data_~Memory_Type~/ directory. Each data file should contain the following columns:
- Time: Time of the measurement
- AI: Current values
- AV: Voltage values
- Res: Resistance values (optional)
(Amend code if necessary)
To run the model and train the PINN on the provided dataset, execute the following command:
python Memristor12_final.pyThis script will train the model, track the loss, and display the I-V characteristics and other relevant metrics.
Alternatively, use the available jupyter notebook
Visualisation is currently handled inside the main code
The dataset files are expected to be in the Data_MoS2/ directory. Each dataset corresponds to the I-V measurements from CBRAM devices. The dataset is read using the ReadData function, which processes the data for use in the PINN model.
The training script iterates through the dataset using PyTorch's DataLoader. Key features of the training loop include:
- Combined Loss Function: Logarithmic loss for small values and MSE for large values.
- Physics Loss: Enforces consistency with physical principles like the time evolution of the gap and filament radius.
- Adaptive Learning Rate: Utilizes
torch.optim.lr_scheduler.ReduceLROnPlateaufor adaptive learning rate adjustment.
To modify the hyperparameters, edit the Memristor12_final.py or memristor12_MoS2 copy 2.ipynb script.
The PINN model is defined in Memristor12_final.py. It includes key physical parameters such as:
- Activation Energy (Ea)
- Initial Gap Distance (gap_ini)
- Thermal Resistance (Rth)
The forward pass of the model calculates the predicted current, temperature, and gap dynamics, while the loss function balances data-driven error and physical consistency.
The processing_MoS2.ipynb notebook provides plots plots of:
- I-V Characteristics: Comparison between the model’s predicted I-V curve and the experimental data.
- Dynamic Performance Simulation: Projection of the device's operation under application of a paired-pulse bias
- data4.txt: Contains measured pulsed data
You can adjust the plotting configurations in both .py script and notebook.
- Kleitsiotis, G., et al. "A Physics-Informed Neural Network for CBRAM Device Modelling." (2024).
- Kitsios, S., et al. "MoS2 Enhanced CBRAMs." (2022).
- Bousoulas, P., et al. "Volatile CBRAMs for Neuromorphic Computing." (2022).
- Jiang, Z., et al. "A Compact Model for Metal-Oxide Resistive Random Access Memory with Experiment Verification" (2016)
- Reuben, J., et al. "A modeling Methodology for Resistive RAM Based on Stanford-PKU Model with Extended Multilevel Capability" (2019)
- Li, H., et al. "Variation-Aware, Reliability-Emphasized Design and Optimization of RRAM Using SPICE Model" (2015)