Skip to content

Instantly share code, notes, and snippets.

View tjbanks's full-sized avatar

Tyler Banks tjbanks

View GitHub Profile
@tjbanks
tjbanks / recurrent.py
Created March 11, 2019 02:44
Creating Recurrent Connections in BMTK
###########################################################
# Build connections
###########################################################
#Connect CA3o->CA3e Inhibitory
dynamics_file = 'CA3o2CA3e.inh.json'
conn = net.add_edges(source={'pop_name': 'CA3o'}, target={'pop_name': 'CA3e'},
connection_rule=hipp_dist_connector,
connection_params={'con_pattern':syn[dynamics_file]['con_pattern']},
syn_weight=5.0e-03,
dynamics_params=dynamics_file,
@tjbanks
tjbanks / line_product_scaling.py
Last active November 15, 2021 17:16
Scalings of Matricies Satisfying Line-Product Constraints (Python)
# Python implementation of algorithms described in
# "Scalings of Matrices Satisfying Line-Product Constraints and Generalizations" (1992)
# Paper by Uriel G. Rothblum, code by @tjbanks and Tung Nguyen
# https://core.ac.uk/download/pdf/82705928.pdf
# Implement 2D matrix completion with input as U,V, A_prime and output as A_exp
import numpy as np
def completion(U = None,V = None,A_prime = None):
# Situate unknown entries as 1.