Plasticity and language in the anaesthetized human hippocampus.
A correction to this paper has been published: the notice, 42277412, from Europe PMC.
A correction to this paper has been published: the notice, 42680833, from Europe PMC.
6 blocks of code here have a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 9 matches · 3 of them tie a paragraph to a whole file without given lines: weak matches, whose lines are not tinted
- [1] § Methods › Continuous-rate RNN model ↔ code/rate/model.py, lines 446 to 567 · score 0.86 · synaptic decay, sigmoid function, inhibitory units, rate RNN, firing rate, sum · block
oscr:b:MA46CMKX4XC9B-B· Report a mismatch - [2] § Methods › Continuous-rate RNN model ↔ code/rate/fnc_eval_model.m, the whole file · a weak match · score 0.80 · recurrent connectivity matrix, synaptic decay, firing rate, sigmoid, excitatory, variable · block
oscr:b:6AJS4QWHMARSQ-U· Report a mismatch - [3] § Methods › Neuropixels data acquisition set-up and intraoperative recordings ↔ notebook/ap_chronic_demo.ipynb, lines 77 to 118 · score 0.65 · SpikeGLX, Neuropixels probe, shank, AP, filtered, channels · Report a mismatch
- [4] § Plasticity in the unconscious state ↔ code/rate/model.py, lines 22 to 26 · score 0.61 · recurrent connection, inhibitory neurons, RNN model, excitatory · block
oscr:b:D4D647QTBWV6D-I· Report a mismatch - [5] § Methods › Continuous-rate RNN model ↔ code/rate/model.py, lines 27 to 64 · score 0.60 · readout weights, recurrent connectivity, classifier, network, model · block
oscr:b:C4MSGPKKFA5VM-Z· Report a mismatch - [6] § Methods › Continuous-rate RNN model ↔ code/rate/fnc_eval_model.m, the whole file · a weak match · score 0.59 · synaptic decay, recurrent connectivity, weights, model, RNN, trained · block
oscr:b:6AJS4QWHMARSQ-U· Report a mismatch - [7] § Auditory monitoring during anaesthesia ↔ code/rate/svm_decoding_per_neuron.m, lines 281 to 354 · score 0.58 · SVM decoding, tone accuracy, tone identity, encoding · block
oscr:b:P9GJK4E7Q3ED2-8· Report a mismatch - [8] § Methods › Neuronal data processing › Motion correction ↔ matlab/dredge.m, the whole file · a weak match · score 0.55 · Decentralized Registration, Motion correction, DREDge, raw · block
oscr:b:SM3WQ9FTZMT75-X· Report a mismatch - [9] § Methods › Neuronal data processing › LFP data ↔ notebook/lfp_registration_and_interpolation_demo.ipynb, lines 201 to 252 · score 0.55 · bandpass filtered, LFP band, raw, signal, channels · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 701 lines · 22 KB · Apache-2.0 · 3 matches
- #! /usr/bin/env python
- # -*- coding: utf-8 -*-
- # vim:fenc=utf-8
- #
- # Name: Robert Kim
- # Date: October 11, 2019
- # Email: [email hidden]
- # Description: Implementation of the continuous rate RNN model
- import os, sys
- import numpy as np
- import tensorflow as tf
- if tf.__version__[0] == '2':
- import tensorflow.compat.v1 as tf
- tf.disable_v2_behavior()
- import scipy.io
- '''
- CONTINUOUS FIRING-RATE RNN CLASS
- '''
- class FR_RNN_dale:
- """
- Firing-rate RNN model for excitatory and inhibitory neurons
- Initialization of the firing-rate model with recurrent connections
- """
- def __init__(self, N, P_inh, P_rec, w_in, som_N, w_dist, gain, apply_dale, w_out):
- """
- Network initialization method
- N: number of units (neurons)
- P_inh: probability of a neuron being inhibitory
- P_rec: recurrent connection probability
- w_in: NxN weight matrix for the input stimuli
- som_N: number of SOM neurons (set to 0 for no SOM neurons)
- w_dist: recurrent weight distribution ('gaus' or 'gamma')
- apply_dale: apply Dale's principle ('True' or 'False')
- w_out: Nx1 readout weights
- Based on the probability (P_inh) provided above,
- the units in the network are classified into
- either excitatory or inhibitory. Next, the
- weight matrix is initialized based on the connectivity
- probability (P_rec) provided above.
- """
- self.N = N
- self.P_inh = P_inh
- self.P_rec = P_rec
- self.w_in = w_in
- self.som_N = som_N
- self.w_dist = w_dist
- self.gain = gain
- self.apply_dale = apply_dale
- self.w_out = w_out
- # Assign each unit as excitatory or inhibitory
- inh, exc, NI, NE, som_inh = self.assign_exc_inh()
- self.inh = inh
- self.som_inh = som_inh
- self.exc = exc
- self.NI = NI
- self.NE = NE
- # Initialize the weight matrix
- self.W, self.mask, self.som_mask = self.initialize_W()
- def assign_exc_inh(self):
- """
- Method to randomly assign units as excitatory or inhibitory (Dale's principle)
- Returns
- inh: bool array marking which units are inhibitory
- exc: bool array marking which units are excitatory
- NI: number of inhibitory units
- NE: number of excitatory units
- som_inh: indices of "inh" for SOM neurons
- """
- # Apply Dale's principle
- if self.apply_dale == True:
- inh = np.random.rand(self.N, 1) < self.P_inh
- exc = ~inh
- NI = len(np.where(inh == True)[0])
- NE = self.N - NI
- # Do NOT apply Dale's principle
- else:
- inh = np.random.rand(self.N, 1) < 0 # no separate inhibitory units
- exc = ~inh
- NI = len(np.where(inh == True)[0])
- NE = self.N - NI
- if self.som_N > 0:
- som_inh = np.where(inh==True)[0][:self.som_N]
- else:
- som_inh = 0
- return inh, exc, NI, NE, som_inh
- def initialize_W(self):
- """
- Method to generate and initialize the connectivity weight matrix, W
- The weights are drawn from either gaussian or gamma distribution.
- Returns
- w: NxN weights (all positive)
- mask: NxN matrix of 1's (excitatory units)
- and -1's (for inhibitory units)
- NOTE: To compute the "full" weight matrix, simply
- multiply w and mask (i.e. w*mask)
- """
- # Weight matrix
- w = np.zeros((self.N, self.N), dtype = np.float32)
- idx = np.where(np.random.rand(self.N, self.N) < self.P_rec)
- if self.w_dist.lower() == 'gamma':
- w[idx[0], idx[1]] = np.random.gamma(2, 0.003, len(idx[0]))
- elif self.w_dist.lower() == 'gaus':
- w[idx[0], idx[1]] = np.random.normal(0, 1.0, len(idx[0]))
- w = w/np.sqrt(self.N*self.P_rec)*self.gain # scale by a gain to make it chaotic
- if self.apply_dale == True:
- w = np.abs(w)
- # Mask matrix
- mask = np.eye(self.N, dtype=np.float32)
- mask[np.where(self.inh==True)[0], np.where(self.inh==True)[0]] = -1
- # SOM mask matrix
- som_mask = np.ones((self.N, self.N), dtype=np.float32)
- if self.som_N > 0:
- for i in self.som_inh:
- som_mask[i, np.where(self.inh==True)[0]] = 0
- return w, mask, som_mask
- def load_net(self, model_dir):
- """
- Method to load pre-configured network settings
- """
- settings = scipy.io.loadmat(model_dir)
- self.N = settings['N'][0][0]
- self.som_N = settings['som_N'][0][0]
- self.inh = settings['inh']
- self.exc = settings['exc']
- self.inh = self.inh == 1
- self.exc = self.exc == 1
- self.NI = len(np.where(settings['inh'] == True)[0])
- self.NE = len(np.where(settings['exc'] == True)[0])
- self.mask = settings['m']
- self.som_mask = settings['som_m']
- self.W = settings['w']
- self.w_in = settings['w_in']
- self.b_out = settings['b_out']
- self.w_out = settings['w_out']
- return self
- def display(self):
- """
- Method to print the network setup
- """
- print('Network Settings')
- print('====================================')
- print('Number of Units: ', self.N)
- print('\t Number of Excitatory Units: ', self.NE)
- print('\t Number of Inhibitory Units: ', self.NI)
- print('Weight Matrix, W')
- full_w = self.W*self.mask
- zero_w = len(np.where(full_w == 0)[0])
- pos_w = len(np.where(full_w > 0)[0])
- neg_w = len(np.where(full_w < 0)[0])
- print('\t Zero Weights: %2.2f %%' % (zero_w/(self.N*self.N)*100))
- print('\t Positive Weights: %2.2f %%' % (pos_w/(self.N*self.N)*100))
- print('\t Negative Weights: %2.2f %%' % (neg_w/(self.N*self.N)*100))
- '''
- Task-specific input signals
- '''
- def generate_input_stim_go_nogo(settings):
- """
- Method to generate the input stimulus matrix for the
- Go-NoGo task
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- prob: probability for GO trials
- taus: time-constants (in steps)
- DeltaT: sampling rate
- OUTPUT
- u: 1xT stimulus matrix
- label: either +1 (Go trial) or 0 (NoGo trial)
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- prob = settings['prob']
- u = np.zeros((1, T)) #+ np.random.randn(1, T)
- u_lab = np.zeros((2, 1))
- if np.random.rand() <= prob:
- u[0, stim_on:stim_on+stim_dur] = 1
- label = 1
- else:
- u[0, stim_on:stim_on+stim_dur] = -1
- label = 0
- return u, label
- def generate_input_stim_go_nogo2(settings):
- """
- Method to generate the input stimulus matrix for the
- Go-NoGo task
- Modified to include two input channels
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- prob: probability for GO trials
- taus: time-constants (in steps)
- DeltaT: sampling rate
- OUTPUT
- u: 1xT stimulus matrix
- label: either +1 (Go trial) or 0 (NoGo trial)
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- prob = settings['prob']
- u = np.zeros((2, T)) #+ np.random.randn(1, T)
- u = u + np.random.randn(np.shape(u)[0], np.shape(u)[1])
- u_lab = np.zeros((2, 1))
- if np.random.rand() <= prob:
- u[1, stim_on:stim_on+stim_dur] = u[1, stim_on:stim_on+stim_dur] + 1
- label = 1
- else:
- u[0, stim_on:stim_on+stim_dur] = u[0, stim_on:stim_on+stim_dur] + 1
- label = 0
- return u, label
- def generate_input_stim_xor(settings):
- """
- Method to generate the input stimulus matrix (u)
- for the XOR task
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- delay: delay b/w two stimuli (in steps)
- taus: time-constants (in steps)
- DeltaT: sampling rate
- OUTPUT
- u: 2xT stimulus matrix
- label: 'same' or 'diff'
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- delay = settings['delay']
- # Initialize u
- u = np.zeros((2, T))
- # XOR task
- labs = []
- if np.random.rand() < 0.50:
- u[0, stim_on:stim_on+stim_dur] = 1
- labs.append(1)
- else:
- u[0, stim_on:stim_on+stim_dur] = -1
- labs.append(-1)
- if np.random.rand() < 0.50:
- u[1, stim_on+stim_dur+delay:stim_on+2*stim_dur+delay] = 1
- labs.append(1)
- else:
- u[1, stim_on+stim_dur+delay:stim_on+2*stim_dur+delay] = -1
- labs.append(-1)
- if np.prod(labs) == 1:
- label = 'same'
- else:
- label = 'diff'
- return u, label
- def generate_input_stim_mante(settings):
- """
- Method to generate the input stimulus matrix for the
- mante task
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- taus: time-constants (in steps)
- DeltaT: sampling rate
- OUTPUT
- u: 4xT stimulus matrix (first 2 rows for motion/color and the second
- 2 rows for context
- label: either +1 or -1
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- # Color/motion sensory inputs
- u = np.zeros((2, T))
- u_lab = np.zeros((2, 1))
- if np.random.rand() <= 0.50:
- u[0, stim_on:stim_on+stim_dur] = np.random.randn(1, stim_dur) + 0.5
- u_lab[0, 0] = 1
- else:
- u[0, stim_on:stim_on+stim_dur] = np.random.randn(1, stim_dur) - 0.5
- u_lab[0, 0] = -1
- if np.random.rand() <= 0.50:
- u[1, stim_on:stim_on+stim_dur] = np.random.randn(1, stim_dur) + 0.5
- u_lab[1, 0] = 1
- else:
- u[1, stim_on:stim_on+stim_dur] = np.random.randn(1, stim_dur) - 0.5
- u_lab[1, 0] = -1
- # Context input
- c = np.zeros((2, T))
- label = 0
- if np.random.rand() <= 0.50:
- c[0, :] = 1
- if u_lab[0, 0] == 1:
- label = 1
- elif u_lab[0, 0] == -1:
- label = -1
- else:
- c[1, :] = 1
- if u_lab[1, 0] == 1:
- label = 1
- elif u_lab[1, 0] == -1:
- label = -1
- return np.vstack((u, c)), label
- '''
- Task-specific target signals
- '''
- def generate_target_continuous_go_nogo(settings, label):
- """
- Method to generate a continuous target signal (z)
- for the Go-NoGo task
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- taus: time-constants (in steps)
- DeltaT: sampling rate
- label: either +1 or -1
- OUTPUT
- z: 1xT target signal
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- z = np.zeros((1, T))
- if label == 1:
- z[0, stim_on+stim_dur:] = 1
- elif label == 0:
- z[0, stim_on+stim_dur:] = -1
- return np.squeeze(z)
- def generate_target_continuous_xor(settings, label):
- """
- Method to generate a continuous target signal (z)
- for the XOR task
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- delay: delay b/w two stimuli (in steps)
- taus: time-constants (in steps)
- DeltaT: sampling rate
- label: string value (either 'same' or 'diff')
- OUTPUT
- z: 1xT target signal
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- delay = settings['delay']
- task_end_T = stim_on+2*stim_dur + delay
- z = np.zeros((1, T))
- if label == 'same':
- z[0, 10+task_end_T:10+task_end_T+100] = 1
- elif label == 'diff':
- z[0, 10+task_end_T:10+task_end_T+100] = -1
- return np.squeeze(z)
- def generate_target_continuous_mante(settings, label):
- """
- Method to generate a continuous target signal (z)
- for the MANTE task
- INPUT
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- taus: time-constants (in steps)
- DeltaT: sampling rate
- label: either +1 or -1
- OUTPUT
- z: 1xT target signal
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- z = np.zeros((1, T))
- if label == 1:
- z[0, stim_on+stim_dur:] = 1
- else:
- z[0, stim_on+stim_dur:] = -1
- return np.squeeze(z)
- '''
- CONSTRUCT TF GRAPH FOR TRAINING
- '''
- def construct_tf(fr_rnn, settings, training_params):
- """
- Method to construct a TF graph and return nodes with
- Dale's principle
- INPUT
- fr_rnn: firing-rate RNN class
- settings: dict containing the following keys
- T: duration of a single trial (in steps)
- stim_on: stimulus starting time (in steps)
- stim_dur: stimulus duration (in steps)
- delay: delay b/w two stimuli (in steps)
- taus: time-constants (in steps)
- DeltaT: sampling rate
- training_params: dictionary containing training parameters
- learning_rate: learning rate
- OUTPUT
- TF graph
- """
- # Task params
- T = settings['T']
- taus = settings['taus']
- DeltaT = settings['DeltaT']
- task = settings['task']
- # Training params
- learning_rate = training_params['learning_rate']
- # Excitatory units
- exc_idx_tf = tf.constant(np.where(fr_rnn.exc == True)[0], name='exc_idx')
- # Inhibitory units
- inh_idx_tf = tf.constant(np.where(fr_rnn.inh == True)[0], name='inh_idx')
- som_inh_idx_tf = tf.constant(fr_rnn.som_inh, name='som_inh_idx')
- # Input node
- # XOR task
- if task == 'xor':
- stim = tf.placeholder(tf.float32, [2, T], name='u')
- # Sensory integration task
- elif task == 'mante':
- stim = tf.placeholder(tf.float32, [4, T], name='u')
- # Go-NoGo task
- elif task == 'go-nogo':
- stim = tf.placeholder(tf.float32, [1, T], name='u')
- elif task == 'go-nogo2':
- stim = tf.placeholder(tf.float32, [2, T], name='u')
- # Target node
- z = tf.placeholder(tf.float32, [T,], name='target')
- # Initialize the decay synaptic time-constants (gaussian random).
- # This vector will go through the sigmoid transfer function.
- if len(taus) > 1:
- taus_gaus = tf.Variable(tf.random_normal([fr_rnn.N, 1]), dtype=tf.float32,
- name='taus_gaus', trainable=True)
- elif len(taus) == 1:
- taus_gaus = tf.Variable(tf.random_normal([fr_rnn.N, 1]), dtype=tf.float32,
- name='taus_gaus', trainable=False)
- print('Synaptic decay time-constants will not get updated!')
- # Synaptic currents and firing-rates
- x = [] # synaptic currents
- r = [] # firing-rates
- x.append(tf.random_normal([fr_rnn.N, 1], dtype=tf.float32)/100)
- # Transfer function options
- if training_params['activation'] == 'sigmoid':
- r.append(tf.sigmoid(x[0]))
- elif training_params['activation'] == 'clipped_relu':
- r.append(tf.clip_by_value(tf.nn.relu(x[0]), 0, 20))
- elif training_params['activation'] == 'softplus':
- r.append(tf.clip_by_value(tf.nn.softplus(x[0]), 0, 20))
- # Initialize recurrent weight matrix, mask, input & output weight matrices
- w = tf.get_variable('w', initializer = fr_rnn.W, dtype=tf.float32, trainable=True)
- m = tf.get_variable('m', initializer = fr_rnn.mask, dtype=tf.float32, trainable=False)
- som_m = tf.get_variable('som_m', initializer = fr_rnn.som_mask, dtype=tf.float32,
- trainable=False)
- w_in = tf.get_variable('w_in', initializer = fr_rnn.w_in, dtype=tf.float32, trainable=False)
- w_out = tf.get_variable('w_out', initializer = fr_rnn.w_out, dtype=tf.float32,
- trainable=True)
- b_out = tf.Variable(0, dtype=tf.float32, name='b_out', trainable=True)
- # Forward pass
- o = [] # output (i.e. weighted linear sum of rates, r)
- for t in range(1, T):
- if fr_rnn.apply_dale == True:
- # Parametrize the weight matrix to enforce exc/inh synaptic currents
- w = tf.nn.relu(w)
- # next_x is [N x 1]
- ww = tf.matmul(w, m)
- ww = tf.multiply(ww, som_m)
- # Pass the synaptic time constants thru the sigmoid function
- if len(taus) > 1:
- taus_sig = tf.sigmoid(taus_gaus)*(taus[1] - taus[0]) + taus[0]
- elif len(taus) == 1: # one scalar synaptic decay time-constant
- taus_sig = taus[0]
- next_x = tf.multiply((1 - DeltaT/taus_sig), x[t-1]) + \
- tf.multiply((DeltaT/taus_sig), ((tf.matmul(ww, r[t-1]))\
- + tf.matmul(w_in, tf.expand_dims(stim[:, t-1], 1)))) +\
- tf.random_normal([fr_rnn.N, 1], dtype=tf.float32)/10
- x.append(next_x)
- if training_params['activation'] == 'sigmoid':
- r.append(tf.sigmoid(next_x))
- elif training_params['activation'] == 'clipped_relu':
- r.append(tf.clip_by_value(tf.nn.relu(next_x), 0, 20))
- elif training_params['activation'] == 'softplus':
- r.append(tf.clip_by_value(tf.nn.softplus(next_x), 0, 20))
- next_o = tf.matmul(w_out, r[t]) + b_out
- o.append(next_o)
- return stim, z, x, r, o, w, w_in, m, som_m, w_out, b_out, taus_gaus
- '''
- DEFINE LOSS AND OPTIMIZER
- '''
- def loss_op(o, z, training_params):
- """
- Method to define loss and optimizer for ONLY ONE target signal
- INPUT
- o: list of output values
- z: target values
- training_params: dictionary containing training parameters
- learning_rate: learning rate
- OUTPUT
- loss: loss function
- training_op: optimizer
- """
- # Loss function
- loss = tf.zeros(1)
- loss_fn = training_params['loss_fn']
- for i in range(0, len(o)):
- if loss_fn.lower() == 'l1':
- loss += tf.norm(o[i] - z[i])
- elif loss_fn.lower() == 'l2':
- loss += tf.square(o[i] - z[i])
- if loss_fn.lower() == 'l2':
- loss = tf.sqrt(loss)
- # Optimizer function
- with tf.name_scope('ADAM'):
- optimizer = tf.train.AdamOptimizer(learning_rate = training_params['learning_rate'])
- training_op = optimizer.minimize(loss)
- return loss, training_op
- '''
- EVALUATE THE TRAINED MODEL
- NOTE: NEED TO BE UPDATED!!
- '''
- def eval_tf(model_dir, settings, u):
- """
- Method to evaluate a trained TF graph
- INPUT
- model_dir: full path to the saved model .mat file
- stim_params: dictionary containig the following keys
- u: 12xT stimulus matrix
- NOTE: There are 12 rows (one per dot pattern): 6 cues and 6 probes.
- OUTPUT
- o: 1xT output vector
- """
- T = settings['T']
- stim_on = settings['stim_on']
- stim_dur = settings['stim_dur']
- delay = settings['delay']
- DeltaT = settings['DeltaT']
- # Load the trained mat file
- var = scipy.io.loadmat(model_dir)
- # Get some additional params
- N = var['N'][0][0]
- exc_ind = [np.bool(i) for i in var['exc']]
- # Get the delays
- taus_gaus = var['taus_gaus']
- taus = var['taus'][0] # tau [min, max]
- taus_sig = (1/(1+np.exp(-taus_gaus))*(taus[1] - taus[0])) + taus[0]
- # Synaptic currents and firing-rates
- x = np.zeros((N, T)) # synaptic currents
- r = np.zeros((N, T)) # firing-rates
- x[:, 0] = np.random.randn(N, )/100
- r[:, 0] = 1/(1 + np.exp(-x[:, 0]))
- # r[:, 0] = np.minimum(np.maximum(x[:, 0], 0), 1) #clipped relu
- # r[:, 0] = np.clip(np.minimum(np.maximum(x[:, 0], 0), 1), None, 10) #clipped relu
- # r[:, 0] = np.clip(np.log(np.exp(x[:, 0])+1), None, 10) # softplus
- # r[:, 0] = np.minimum(np.maximum(x[:, 0], 0), 6)/6 #clipped relu6
- # Output
- o = np.zeros((T, ))
- o_counter = 0
- # Recurrent weights and masks
- # w = var['w0'] #!!!!!!!!!!!!
- w = var['w']
- m = var['m']
- som_m = var['som_m']
- som_N = var['som_N'][0][0]
- # Identify excitatory/inhibitory neurons
- exc = var['exc']
- exc_ind = np.where(exc == 1)[0]
- inh = var['inh']
- inh_ind = np.where(inh == 1)[0]
- som_inh_ind = inh_ind[:som_N]
- for t in range(1, T):
- # next_x is [N x 1]
- ww = np.matmul(w, m)
- ww = np.multiply(ww, som_m)
- # next_x = (1 - DeltaT/tau)*x[:, t-1] + \
- # (DeltaT/tau)*(np.matmul(ww, r[:, t-1]) + \
- # np.matmul(var['w_in'], u[:, t-1])) + \
- # np.random.randn(N, )/10
- next_x = np.multiply((1 - DeltaT/taus_sig), np.expand_dims(x[:, t-1], 1)) + \
- np.multiply((DeltaT/taus_sig), ((np.matmul(ww, np.expand_dims(r[:, t-1], 1)))\
- + np.matmul(var['w_in'], np.expand_dims(u[:, t-1], 1)))) +\
- np.random.randn(N, 1)/10
- x[:, t] = np.squeeze(next_x)
- r[:, t] = 1/(1 + np.exp(-x[:, t]))
- # r[:, t] = np.minimum(np.maximum(x[:, t], 0), 1)
- # r[:, t] = np.clip(np.minimum(np.maximum(x[:, t], 0), 1), None, 10)
- # r[:, t] = np.clip(np.log(np.exp(x[:, t])+1), None, 10) # softplus
- # r[:, t] = np.minimum(np.maximum(x[:, t], 0), 6)/6
- wout = var['w_out']
- wout_exc = wout[0, exc_ind]
- wout_inh = wout[0, inh_ind]
- r_exc = r[exc_ind, :]
- r_inh = r[inh_ind, :]
- o[o_counter] = np.matmul(wout, r[:, t]) + var['b_out']
- # o[o_counter] = np.matmul(wout_exc, r[exc_ind, t]) + var['b_out'] # excitatory output
- # o[o_counter] = np.matmul(wout_inh, r[inh_ind, t]) + var['b_out'] # inhibitory output
- o_counter += 1
- return x, r, o
model.py at commit c8937f9, under Apache-2.0 · at the source
Overview
and 6 other authors
Atul Maheshwari11, Sarah R. Heilbronner1,5,10, Robert Kim12, Nuttida Rungratsameetaweemana13, Benjamin Y. Hayden1,5,8,10, Sameer A. Sheth1,5,8,10,14,1515 affiliations
- Department of Neurosurgery, Baylor College of Medicine,Houston, TX USA
- Department of Neurology, Massachusetts General Hospital, Harvard Medical School,Boston, MA USA
- HUN-REN Research Centre for Natural Sciences, Budapest, Hungary PPCU Faculty of Information Technology and Bionics,Budapest, Hungary
- Center for Neurotechnology and Neurorecovery, Department of Neurology, Mass General Brigham,Boston, MA USA
- Department of Neuroscience, Baylor College of Medicine,Houston, TX USA
- Department of Neurosurgery, Massachusetts General Hospital, Harvard Medical School,Boston, MA USA
- Department of Integrative Physiology, Baylor College of Medicine,Houston, TX USA
- Department of Electrical & Computer Engineering, Rice University,Houston, TX USA
- Department of Bioengineering, Rice University,Houston, TX USA
- Neuroengineering Initiative, Rice University,Houston, TX USA
- Department of Neurology, Baylor College of Medicine,Houston, TX USA
- Department of Neurology, Cedars-Sinai Medical Center,Los Angeles, CA USA
- Department of Biomedical Engineering, Columbia University,New York, NY USA
- Department of Psychiatry and Behavioral Sciences, Baylor College of Medicine,Houston, TX USA
- Cain Laboratories, Duncan Neurological Research Institute, Texas Children’s Hospital,Houston, TX USA
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repositories
Its files are read in the Code ↔ Paper reader above, with 9 matches between paragraphs and lines of code.
evarol/DREDge
ed236113a0b6c29b376065440174da6341a1d875, 21 March 2026Availability: 2 checks, the latest on 30 October 2026: the link answers
- 30 October 2026: the link answers
- 28 September 2026: the link answers
34 files
- matlab/
CXCORR.m , MATLAB, 20 lines - matlab/
CXMI.m , MATLAB, 19 lines - matlab/
XMI.m , MATLAB, 8 lines - matlab/
dftregistration.m , MATLAB, 207 lines - matlab/
dredge.m , MATLAB, 93 lines, 1 match - matlab/
dredge_corr.m , MATLAB, 113 lines - matlab/
dredge_mi.m , MATLAB, 111 lines - matlab/
dredge_unsigned.m , MATLAB, 76 lines - matlab/
fastShift.m , MATLAB, 8 lines - matlab/
gauss_mi.m , MATLAB, 10 lines - matlab/
main.m , MATLAB, 60 lines - matlab/
mat_CXC.m , MATLAB, 23 lines - matlab/
mat_CXMI.m , MATLAB, 20 lines - matlab/
mat_FFTXC.m , MATLAB, 9 lines - matlab/
mat_XC.m , MATLAB, 10 lines - matlab/
mat_XMI.m , MATLAB, 10 lines - matlab/
mat_corr.m , MATLAB, 11 lines - matlab/
mat_gauss_mi.m , MATLAB, 16 lines - matlab/
myXCORR.m , MATLAB, 5 lines - matlab/
mycircshift.m , MATLAB, 12 lines - matlab/
nanzscore.m , MATLAB, 5 lines - matlab/
psolver.m , MATLAB, 36 lines - matlab/
psolver_TF.m , MATLAB, 37 lines - notebook/
ap_chronic_demo.ipynb , Jupyter, 197 lines, 1 match - notebook/
ap_registration.ipynb , Jupyter, 173 lines - notebook/
introductory_demo.ipynb , Jupyter, 134 lines - notebook/
lfp_registration_and_int , Jupyter, 340 lines, 1 matcherpolation_demo.ipynb - src/
dredge/ , Python, 7 lines__init__.py - src/
dredge/ , Python, 225 linesdredge_ap.py - src/
dredge/ , Python, 221 linesdredge_lfp.py - src/
dredge/ , Python, 795 linesdredgelib.py - src/
dredge/ , Python, 1,153 linesmotion_util.py - LICENSE, License, 21 lines
- README.md, Text, 149 lines
NuttidaLab/rnn_oddball
c8937f93abb5c4dc14b747ae3b5b95028b07fc65, 10 February 2026Availability: 1 check, the latest on 28 September 2026: the link answers
- 28 September 2026: the link answers
23 files
- code/
rate/ , MATLAB, 3 linesVangle.m - code/
rate/ , MATLAB, 202 linesanalyze_models.m - code/
rate/ , MATLAB, 82 linescompare_models.m - code/
rate/ , MATLAB, 66 lineseval_model.m - code/
rate/ , MATLAB, 39 lineseval_model_gng2.m - code/
rate/ , MATLAB, 91 lines, 2 matchesfnc_eval_model.m - code/
rate/ , MATLAB, 188 linesfnc_generate_trials.m - code/
rate/ , Shell, 16 linesgo-nogo.sh - code/
rate/ , Shell, 16 linesgo-nogo2.sh - code/
rate/ , MATLAB, 43 lineslesion_analysis.m - code/
rate/ , Python, 396 linesmain.py - code/
rate/ , Python, 511 linesmain_sequential.py - code/
rate/ , Python, 508 linesmain_sequential_only_two _stages.py - code/
rate/ , Python, 701 lines, 3 matchesmodel.py - code/
rate/ , MATLAB, 154 linesmodel_distance.m - code/
rate/ , MATLAB, 129 linesmodel_glm.m - code/
rate/ , MATLAB, 44 linesplot_example_responses.m - code/
rate/ , MATLAB, 172 linesspecificity.m - code/
rate/ , MATLAB, 383 lines, 1 matchsvm_decoding_per_neuron. m - code/
rate/ , MATLAB, 172 linessvm_decoding_using_all.m - code/
rate/ , Python, 65 linesutils.py - LICENSE, License, 201 lines
- README.md, Text, 44 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: NuttidaLab/
rnn_oddball
Read it in the paper: doi.org/10.1038/s41586-026-10448-0.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 2 repositories of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 53 scripts, each with its path and the digest of its content;
- 9 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability statement
The paper has a data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- no repository, dataset or request procedure was recognized in it
Read it in the paper: doi.org/10.1038/s41586-026-10448-0.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Publisher: n/a → Nature Portfolio
Version 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 26 authors, 5 keywords, 17 MeSH terms, 1 funder, 62 references, 2 integrity notices.
Cite
This paper
Katlowitz, K. A., Cole, E. R., Mickiewicz, E. A., Shah, S., Franch, M., Adkinson, J. A., Belanger, J. L., Mathura, R. K., Meszéna, D., McGinley, M., Muñoz, W., Banks, G. P., Cash, S. S., Hsu, C.-W., Paulk, A. C., Provenza, N. R., Watrous, A. J., Williams, Z., Goldman, A. M., . . . Sheth, S. A. (2026). Plasticity and language in the anaesthetized human hippocampus. Nature, 654(8119), 714-723. https://
BibTeX
@article{katlowitz2026pl
author = {Katlowitz, Kalman A. and Cole, Eric R. and Mickiewicz, Elizabeth A. and Shah, Shraddha and Franch, Melissa and Adkinson, Joshua A. and Belanger, James L. and Mathura, Raissa K. and Meszéna, Domokos and McGinley, Matthew and Muñoz, William and Banks, Garrett P. and Cash, Sydney S. and Hsu, Chih-Wei and Paulk, Angelique C. and Provenza, Nicole R. and Watrous, Andrew J. and Williams, Ziv and Goldman, Alica M. and Krishnan, Vaishnav and Maheshwari, Atul and Heilbronner, Sarah R. and Kim, Robert and Rungratsameetaweemana, Nuttida and Hayden, Benjamin Y. and Sheth, Sameer A.},
title = {{Plasticity and language in the anaesthetized human hippocampus}},
journal = {Nature},
year = {2026},
month = may,
volume = {654},
number = {8119},
pages = {714--723},
publisher = {Nature Portfolio},
issn = {0028-0836},
doi = {10.1038/
url = {https://
pmid = {42092132},
pmcid = {PMC13275293}
}
RIS
TY - JOUR
AU - Katlowitz, Kalman A.
AU - Cole, Eric R.
AU - Mickiewicz, Elizabeth A.
AU - Shah, Shraddha
AU - Franch, Melissa
AU - Adkinson, Joshua A.
AU - Belanger, James L.
AU - Mathura, Raissa K.
AU - Meszéna, Domokos
AU - McGinley, Matthew
AU - Muñoz, William
AU - Banks, Garrett P.
AU - Cash, Sydney S.
AU - Hsu, Chih-Wei
AU - Paulk, Angelique C.
AU - Provenza, Nicole R.
AU - Watrous, Andrew J.
AU - Williams, Ziv
AU - Goldman, Alica M.
AU - Krishnan, Vaishnav
AU - Maheshwari, Atul
AU - Heilbronner, Sarah R.
AU - Kim, Robert
AU - Rungratsameetaweemana, Nuttida
AU - Hayden, Benjamin Y.
AU - Sheth, Sameer A.
TI - Plasticity and language in the anaesthetized human hippocampus
T2 - Nature
J2 - Nature
PY - 2026
DA - 2026/
VL - 654
IS - 8119
SP - 714
EP - 723
SN - 0028-0836
PB - Nature Portfolio
DO - 10.1038/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1038/
"type": "article-journal",
"title": "Plasticity and language in the anaesthetized human hippocampus",
"container-title": "Nature",
"author": [
{
"family": "Katlowitz",
"given": "Kalman A."
},
{
"family": "Cole",
"given": "Eric R."
},
{
"family": "Mickiewicz",
"given": "Elizabeth A."
},
{
"family": "Shah",
"given": "Shraddha"
},
{
"family": "Franch",
"given": "Melissa"
},
{
"family": "Adkinson",
"given": "Joshua A."
},
{
"family": "Belanger",
"given": "James L."
},
{
"family": "Mathura",
"given": "Raissa K."
},
{
"family": "Meszéna",
"given": "Domokos"
},
{
"family": "McGinley",
"given": "Matthew"
},
{
"family": "Muñoz",
"given": "William"
},
{
"family": "Banks",
"given": "Garrett P."
},
{
"family": "Cash",
"given": "Sydney S."
},
{
"family": "Hsu",
"given": "Chih-Wei"
},
{
"family": "Paulk",
"given": "Angelique C."
},
{
"family": "Provenza",
"given": "Nicole R."
},
{
"family": "Watrous",
"given": "Andrew J."
},
{
"family": "Williams",
"given": "Ziv"
},
{
"family": "Goldman",
"given": "Alica M."
},
{
"family": "Krishnan",
"given": "Vaishnav"
},
{
"family": "Maheshwari",
"given": "Atul"
},
{
"family": "Heilbronner",
"given": "Sarah R."
},
{
"family": "Kim",
"given": "Robert"
},
{
"family": "Rungratsameetaweemana",
"given": "Nuttida"
},
{
"family": "Hayden",
"given": "Benjamin Y."
},
{
"family": "Sheth",
"given": "Sameer A."
}
],
"container-title-short":
"volume": "654",
"issue": "8119",
"page": "714-723",
"DOI": "10.1038/
"PMID": "42092132",
"PMCID": "PMC13275293",
"ISSN": "0028-0836",
"publisher": "Nature Portfolio",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
5,
6
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1038/s41586-023-06982-w [code]
- Single-neuronal elements of speech production in humans.Journal: NatureIn common: SpikeInterface, Parallel Computing Toolbox, Signal Processing Toolbox, 6 other tools, extracellular electrophysiology (units, LFP), cognitive, 2 references, 5 authors
- [2] doi:10.1038/s41586-024-07643-2 [code]
- Semantic encoding during language comprehension at single-cell resolution.Journal: NatureIn common: SpikeInterface, Parallel Computing Toolbox, Signal Processing Toolbox, 6 other tools, cognitive, 3 references, 4 authors
- [3] doi:10.1038/s41378-025-01115-x [code]
- Optimal inter-electrode distances for maximizing single unit yield per electrode in neural recordings.Journal: Microsystems & nanoengineeringIn common: SciPy, Matplotlib, NumPy, extracellular electrophysiology (units, LFP), 5 references, 2 authors
- [4] doi:10.1038/s41467-025-58620-w [code]
- Natural language processing models reveal neural dynamics of human conversation.Journal: Nature communicationsIn common: SciPy, Matplotlib, NumPy, cognitive, 1 reference, 3 authors
- [5] doi:10.1038/s41467-023-43727-9 [code]
- Flexible, scalable, high channel count stereo-electrode for recording in the human brain.Journal: Nature communicationsIn common: Statistics and Machine Learning Toolbox, Matplotlib, NumPy, 1 reference, 3 authors
- [6] doi:10.1038/s41467-024-51443-1 [code]
- Theta-burst direct electrical stimulation remodels human brain networks.Journal: Nature communicationsIn common: Signal Processing Toolbox, Statistics and Machine Learning Toolbox, extracellular electrophysiology (units, LFP), 3 authors
- [7] doi:10.1038/s41586-026-10691-5 [code]
- Mapping the neuronal building blocks of human language with language models.Journal: NatureIn common: SciPy, Matplotlib, NumPy, cognitive, 3 references, 2 authors
- [8] doi:10.1016/j.neuroimage.2025.121507
- Neural signatures and personalized neuromodulation in a subject experiencing context-dependent inhibitory control deficits.Journal: NeuroImageIn common: cognitive, 3 authors
- [9] doi:10.1038/s41467-023-37463-3 [code]
- Characterizing brain dynamics during ketamine-induced dissociation and subsequent interactions with propofol using human intracranial neurophysiology.Journal: Nature communicationsIn common: 3 authors
- [10] doi:10.1016/j.patter.2026.101590 [code]
- Density-based longitudinal neuron tracking in high-density electrophysiological recordings.Journal: Patterns (New York, N.Y.)In common: SpikeInterface, Parallel Computing Toolbox, Signal Processing Toolbox, 5 other tools, extracellular electrophysiology (units, LFP), 3 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 2 repositories of the authors' code, each at its verified commit and with its license, 53 scripts, and 9 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:4c1ff725c5c99b55…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1038/s41586-026-10448-0)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1038/s41586-026-10448-0.svg
:target: https://openscicode.org/badge/doi/10.1038/s41586-026-10448-0
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1038/s41586-026-10448-0"><img src="https://openscicode.org/badge/doi/10.1038/s41586-026-10448-0.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
