summaryrefslogtreecommitdiff
path: root/custom_benchmark
diff options
context:
space:
mode:
authorTanner Robison <[email protected]>2026-06-25 15:27:45 -0700
committerTanner Robison <[email protected]>2026-06-25 15:49:24 -0700
commit3c9a3d7d92d155545ce4892524f00dcd092b52d3 (patch)
tree2b797ec584b7496da7764cb8fce8db4aad9e8ba4 /custom_benchmark
parentc53c13b873ea1e69ed260844268f11708d4b4a5b (diff)
using memTorch to simulate spires reservoir
focusing on trying to simulate a spires reservoir on a memristor crossbar using memTorch
Diffstat (limited to 'custom_benchmark')
-rw-r--r--custom_benchmark/README.md5
-rw-r--r--custom_benchmark/memTorch_SNN.py28
-rw-r--r--custom_benchmark/memristor_benchmark.cpp2
3 files changed, 0 insertions, 35 deletions
diff --git a/custom_benchmark/README.md b/custom_benchmark/README.md
deleted file mode 100644
index 7513f7f..0000000
--- a/custom_benchmark/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-# custom benchmark for memTorch simulations
-
-## metrics
-
-## tasks
diff --git a/custom_benchmark/memTorch_SNN.py b/custom_benchmark/memTorch_SNN.py
deleted file mode 100644
index 67e9cb6..0000000
--- a/custom_benchmark/memTorch_SNN.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import torch
-import memtorch
-
-# 1. Standard memTorch setup (Static crossbar weights)
-ann_layer = torch.nn.Linear(100, 10)
-patched_layer = memtorch.mn.Module.patch_model(ann_layer, memristor_model)
-
-# 2. Your custom SNN wrapper loop
-def forward_snn(input_spikes_over_time):
- # input_spikes_over_time shape: (time_steps, batch_size, input_dim)
- time_steps = input_spikes_over_time.shape[0]
- v_mem = torch.zeros(batch_size, 10) # Hidden neuron membrane potentials
- output_spikes = []
-
- for t in range(time_steps):
- # Pass binary spikes through memTorch's physical crossbar simulation
- current_in = patched_layer(input_spikes_over_time[t])
-
- # Leaky Integrate-and-Fire (LIF) logic (Written by you!)
- v_mem = 0.9 * v_mem + current_in # Leak & Integrate
-
- # Fire threshold
- spike = (v_mem >= 1.0).float()
- v_mem[v_mem >= 1.0] = 0.0 # Reset
-
- output_spikes.append(spike)
-
- return torch.stack(output_spikes)
diff --git a/custom_benchmark/memristor_benchmark.cpp b/custom_benchmark/memristor_benchmark.cpp
deleted file mode 100644
index 91e7eb6..0000000
--- a/custom_benchmark/memristor_benchmark.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <iostream>
-#include <torch/extension.h>