sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
2b9ee19ef50b9e674e3fde0d66711a9c0de43d0224ec2c4100f2c1acf44f0fe8 | Jupyter | 3,793 | 67 | # %% [markdown]
# # Load libraries and data for Figure 2
# %%
from library import *
area_dict, active_area_dict = load_area_dicts(session_ids)
path = './files/adjacency_matrices'
G_ccg_dict, offset_dict, duration_dict = load_graphs(path, active_area_dict, weight=True)
measure = 'ccg'
n = 4
S_ccg_dict = add_sign(G_ccg... |
18ccc35fe15c790741b17bb1c089f98bcbff09d967de947fb0dbf003d40c2c62 | Jupyter | 3,802 | 204 | # %%
import spyx
import spyx.nn as snn
import jax
import jax.numpy as jnp
import numpy as np
import nir
# for loading dataset
import torch
import matplotlib.pyplot as plt
# %%
ng = nir.read("braille_noDelay_noBias_subtract_subgraph.nir")
# %%
data = torch.load("ds_test.pt")
# %%
x, y = data.tensors
# %%
x = jnp.... |
d434201ab0554224b59ad9baacbc3f91af001d025c4594b4f4d241fdc90355ea | Jupyter | 3,803 | 99 | # %% [markdown]
# ## Estimating noise and stabilizing variance in calcium imaging data
#
# The purpose of this notebook is to show how to use the VST transform for estimating the noise profile of calcium imaging data and apply a generalized Anscombe transform that aims to transform the noise into white Gaussian.
# %%... |
7b25d27672168ae9c5982868df4bacac6954db8272433a13527e4a71d5e06935 | Jupyter | 3,805 | 106 | # %% [markdown]
# # hxtorch
#
# [hxtorch](https://github.com/electronicvisions/hxtorch) hxtorch is a deep learning Python library used for numerical simulation, neuromorphic emulation and training of spiking neural networks (SNNs). Built on top of PyTorch, it integrates the automatic differentiation and modular design... |
9522d63908e862b78f3b7d0581f5445fa30d225e0738a35ac4502107b0e645ed | Jupyter | 3,806 | 97 | # %%
#standard
import os
import warnings
warnings.filterwarnings('ignore')
import pickle
#third party
import numpy as np
import hcp_utils as hcp
from nilearn import plotting
import matplotlib.pyplot as plt
# %%
def calculate_noiseceiling(betas, n: int=1):
"""
Calculate the standard deviation across trials, sq... |
e074cf5e14334bdb0e76c2e2f25e0dc92029a029e027e1fa6745e28b467822ff | Jupyter | 3,816 | 102 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
f9a81171c921098c7895b328ab1b30c91fc0ff6f6ffc20307ef01ef161b6ba37 | Jupyter | 3,821 | 160 | # %%
import os
path_work = "/media/concha-eloko/Linux/papers/Deposcope/trainingdata_phagedpo"
dataset = f"{path_work}/Phage_dpo.training_data.fasta"
command = f"cd-hit -i {dataset} -o {path_work}/filtered_phagedpo.fasta -c 0.95 -G 0 -aL 0.8"
print(command)
# %%
from Bio import SeqIO
pdpo_seq = SeqIO.parse(dataset,... |
2d2e295d618ad76626a68538e89eba2b017329f7f91a7db76df9644be611af2b | Jupyter | 3,830 | 134 | # %%
# Boilerplate imports
import numpy as np
import torch
from torch.utils.data import DataLoader
from tqdm.autonotebook import trange
import time
seed = 42
np.random.seed(seed)
torch.manual_seed(seed)
torch.manual_seed(seed)
torch.use_deterministic_algorithms(True)
import matplotlib.pyplot as plt
# %%
# Load NI... |
49db199378d5217e71a40d6a30965fdb3758c5204b2040a90d9c9d52c7d854cd | Jupyter | 3,833 | 132 | # %% [markdown]
# # Analyze the data to evaluate the relative performance of different gene weighting methods
#
# Metrics:
# 1. Number of discoveries
# 2. Evaluate on contrast between silver standards
# %%
%load_ext lab_black
import pandas as pd
import itertools
import numpy as np
from statsmodels.stats.multitest im... |
940d986bbdea2dfeb0e36260d1c0e87cc9bed4ebeb82751f0bb674c89aaa7272 | Jupyter | 3,835 | 142 | # %%
import pandas as pd
import numpy as np
import os
import re
from icecream import ic
from collections import defaultdict
# %%
import warnings
warnings.filterwarnings("ignore")
# %%
import toml
x = toml.load('/home/skowshik/ADRD_repo/pipeline_v1_main/adrd_tool/dev/data/toml_files/default_conf_new.toml')
y = toml.lo... |
2c0788a5d0d283a312e6e4565d6a42c976c8c755c252f00e0695027da5c9bcf9 | Jupyter | 3,851 | 194 | # %%
%load_ext autoreload
%autoreload 2
# %%
import sys
sys.path.insert(0, '../scripts')
from simulation import *
# %%
N = 80000
p = 0.005
K = N*p
P = 16
tau = 0.01
dt = 1e-3
A = 2
theta = 0
sigma = 0.1
# %%
patterns = np.random.RandomState(seed=1).normal(0,1,size=(P,N))
# %%
# Structural connectivity
k = np.random... |
d06c433fa57f7e96e82e9066c474319efd9c94c277d3a71d4b5c11d01b743b60 | Jupyter | 3,859 | 114 | # %%
# Python Notebook
# Script to average fast scan STEM image series recorded
# by TIA preview scans
#
# J. Barthel, Forschungszentrum Juelich GmbH (ER-C 2), Germany
# ju.barthel@fz-juelich.de
#
# 1) load the image series using serReader
# 2) define a ROI for drift measurement
# 3) measure image to image shifts w... |
1b4397692121f56147699ee8cae3c15dbdb2ab73b8bf5b66c0a57bc05b5e590b | Jupyter | 3,875 | 186 | # %%
import pysolr
import time
# %% [markdown]
# # Drug loading in Solr
# %%
solr = pysolr.Solr('http://localhost:8983/solr/drugs', timeout=10)
print(solr.ping())
# %%
with open('data/Chemical/drugs.json', 'r') as fout:
drugs = json.loads(fout.read())
print(len(drugs))
# %%
solr.add(drugs[0:50000])
print(so... |
e973e25a3291e2180d031a02ffc0d167947ae6a38adb2659c3b69f807fa4c7fd | Jupyter | 3,876 | 115 | # %%
from nir.read import read
from nir.ir import LIF
import nir
graph = read('lif_norse.nir')
for nkey, node in graph.nodes.items():
print(f"{nkey:7} {node}")
# %%
import nengo
import numpy as np
def nir_to_nengo(n):
nengo_map = {}
model = nengo.Network()
with model:
filters = {}
f... |
debb069b365bc2476f6b95c73b20abb969dd02d823c7ffd5a4097c53955ac994 | Jupyter | 3,881 | 113 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): MVM using noise models characterized on the IBM HERMES Project Chip
#
# Le Gallo, M., Khaddam-Aljameh, R., Stanisavljevic, M. et al. A 64-core mixed-signal in-memory compute chip based on phase-change memory for deep neural network inference. Nat Elec... |
b276ad9f3496a73a74bfca95f044c736338371369fb382b1219341e5be361fa1 | Jupyter | 3,891 | 159 | # %%
%load_ext autoreload
%autoreload 2
# %%
import glob
import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
import os.path
import skimage
import skimage.color
import skimage.transform
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import shutil
... |
3c99410f94c967056cf629ad99fa019d20095ee0cf10b9e40c4952737d952c7b | Jupyter | 3,896 | 115 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
f04dc5f4658d2cab7add808fab70d5f7bef87a38524100a97b8a24521ea6ea93 | Jupyter | 3,918 | 116 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
9cf883bfde6511c908c59ed15521a6ee35cf30d754d398fe714080b99f49120e | Jupyter | 3,930 | 107 | # %% [markdown]
# # Nengo
#
# [Nengo](nengo.ai) is a Python package for building, testing, and deploying neural networks.
# The examples below shows how to import and export from Nengo to NIR and vice-versa.
#
# Examples:
# * Lorentz oscillator: [nir-lorentz.py](https://github.com/neuromorphs/nir/tree/main/example/ne... |
ce6c6a2155e7069839fe759858cf2cf497a515e1b734b87335b2a9a056aca98c | Jupyter | 3,942 | 130 | # %% [markdown]
# # Generating figures for SU compound numerics
# %%
import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import binom
# %%
with open('numerics_su_deeper_k1.pkl', 'rb') as f:
res_1 = pickle.load(f)
with open('numerics_su_deeper_kn2.pkl', 'rb') as f:
res_2 = ... |
5077e95de0bb0419e62e7d9f40f3b89fb776f4931525bb4f39adcd43a2e474cd | Jupyter | 3,946 | 92 | # %% [markdown]
# Here, we show how to apply FlowSig to a spatial Stereo-seq dataset of an E9.5 mouse embryo, as originally studied in [Chen et al. (2022)](https://doi.org/10.1016/j.cell.2022.04.003).
# The processed data and cell-cell communication inference, which was obtained using [COMMOT](https://commot.readthedoc... |
0ae804397817d2c0373c2fda76f4adbe9998e29891f8244ec30aea5114f6ef45 | Jupyter | 3,952 | 131 | # %%
import numpy as np
import pandas as pd
import os
import math
from scipy import stats
from sklearn.metrics import cohen_kappa_score
pd.set_option('display.max_rows', 500)
# %%
# # Results on the first 8 methods
# results = pd.read_csv('mturk/sc09-unconditional-exp-confident/Batch_4656948_batch_results.csv')
# ui... |
772b790ab4c1c74f746a4e41e2409340fe10751259b57340ef6de9b8c8048139 | Jupyter | 3,971 | 146 | # %%
%load_ext autoreload
%autoreload 2
# %%
import sys
import copy
import time
import logging
import argparse
import itertools
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib import colors
from tqdm.auto import tqdm
import numpy as np
import r... |
fb4dfe62e9ec991e60059992799ef22ef1cb04352d979fe6b7003529c057275c | Jupyter | 3,987 | 96 | # %% [markdown]
# # 1st - the development of the RCPL model.
# %%
import pandas as pd
from paintone_rsn.data_loading import load_subjectiid, exclusion, load_timeseries
from paintone_rsn.data_preproc import connectivity_matrix, connectivitylabelname
import paintone_rsn.mlfunctions as myml
import pickle
# %%
import sys... |
8efae80d28a20da0cf1dc922a27b7f317a505e4a539868fc4b106dc93ceca37f | Jupyter | 3,994 | 112 | # %%
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
import seaborn as sns
import os
from os.path import join
import time
# scTRS tools
import scdrs.util as util
import scdr... |
fbb469e30ecff904933836ea5ee14e1b37abda2ac577d1dbfaed2d503bd226f4 | Jupyter | 4,009 | 112 | # %%
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
import seaborn as sns
import os
from os.path import join
import time
# scTRS tools
import scTRS.util as util
import scTR... |
220961677eca2a0521e4b7b90af3f4460b81e5351715d3c4a02290b98639226a | Jupyter | 4,010 | 116 | # %% [markdown]
# # This network demonstrates how to use LIME with recurrent neural networks.
#
# This focuses on keras-style "stateless" recurrent neural networks. These networks expect input with a shape `(n_samples, n_timesteps, n_features)` as opposed to the more normal `(n_samples, n_features)` input that most ot... |
a958f7fcf7334e916f86d69b5352aae07a389ee20856ebee761ed5c5236cfad9 | Jupyter | 4,010 | 119 | # %%
import lava.lib.dl.slayer as slayer
import matplotlib.pyplot as plt
import numpy as np
import nir
import norse
import tonic
import torch
import tqdm
import importlib
import lava_cnn_reader
importlib.reload(lava_cnn_reader);
# %%
plt.style.use(["science", "bright"])
# %%
graph = nir.read('cnn_sinabs.nir')
norse_g... |
bede445db89323be84897e6b0d21eb2841481094f059d7dfb061c09f44a523ed | Jupyter | 4,010 | 137 | # %%
import matplotlib.pyplot as plt
import nir
import numpy as np
import sys
sys.path.append("/Users/steve/Code/NIR/paper")
from nir_to_lava import ImportConfig, LavaLibrary, import_from_nir
# %% [markdown]
# Setup:
# %%
def load_data():
isis = [
6, 15, 4, 3, 0, 2, 1, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,
... |
b496fb2ad2f0d165735df80d0ef1af25f6da721cdebefa0a251f264a7b616ba7 | Jupyter | 4,027 | 121 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
124ad18791aa14ca7b7fed174f56a140582e979f58cbbb17e501610f2b269db1 | Jupyter | 4,028 | 118 | # %%
import os
import IPython
import IPython.display
import matplotlib as plt
#import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
import pandas as pd
# %%
folder=os.getcwd()+"/Data/wave_stats"
significant_wave_height=np.empty(0)
max_wave_height=np.empty(0)
wave_peak_period=np.empty(0)
water_depth... |
37371f19a1479de1217b2fa95b20c47ba3e2990d26ba6b4388db52b5e3d9bc74 | Jupyter | 4,028 | 95 | # %% [markdown]
# Here, we show how to apply FlowSig to an scRNA-seq dataset of wildtype
# and stimulated human pancreatic islets, as originally studied in [Burkhardt et al. (2021)](https://www.nature.com/articles/s41587-020-00803-5).
# %%
import scanpy as sc
import pandas as pd
import flowsig as fs
# %% [markdown]
#... |
1eafb0dc8a61842247e7976177a3d8d12372802a05c47cbf1a2619ecd6d21f5e | Jupyter | 4,030 | 124 | # %% [markdown]
# # Class-Conditional Synthesis with Latent Diffusion Models
# %% [markdown]
# Install all the requirements
# %%
#@title Installation
!git clone https://github.com/CompVis/latent-diffusion.git
!git clone https://github.com/CompVis/taming-transformers
!pip install -e ./taming-transformers
!pip install ... |
c3afcc27d4806d0cce27109e42489da5373d4e0025a6917e703d9e10f580fb52 | Jupyter | 4,032 | 113 | # %%
#import
import seaborn as sns
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
# %%
#load data
folder = '/Volumes/Elements/data_for_uploaded/'
df=pd.read_csv(folder+'FigS.11/'+'df_ongoing.csv')
# %%
#Supplementary Fig. 11 b
sns.set()
cm = 1/2.54
sns.set_style('ticks')
fsize = 7
spines... |
aa060deb4594b52c3dc691b75ce18c5b2257c091ff714990e09e06c384a5efdc | Jupyter | 4,039 | 109 | # %% [markdown]
# # Nengo
#
# [Nengo](https://nengo.ai) is a Python package for building, testing, and deploying neural networks.
# The examples below shows how to import and export from Nengo to NIR and vice-versa.
#
# Examples:
# * Lorentz oscillator: [nir-lorentz.py](https://github.com/neuromorphs/NIR/tree/main/do... |
ad3c8c8f17017a570cd2401e48e973255407060e96956b9dad9eac9eff164e64 | Jupyter | 4,047 | 106 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
6234ba3c899197539a5c1a715c08179a97e4d9c23b23cc4f7def46370d308703 | Jupyter | 4,066 | 145 | # %% [markdown]
# # Import the required packages
# %%
import os
from torch.nn import (
Flatten, LogSoftmax, MaxPool2d, Module, Tanh
)
from torchvision.datasets import FashionMNIST
from aihwkit.nn import AnalogConv2dMapped, AnalogLinearMapped, AnalogSequential
from aihwkit.simulator.presets.web import (
Web... |
cc853b8662651f15936e0508f3a68bba8b7d5cce42ffc8de46b86770319e416c | Jupyter | 4,071 | 122 | # %%
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
import seaborn as sns
import os
from os.path import join
import time
# scTRS tools
import scTRS.util as util
import scTR... |
41aacab07fe3499eac69f887cded5437ed6fb46ed252e4e757cd59bf7b850ac3 | Jupyter | 4,094 | 125 | # %%
name="GSE199460_original3000_preprocessed"
input_path = f"./data/{name}.h5ad"
# %%
%run ScCM.py \
--input_h5ad_path={input_path}
# %%
import numpy as np
import pandas as pd
import scanpy as sc
count_csv_path = f"./results/scCM/feature_scCM_{name}.csv"
count_frame = pd.read_csv(count_csv_path, index_col=None, he... |
a2b8932839ed09110decd67359a4c6f67d21af29ca8416efb2e90b04d204fb86 | Jupyter | 4,124 | 141 | # %%
%load_ext lab_black
import os, sys
%load_ext autoreload
%autoreload 2
import pandas as pd
from os.path import join
import scanpy as sc
import numpy as np
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
# %%
DATA_PATH = "/n/holystore01/LABS/price_lab/Users/mjzhang/scDRS_data... |
cd9947a81ca9839dd4daeeab78073d2462363cba2f618026bc767333465a9ff1 | Jupyter | 4,146 | 130 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
1b5a52bf7d663e305f3ee2fdb070e7492653939e375b9d47e6951bddcd86c9e9 | Jupyter | 4,152 | 136 | # %% [markdown]
# # PRS-PheWAS result
# %%
import pandas as pd
PRSPhewas_file = "MetS_noUKB_PRSPheWAS_results.MultipleCorrection.csv"
df_prsphewas = pd.read_csv(PRSPhewas_file, sep=",", index_col=False)
df_prsphewas = df_prsphewas[df_prsphewas['Bonferroni significant'] == "YES"]
print('Number of significant phenotype... |
60d92ee29166ab477a27cd659c4f31de44c21185a98d03e588b5cee664f03044 | Jupyter | 4,168 | 68 | # %% [markdown]
# # Step 2: Model Fitting
# %%
from matplotlib import pyplot as plt
import pandas as pd
from typer_config import yaml_loader
from ddw import fit_model
from ddw.utils.print import pprint_dict, print_help_for_function_arguments
# %% [markdown]
#
# ## Fitting a Model on the Tutorial Data
#
# To fit a ... |
45f93ae74d3109db9187d18cb7c21465f80b64d652f6c43d1a78e39ef5a0d1a5 | Jupyter | 4,194 | 90 | # %%
import pandas as pd
import numpy as np
# %% [markdown]
# # Simulated data result
# %%
sim_result = pd.read_csv('result_sim_X_v2.csv')
sim_result.columns
# %%
sim_result = pd.read_csv('result_sim_X_v2.csv')
sim_result['h_cover'] = np.where(np.logical_and(sim_result.h_est_upper >sim_result.true_h,
... |
0b06c1346564376f56ecc156dad8f43e34008413ef9055218694cc4afd20739e | Jupyter | 4,195 | 103 | # %% [markdown]
# # Review of Ground Truth Data
#
# ### Overview
# This notebook provides an **interactive interface** for reviewing the experimental data and ground truth labels used in the accompanying publication on the derivation of **respiratory phases during intra-arrest ventilation**.
# The dataset originates... |
4be8655f0989d18745203ea804032817bd813b4e1c0dc8fa32e45c053185c4fd | Jupyter | 4,202 | 124 | # %% [markdown]
# (tune-aim-ref)=
#
# # Using Aim with Tune
#
# <a id="try-anyscale-quickstart-tune-aim" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune-aim">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstart">
# </... |
99d65a7112aae5a736253f6cb6cf64c64a3437b6175b2f49414bb9a599286f96 | Jupyter | 4,205 | 142 | # %% [markdown]
# # Imports
# %%
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
from multisensory import MAPClassifier, ClassicalTask, BalancedComodulationTask, DetectionTask
from scipy import stats
import pandas as pd
plt.style.use('./style_sheet.mplstyle')
# Load SNN... |
ef7d0218940d96d340605393ac53504b2b20987a625b0fd56f5f04eb07621411 | Jupyter | 4,217 | 122 | # %% [markdown]
# # Import the required packages
# %%
import os
from typing import Any
from torch.nn import (
BatchNorm2d, Conv2d, Flatten, Linear, LogSoftmax, MaxPool2d, Module,
ReLU, Tanh, NLLLoss
)
from torchvision.datasets import FashionMNIST
from torch import device as torch_device
from torch.nn import ... |
0e018849fe9cc59be33b9d999d8154a9beff58374f44b5e4abe2cba2f2bfb7eb | Jupyter | 4,220 | 108 | # %% [markdown]
# # Speed up your web crawler by parallelizing it with Ray
#
# <a id="try-anyscale-quickstart-ray-core-web-crawler" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-core-web-crawler">
# <img src="../../_static/img/run-on-anyscale.sv... |
af9af8d4dc84cbf3bbc60e94dfc3ca107156fcc91beeb6d90170776b066409d4 | Jupyter | 4,220 | 139 | # %%
import numpy as np
import pandas as pd
import scanpy as sc
import matplotlib as mpl
import matplotlib.pyplot as plt
from copy import copy
vir = copy(mpl.cm.viridis)
vir.set_under("lightgray")
sc.settings.verbosity = 3
sc.logging.print_header()
sc.settings.set_figure_params(figsize = [12,10],dpi =100... |
3f2e16ee7deaef5698a269bf33bdaa956af2e2bec75a47ca8abe2811dbfafffc | Jupyter | 4,241 | 131 | # %% [markdown]
# # Image annotations for a batch of samples
#
# Using this notebook, cardiologists are able to quickly view and annotate MRI images for a batch of samples. These annotated images become the training data for the next round of modeling.
# %% [markdown]
# # Setup
#
# <div class="alert alert-block aler... |
e3cbcc2ce137426ecb7d56f99c56c9aa0e2df3a9fe0e8e765906af6841a349d1 | Jupyter | 4,258 | 126 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
188a65f8648b7a09170c681fbb17c7fda8548dcf96138e909fc00d7c862feb08 | Jupyter | 4,270 | 156 | # %%
# A few tools for downloading the data
from io import StringIO
import requests
from neuron_morphology.swc_io import morphology_from_swc
from neuron_morphology.feature_extractor.data import Data
# %%
def data_from_url(morphology_url):
morphology_swc = StringIO(requests.get(morphology_url).text)
# Feature... |
ff658ad676e49576ac377f7ee3470d43fa44590f6ead2656a9722c4b97fbb779 | Jupyter | 4,290 | 112 | # %%
import tkinter as tk
from tkinter import messagebox
from PIL import Image, ImageTk
import numpy as np
import joblib
import os
from catboost import CatBoostRegressor
# Initialize the main window
root = tk.Tk()
root.title("GUI model for Predicting Concrete CS Based on 7 Ingredients & Curing Age")
# Create the main... |
eb9b5e07740479fda85391b4b34ce9ebc0d8acefded07ee158befb3d56cc68f1 | Jupyter | 4,345 | 135 | # %% [markdown]
# An example illustrating how to use our model to fit to a dataset containing events, times, and TMB values. When comparing different models test folds should be used.
# %%
import pathlib
path = pathlib.Path.cwd()
if path.stem == 'tmb_survival':
cwd = path
else:
cwd = list(path.parents)[::-1][... |
e27e16fa15df0432f69a4ae6576a6a8bf8cb388e2ae7f50cffd79fe455219961 | Jupyter | 4,356 | 142 | # %%
import os
import numpy as np
from sklearn.metrics import confusion_matrix
import seaborn as sns
import matplotlib as plt
from tensorflow import keras
# %%
file_str="RWs_H_g_2p2_tadv_1min"
LSTM_save_name="best_LSTM_"+file_str +".h5"
data=np.load('Data/Prepared/'+file_str+".npz")
for vars in data:
print(var... |
b3189ae9489bac057b9cb2a7228c5fdf6046f4822c6e9c26729db33ae47d9693 | Jupyter | 4,371 | 152 | # %% [markdown]
# We first get necessary external data and code
# %%
!git clone https://github.com/AllenInstitute/deepinterpolation.git
!mkdir -p ephys
# %% [markdown]
# Install deepinterpolation package
# %%
!pip install git+https://github.com/AllenInstitute/deepinterpolation.git
# %%
import deepinterpolation as d... |
0f363d3aaddbd1a64349354dc1d9821a79287e6ce7d716e4d21726b80ea42366 | Jupyter | 4,379 | 179 | # %%
!pip install -q cellxgene-census
!pip install -q obonet
# %%
from os.path import join
import pandas as pd
import numpy as np
from tqdm.auto import tqdm
# %% [markdown]
# # Utils code
# %%
import obonet
import networkx
# url = 'http://purl.obolibrary.org/obo/cl/cl-simple.obo'
url = 'https://github.com/obophe... |
76a258d09c83d981aabd197653eba6c12a4da06c34c6ab324b32324fc26298a3 | Jupyter | 4,423 | 138 | # %%
import scanpy as sc
from anndata import read_h5ad
import pandas as pd
import numpy as np
import scipy as sp
from statsmodels.stats.multitest import multipletests
import matplotlib.pyplot as plt
import seaborn as sns
import os
from os.path import join
import time
# scTRS tools
import scTRS.util as util
import scTR... |
c1034c8ac8c54a87643f7749289354e03452b7d883c0b7d3c7777ddd9136727b | Jupyter | 4,425 | 156 | # %%
import os
import IPython
import IPython.display
#import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
#import time
#import math
from tensorflow import keras
#import seaborn as sns
#import random
import tensorflow as tf
# %%
file_str="RWs_H_g_2p2_tadv_5min"
# %%
LSTM_save_name=file_str... |
b3ee0ee7b6ec704a64c165e2b2a6d4060993b8730af05eeb1b8c3d824d87398f | Jupyter | 4,434 | 88 | # %%
import os
import re
import pandas as pd
import numpy as np
import toml
import warnings
warnings.filterwarnings("ignore")
from icecream import ic
from scipy import stats
# %%
# Load the data
rtni = pd.read_csv('4RTNI_DATA.csv')
# %%
len(set(rtni['SUBID']))
# %%
# Convert the labels to the required format
def rt... |
c6cb5f8e9ddc1deee4874c59d4210fc5cd347ff8a3b5afc05b3868c57f507a1b | Jupyter | 4,442 | 167 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import os.path
import skimage
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import shutil
import pathlib
import glob
import shutil
import uuid
import random
import platform
import torch
import torchvision
impor... |
e5da8da5dc046a83c29e10b83b20ec1a05fe52f98a142b2c9d7f4ea392ace419 | Jupyter | 4,450 | 179 | # %%
import argparse
import pdb
import sys
import os
import logging
import numpy as np
from scipy.optimize import minimize
sys.path.insert(0, '../network')
from network import *
from transfer_functions import LIF, ReLU
from sequences import Sequence
from connectivity import *
from noise import WhiteNoise
sys.path.in... |
689cf525107844ac75eeed6b4d54d403fcdbdeb77d8bc131cca2627df964284f | Jupyter | 4,466 | 152 | # %% [markdown]
# We first get necessary external data and code
# %%
!git clone https://github.com/AllenInstitute/deepinterpolation.git
!mkdir -p ephys
# %% [markdown]
# Install deepinterpolation package
# %%
!pip install git+https://github.com/AllenInstitute/deepinterpolation.git
# %%
import os
from deepinterpolat... |
64649218cfe14271d0075f603cc85ab36b825ab2c837558d85938755d9af7dd5 | Jupyter | 4,467 | 166 | # %% [markdown]
# ## Masked Autoencoders: Visualization Demo
#
# This is a visualization demo using our pre-trained MAE models. No GPU is needed.
# %% [markdown]
# ### Prepare
# Check environment. Install packages if in Colab.
# %%
import sys
import os
import requests
import torch
import numpy as np
import matplot... |
0f764d6d15aac0f4f9b6a5f5f27a50e02091389da95cd4f6a8dea8628dab6822 | Jupyter | 4,469 | 172 | # %%
!pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps
# %%
from os.path import join
import anndata
import scanpy as sc
import numpy as np
import pandas as pd
import lightning.pytorch as pl
import dask.dataframe as dd
from cellnet.estimators import EstimatorCellTypeClassifier
from cellnet.models import ... |
0ee9a5a9f2f2cbad46f0153bd2bc300b2d873f064e263e79ac9c5b75a82d5a74 | Jupyter | 4,483 | 109 | # %% [markdown]
# # This demonotebook, is a guide on the simplest way to run Unit Match in python
# %%
%load_ext autoreload
%autoreload
import sys
from pathlib import Path
import UnitMatchPy.Bayes_fun as bf
import UnitMatchPy.utils as util
import UnitMatchPy.Overlord as ov
import numpy as np
import matplotlib.pyplo... |
e5693b2acc35451bbfa740b84e29a62d7bebf94501c004b5df45e38ed737c3d8 | Jupyter | 4,483 | 155 | # %% [markdown]
# # Plasticity - Figure 7
# %% [markdown]
# ## Define paths and initialize packages
# %%
import numpy as np
paths = np.load('Paths.npy', allow_pickle=True).item();
import numpy as np
import pandas as pd
pd.set_option('display.max_rows', None)
import matplotlib
import seaborn as sns
from scipy import... |
005fc47ea9d52b3252372780011bfd11cd2e8bc67b26fc590bdcbe192b46ceed | Jupyter | 4,485 | 147 | # %% [markdown]
# # Details about Nvidia Merlin
# %% [markdown]
# Documentation links:
#
# * General documentation: https://nvidia-merlin.github.io/Merlin/stable/README.html
# * GitHub: https://github.com/NVIDIA-Merlin/dataloader
# * Docker containers: https://nvidia-merlin.github.io/Merlin/stable/containers.html
#
... |
f0158263f1bf92b698ca6755887a0dc3f8fc51bd2fb0f98af2e862bef8e1f585 | Jupyter | 4,502 | 125 | # %% [markdown]
# __Data saved:__
# - __recordings_village_corr.csv__ --> remove participants leaving the main quare more than 10% of the total time
# %% [markdown]
# # Check how often participants left the main square
# %%
import copy # copy big/deep objects by value
import datetime # datetime operations
import i... |
80af585ea6d753b4acc4d0772c655e915a3ceaa9cd153dac77fb9d022a6e50b3 | Jupyter | 4,506 | 126 | # %% [markdown]
# # Import the required packages
# %%
import os
from typing import Any
from torch.nn import (
BatchNorm2d, Conv2d, Flatten, Linear, LogSoftmax, MaxPool2d, Module,
ReLU, Tanh, NLLLoss
)
from torchvision.datasets import FashionMNIST
from torch import device as torch_device
from torch.nn import ... |
f438ef0a93c1d4634f705aeeff6900819972977f65e85576b63010ff6b3fe414 | Jupyter | 4,523 | 114 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
2f63b0f9bab1c1db13d3c6c3e4f17642a4ca036dc9813c299588b839c2856634 | Jupyter | 4,547 | 104 | # %% [markdown]
# # Running Tune experiments with BayesOpt
#
# <a id="try-anyscale-quickstart-ray-tune-bayesopt_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-bayesopt_example">
# <img src="../../_static/img/run-on-anyscale.svg" alt... |
2fc1ae3a1613a4a044d8a7f89723eb05246ccb113ac66d7d1b0c9e1bed010a9f | Jupyter | 4,568 | 191 | # %% [markdown]
# <a href="https://colab.research.google.com/github/Kuanhao-Chao/splam/blob/main/notebook/splam_example.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # Running splam on Google Colab
# %% [markdown]
# ## Setup
# ... |
980d3d4c9c23108bc74cab49e628ee6d0d1089ce8bbbb9e5f402063d7bb70b9c | Jupyter | 4,586 | 124 | # %%
#standard
import os
import warnings
warnings.filterwarnings('ignore')
import pickle
#third party
import numpy as np
import hcp_utils as hcp
from nilearn import plotting
import matplotlib.pyplot as plt
from tqdm import tqdm
# %% [markdown]
# #### This notebook demonstrates how you might perform an intersubject co... |
7222fde6bf6b3a94695c8c7e2172c1434ccccb99c6f5b68d2be5ddf83e386c4f | Jupyter | 4,590 | 139 | # %% [markdown]
# # Review model results - Step 1 - Identify a sample to review
# %% [markdown]
# # Setup
#
# <div class="alert alert-block alert-warning">
# This notebook assumes you have already run notebook <kbd>../terra_featured_workspace/ml4h_setup.ipynb</kbd>.
# </div>
# %%
from ml4h.visualization_tools.fa... |
29e7fba619e3e0e99e23c23725974fe7e4cd2d18f073c1fb49e6dfa9f027744e | Jupyter | 4,600 | 143 | # %% [markdown]
# Here is a simpler example of the use of LIME for image classification by using Keras (v2 or greater)
# %%
import os
import keras
from keras.applications import inception_v3 as inc_net
from keras.preprocessing import image
from keras.applications.imagenet_utils import decode_predictions
from skimage.i... |
fae2687e29e1229e20d7c31ca2cdb7d1f076c90682175accbd2be272b2dbca38 | Jupyter | 4,605 | 191 | # %% [markdown]
# # Figure 2
# %%
%load_ext autoreload
%autoreload 2
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import numpy as np
from flyvis import EnsembleView
from flyvis.utils import color_utils
# %%
EnsembleView(
"flow/0000",
best_checkpoint_fn_kwargs={"validation_subdir"... |
2bc23abc04e15a58db479549f04230202b3ab1778c18fe190a7f369ca04f14c4 | Jupyter | 4,616 | 153 | # %% [markdown]
# We first get necessary external data and code
# %%
!git clone https://github.com/AllenInstitute/deepinterpolation.git
!mkdir -p ephys
# %% [markdown]
# Install deepinterpolation package
# %%
!pip install git+https://github.com/AllenInstitute/deepinterpolation.git
# %%
import os
from deepinterpolat... |
f13953dab22c6b486509020422ae1ab190204d14078cd9b0040f059a45eab82a | Jupyter | 4,620 | 187 | # %%
!pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps
# %%
%load_ext autoreload
# %%
import pickle
import os
from os.path import join
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import dask.dataframe as dd
# %%
DATA_PATH = '/mnt/dssmcmlfs01/merlin_cxg_... |
a9b3a918f91307c840714a8d2d46b4d8f60e6484e956bf938fbe7904528fad79 | Jupyter | 4,648 | 120 | # %%
import pyxdf
import pandas as pd
import time
import mne
import matplotlib.pyplot as plt
import numpy as np
import os
from mne_icalabel import label_components
import pickle
# %%
def invert_dict(dictionary):
inverted_dict = {value: key for key, value in dictionary.items()}
return inverted_dict
# %%
events... |
bbbabc3c035841d0a56c103bf8fdd4f642ebd4460e795e6ffb39d163f6e1e2f0 | Jupyter | 4,653 | 163 | # %%
import json
import numpy as np
import torch
from torch.utils.data import DataLoader, TensorDataset
import snntorch
import nirtorch
from snntorch import import_nirtorch
import matplotlib.pyplot as plt
# %%
### TEST DATA
test_data_path = "data/ds_test.pt"
ds_test = torch.load(test_data_path)
letter_written = ['Sp... |
4bac563866c1cd884df4def22464aa93fca83851a95e6ddc7c2d152dd56fb6d8 | Jupyter | 4,659 | 152 | # %% [markdown]
# # Data Example
# This notebook illustrates the type of data U-Net uses for training and testing. Specifically, we will demonstrate the [intended uses-case](#intended-use-case) and how U-Net handles some [exceptions](#exceptions).
#
# First open up the shell/terminal you used for installation and acti... |
70a89c9eb836cb4ec08e9d42ea311d0ad4cda6153fb40994db6eca51e7392a7f | Jupyter | 4,686 | 167 | # %%
from dp_model.model_files.sfcn import SFCN
from dp_model import dp_loss as dpl
from dp_model import dp_utils as dpu
import torch
import torch.nn.functional as F
import numpy as np
import matplotlib.pyplot as plt
# %% [markdown]
# # Example for Brain Age Prediction
# %%
# Example
# Note: the example model checkpo... |
85114ae11c83d8b9c5e10a375c03c2c9f8f11350accfd4640fea7e3698622940 | Jupyter | 4,701 | 116 | # %% [markdown]
# # Connectome
# This notebook illustrates the constructed spatially invariant connectome from local reconstructions that builds the
# scaffold of the network.
# %% [markdown]
# **Select GPU runtime**
#
# To run the notebook on a GPU select Menu -> Runtime -> Change runtime type -> GPU.
# %%
# @markd... |
d7aec905882f3f898ff72d011008245016716e88ff335b9ea4a6fff1ba5422dd | Jupyter | 4,711 | 150 | # %% [markdown]
# Prerequisites: install [tensorflow 1.0](https://www.tensorflow.org/install/) and [scikit-image](http://scikit-image.org/docs/dev/api/skimage.html).
#
# clone this fork of [tf-slim](https://github.com/marcotcr/tf-models) somewhere
# download [the pretrained model](http://download.tensorflow.org/model... |
6eec6570ce9b50a1c6786c46cce21fb93fcf8255c3b3589fc6d316470ce6741a | Jupyter | 4,737 | 142 | # %%
%matplotlib notebook
import numpy as np
import matplotlib.pyplot as plt
import random
import pickle as pkl
from math import floor
import torch
import pandas as pd
import seaborn as sns
from glob import glob
# %%
# give the training output files
# likely ../artifacts/tetris/training/training/OUTDIR/*.pkl
# or ... |
8fde6c6498e6700aa5ae61725895c16dc15eb4a5f6748cac9444691ce472e3f2 | Jupyter | 4,779 | 137 | # %%
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
import matplotlib.pylab as pl
import matplotlib.gridspec as gridspec
import scipy.ndimage as ndimage
from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter
import matplotlib.mlab as mlab
from matplotlib i... |
6ed56a54eb057ee0e593ec6e3c9fd5500fabad462846e0f0126f595d7875e318 | Jupyter | 4,789 | 154 | # %% [markdown]
# # Supp Fig 2 (Covarying parameter values)
# ### This code runs the simulations and reproduces SFig 2A-2C
# %%
from KeyFunctions.TheoryFunctions import *
from KeyFunctions.SimulationFunctions import *
from mpl_toolkits.axes_grid1 import make_axes_locatable
import matplotlib.pyplot as plt
import matpl... |
0aa39894f8445999565456a2153bca85ded2a0e877d1c66315e4fe5ea3b87977 | Jupyter | 4,792 | 142 | # %%
%load_ext autoreload
%autoreload 2
# %%
# !pip install --upgrade nbformat
# %%
%matplotlib inline
# %%
!pip install umap-learn[plot]
# %%
import os
os.environ["CUDA_VISIBLE_DEVICES"] = ""
import umap.plot
import umap.umap_ as umap
from collections import defaultdict
import matplotlib.pyplot as plt
from ml4h.... |
1c11f7a9b28b9a53c22d86980912b2d9ebe5d97a77fd151c051ab7a74e7ff4c3 | Jupyter | 4,793 | 102 | # %%
#standard
import os
import warnings
warnings.filterwarnings('ignore')
import pickle
#third party
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import glob as glob
from IPython.display import Video
# %% [markdown]
# #### This notebook practices loading ROI-specific beta values from vers... |
42efc653e754a2745a99232744daca339cbdd2e032d30299192703410813f421 | Jupyter | 4,797 | 157 | # %% [markdown]
# # Compile .gs file from the precomputed MAGMA z-stat file
# - zstat_file: /n/holystore01/LABS/price_lab/Users/mjzhang/scDRS_data/gene_annotation/MAGMA-v108/MAGMA_v108_GENE_10_ZSTAT.txt
# - compute .gs file based on different strategies of assigning gene weights.
# - Use `submit.compute_score.sh` to ca... |
a56e87f020930253f3ca9d09b23e8f0fb1dea732d511e03ad4479062ad54d6ce | Jupyter | 4,799 | 105 | # %%
import pandas as pd
# file path to excel file for analysis
filePath = '/Users/adityabehal/Documents/RPI/Sophomore/Summer/UCSF-Nelson-Lab-Research/ASAP-data/3-weeks/Analysis/A1-A3-B4-B0-B2-B5-C2-D1-D2-3-weeks-open-field-analysis.xlsx'
# the three example spreadsheets are binned over one minute
# A1-A3-B4-B0-B2-B5... |
9d2c7873f5a730ec714fd6bf21759f67718a60b81f1e4dcd62c1bb246829ee97 | Jupyter | 4,813 | 190 | # %%
%load_ext autoreload
import deepdish as dd
import numpy as np
import pandas as pd
import json
from skimage import io
from notebook_utilities.display import stack_browser, display_array
from matplotlib import pyplot as plt
from fimpy.core.split_dataset import H5SplitDataset
%matplotlib notebook
from pathlib import ... |
6605cfff597c053877d15d491eb02cddd41bcca60b63572aaf31f32f36189c0b | Jupyter | 4,824 | 133 | # %% [markdown]
# # Upright transform of the reconstructed morphology
# %% [markdown]
# This tutorial demonstrates how to perform the upright transform.
#
# Reconstructed morphologies may be oriented in an arbitrary direction in the slice plane.
# For analysis of morphological features it is often necessary to bring... |
d1b103ebc5262b5b22e8a94aa09e8c8588b71f06780131fdf4167f00768f5cb1 | Jupyter | 4,824 | 130 | # %% [markdown]
# # Overview
# The notebook shows how the ```lime_image``` tools can be applied to a smaller dataset like mnist. The dataset is very low resolution and allows quite a bit of rapid-iteration.
# %%
import numpy as np
import matplotlib.pyplot as plt
from skimage.color import gray2rgb, rgb2gray, label2rgb ... |
1ca177a89383265587fb5a7b93991b074f5576e9b5a06ff36dc86a99b456daea | Jupyter | 4,841 | 154 | # %%
import pandas as pd
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
import pathlib
import SimpleITK as sitk
import pickle
# %%
# load files
template_file='resampled_template.nii.gz'
prior_file = 'melodic_IC_resampled_resampled.nii.gz'
mask_file = 'masks/sub-jgrAesMEDISOc11L_ses-1_task-res... |
d50a7bdcf752162090e8481066228bac0c8109afa8b9111738f342d83069c9d6 | Jupyter | 4,876 | 153 | # %% [markdown]
# # Figure 1 (Segregated E populations)
# #### This file runs the simulations and recreates Fig 1D, 1E and 1F
# %%
from KeyFunctions.SimulationFunctions import *
from KeyFunctions.TheoryFunctions import *
import matplotlib.pyplot as plt
from tqdm import tqdm
# %% [markdown]
# ### Default parameters f... |
09868597aca8f4800ba961660419d7d98c5427f914cd61f0655f66f2c20f62d6 | Jupyter | 4,881 | 155 | # %% [markdown]
# (tune-rllib-example)=
#
# # Using RLlib with Tune
#
# <a id="try-anyscale-quickstart-ray-tune-pbt_ppo_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-pbt_ppo_example">
# <img src="../../_static/img/run-on-anyscale.... |
cbbe4dcf30814dffcf0c423cbd75232acc29a7b5b10aaeb8ca47de4bcfbed010 | Jupyter | 4,890 | 155 | # %%
#import
import seaborn as sns
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
from scipy.ndimage import gaussian_filter1d
from scipy import stats
from scipy.stats import binned_statistic
from sklearn.preprocessing import MinMaxScaler
from sklearn.decomposition import PCA
from sklearn.c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.