summaryrefslogtreecommitdiff
path: root/neurobench_testing/custom_memristor_model.py
diff options
context:
space:
mode:
authorTanner Robison <[email protected]>2026-07-06 10:35:32 -0700
committerTanner Robison <[email protected]>2026-07-07 15:42:48 -0700
commite2b30976cdaccf9d2b9820fefa22ced03c82711f (patch)
tree99f1d6d5824882a533f46f1819138ec5196abed3 /neurobench_testing/custom_memristor_model.py
parent3a17db637fd41015df26f1cceb0d1c098e85d436 (diff)
readout layer trained
verified with time-series forecasting task and plotted
Diffstat (limited to 'neurobench_testing/custom_memristor_model.py')
-rw-r--r--neurobench_testing/custom_memristor_model.py36
1 files changed, 0 insertions, 36 deletions
diff --git a/neurobench_testing/custom_memristor_model.py b/neurobench_testing/custom_memristor_model.py
deleted file mode 100644
index eb91b99..0000000
--- a/neurobench_testing/custom_memristor_model.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import torch
-import memtorch
-from memtorch.bh.memristor.Memristor import Memristor
-from memtorch.utils import clip, convert_range #idk if ill need this
-
-class MemtorchMemristor(Memristor):
- def __init__(
- self,
- k_off = 1.0, # switching rate for off state
- k_on = -1.0, # switching rate for on state
- alpha_off = 5, # exponent controlling nonlinearity
- alpha_on = 5, # exponent controlling nonlinearity
- i_off = 0.5e-3, # threshhold current to trigger off state
- i_on = 0.5e-3, # threshold current to trigger on state
- r_on = 1e3, # maximum resistance
- r_off = 10e3, # minimum resistance
- p = 2, # window function exponent
- **kwargs
- ):
- #initializing base memristor class
- super(MemtorchMemristor, self).__init__(r_off=r_off, r_on=r_on, **kwargs)
-
- # hyper parameters
- self.k_off = k_off
- self.k_on = k_on
- self.alpha_off = alpha_off
- self.alpha_on = alpha_on
- self.i_on = i_on
- self.i_off = i_off
- self.p = p
-
- #state variables
- self.w = 0.5
- self.g = 1/self.r_on
-
- def window()