summaryrefslogtreecommitdiff
path: root/neurobench_testing/custom_memristor_model.py
diff options
context:
space:
mode:
authorTanner Robison <[email protected]>2026-06-22 14:26:09 -0700
committerTanner Robison <[email protected]>2026-06-23 20:31:09 -0700
commitc53c13b873ea1e69ed260844268f11708d4b4a5b (patch)
tree1b9f4d6ae9bccff1c52cf8bfe7c1f953056eaecf /neurobench_testing/custom_memristor_model.py
parent30dc9553e8a7a7d603077a80238782298d0b9349 (diff)
Removed Neurobench because of incompatibility problems
Diffstat (limited to 'neurobench_testing/custom_memristor_model.py')
-rw-r--r--neurobench_testing/custom_memristor_model.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/neurobench_testing/custom_memristor_model.py b/neurobench_testing/custom_memristor_model.py
index 8bdcde0..eb91b99 100644
--- a/neurobench_testing/custom_memristor_model.py
+++ b/neurobench_testing/custom_memristor_model.py
@@ -1,5 +1,7 @@
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__(
@@ -27,16 +29,8 @@ class MemtorchMemristor(Memristor):
self.i_off = i_off
self.p = p
- # makes sure w starts in valid state
- if not hasattr(self, 'w'):
- self.w = torch.tensor(0.5)
-
-
- """
- Updates w and computes new resistance
-
- """
- def step(self, v, dt):
- i = v / self.r_curr
-
+ #state variables
+ self.w = 0.5
+ self.g = 1/self.r_on
+ def window()