sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b43b57ff3342ca2b7d2c78163867bf9daced1561490355f35b4b3beb89a33f9b | Jupyter | 10,819 | 295 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/03c_catalog_seisbench_gamma.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# 
# %%
# Loading a preprocessing timeseries data for COHA
ts_df = pd.read_csv("./data/SWOW_prediction/eval/time_series/ts_df.csv")
ts_df = (
ts_df.groupby(["words... |
dfafa19e36236a018bad51bccf0de9ba4d0c438977b1e5e2ab0b0af8d21b918a | Jupyter | 10,888 | 215 | # %% [markdown]
# ## Welcome
# This is an examplary analysis of the connectivity of the released part of the rat SSCx model of Blue Brain.
# It illustrates the use of the "bluepysnap" and "conntility" packages to analyze its connectivity on the cellular level, i.e. as a graph with neurons as nodes and edges between the... |
a62129d70063038233baf99f97c74512f041cf31049f6cae911a551673955b14 | Jupyter | 10,900 | 330 | # %% [markdown]
# # Summary
# %% [markdown]
# 04_real_example.ipynb
#
# Single scan inference end-to-end. Load a scan, run NeuroFM.predict(), show the output brain health and latent features.
# %% [markdown]
# # Install
# %% [markdown]
# Unfortunately due to dependency conflicts between Tensorflow 2.13 and ipython,... |
cc3763e29f00320ec8ebd2718920580288eccf2d97e568e72d1bc8690f057c85 | Jupyter | 10,915 | 306 | # %%
from multiprocessing import Pool
import os
import numpy as np
import matplotlib.pyplot as plt
import tifffile as tiff
import skimage as ski
from scipy.ndimage import zoom
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
from network_flow_tracker.utils.io import save_data, load_data
import network_flow... |
f607f0fa4f59989595eef6b515dd829d9a1224eb638a79882bd95be006771082 | Jupyter | 10,921 | 416 | # %%
import numpy as np
import matplotlib.pyplot as plt
import imp
from camera import camera3d as cam
import calibrator as cal
import cv2
import imp
import time
import numpy as np
import os
import subprocess
import skg
from skspatial.objects import Plane
from skspatial.objects import Points
import imageio
pathFile = "... |
903d528ad1c89089e75dfb31ce1062989115621bb48705c606e32a3c2dec4e51 | Jupyter | 11,035 | 244 | # %%
import os
# The current working directory needs to be in explainable_TGCNN
print(os.getcwd())
os.chdir('..\\')
print(os.getcwd())
import pandas as pd
import numpy as np
import tensorflow as tf
from src import create_fake_patients, whole_model_demographics_gradcam, graph_plot, plot_feature_value, ga, gc, utils
im... |
35064f51cc83d723aa07342dd337d51d9ea6399888c5e4b11e19d5b4cb3d4947 | Jupyter | 11,040 | 317 | # %%
import numpy as np
import matplotlib.pyplot as plt
G = 10
def derivatives(t, y):
"""
y consists of the following order:
y = [y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g]
"""
y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g = y
# Determine G_t (G is applied only when t = 0, a... |
7951be34d3e59d9e68faf6975662a6ff4be6f0571a8d5380efd2f65a5b331673 | Jupyter | 11,040 | 317 | # %%
import numpy as np
import matplotlib.pyplot as plt
G = 10
def derivatives(t, y):
"""
y consists of the following order:
y = [y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g]
"""
y1_e, y2_e, y1_g, y2_g, y_1_e, y_2_e, y_1_g, y_2_g = y
# Determine G_t (G is applied only when t = 0, a... |
6b68de7cb12dd6591539b2010c3c24afbeb62c0364c56c83fd133da5060cf3aa | Jupyter | 11,079 | 317 | # %% [markdown]
# # `mcmlnet` Inference: Quick Start
# %%
import copy
import os
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import torch
from mcmlnet.training.models.base_model import BaseModel
from mcmlnet.utils.convenience import (
load_trained_model,
predict_in_batches,
... |
1ae176909ba55036cc71349e256312fd07f3856f2d404f213c0feb2e08f943dd | Jupyter | 11,125 | 291 | # %%
%matplotlib inline
# %%
import os
import pprint
import torch
import torchvision
import torchvision.transforms as T
import numpy as np
import matplotlib.pyplot as plt
from EIANN import Network
import EIANN.utils as ut
import EIANN.plot as pt
# Load dataset
tensor_flatten = T.Compose([T.ToTensor(), T.Lambda(torch... |
3139b498a194424d77ad16c132d67aa362b82ae5a777157b5b9cb0540cd270e2 | Jupyter | 11,177 | 338 | # %% [markdown]
# ## Adaptation and Predictions on New Data Using Pretrained Normative Models
#
# ##### *Authors: R. Cirstian, A. Bernas*
#
# This notebook shows how to take an existing (pretrained) brain model
# and apply it to new data.
#
# You do NOT fully train a new model here.
# Instead, you:
# 1. load a ready... |
7dacf65b3e15742c43474c72f0b1b02a54133fcc90271ce9866e388405584169 | Jupyter | 11,180 | 393 | # %%
import matplotlib.pyplot as plt
from OptimalBattery.global_config import repo_dir,save_dir
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib as mpl
mpl.rcParams["pdf.fonttype"] = 42
from scipy.stats import pearsonr
from scipy.stats import sem
from scipy.stats import ttest_rel
import os... |
2bc43e91bfe8d0f85df32bc034237819ccc2df6a76b7f41f8224444d0b95de99 | Jupyter | 11,201 | 362 | # %%
import os
import sys
import scipy
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
import scipy.io as sio
import anndata as ad
import matplotlib.pyplot as plt
os.chdir("/data/wuqinhua/scPhase/Age")
# %% [markdown]
# # 1. UMAP
# %%
adata = sc.read_h5ad("./ensemble_adata_with_atten... |
71003c280c8f73464e3f3e397453252b1681ef6d74df6b8ad7bf3d94ee53c17d | Jupyter | 11,205 | 310 | # %%
import numpy as np
import scanpy as sc
import matplotlib.pyplot as plt
import scipy.sparse as sp
import pandas as pd
import anndata
from sklearn.cluster import AgglomerativeClustering
from sklearn.neighbors import kneighbors_graph
# %% [markdown]
# # Step 1: load and filter data to reconstruct the cortex exampl... |
f340ebb7b8bf1b60225557e778d72810cf5f814cd4a8f128c8308701bcd23006 | Jupyter | 11,215 | 341 | # %% [markdown]
# In this notebook we leverage the rotated resampled and aligned annotation volumes.
# We have to guess the anontations in each voxel though as they were changed to an INT between 0 and 3000 for visualisation purposes
# %%
import os
import SimpleITK as sitk
import json
import numpy as np
import matplo... |
e55c0543b6df03b2d6061a9a32fdeb5e69535ab0d939ac530622e307d3837ff7 | Jupyter | 11,235 | 299 | # %%
#Copyright (c) 2019 Primoz Ravbar UCSB Licensed under BSD 2-Clause [see LICENSE for details] Written by Primoz Ravbar
import numpy as np
import scipy
from scipy import ndimage
from scipy import misc
import pickle
import time
import matplotlib.pyplot as plt
import cv2
import os
import tensorflow as tf
from tensor... |
aa37a19e1669fdcd0ad60a5698e64e69b12c8d7ab4ab23f2cde1d1b27f69b265 | Jupyter | 11,295 | 395 | # %% [markdown]
# # Figure 2
# Need:
# 1.
# %%
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.gridspec import GridSpec
# %%
phase_color = {"pre": "#1f77b4", "post": "#ff7f0e", "gray": "#888888", "catch": "#FFE6CC"}
ROICOLORS = {
"EVC": "#00FF00",
... |
90b33a70f11a73426fc14085e28d2d29f86f92cace0a9b866a1c0fd1af8ad65a | Jupyter | 11,350 | 347 | # %% [markdown]
# # Coarse-to-fine non-rigid alignment example
#
# This notebook demonstrates the complete workflow for large spatial omics slices:
#
# 1. Read paired `AnnData` slices.
# 2. Preprocess and compute shared latent features.
# 3. Build low-resolution voxel control points.
# 4. Run coarse rigid/similarity ... |
c2a148561961a7012e9163fd9eb52cb8239f967ec2f40de592a761898abb2188 | Jupyter | 11,387 | 262 | # %% [markdown]
# #### Features of this code:
#
# ### image enhancement to clean the overall background for easy contour detection
# ### Overlap the contour detected with original image
# ### Do particle specific background correction. Dynamic padding to cover entire particle. Avoid another particle to come within the... |
d7d1ada71b6a8c13da851ffe450c5d05f98a56ff9a33f5d2eb69dbbdacf83706 | Jupyter | 11,414 | 351 | # %%
import cebra
from cebra import CEBRA
import cebra.models
import os
from scipy import stats
import tempfile
from pathlib import Path
import torch
import pandas as pd
import numpy as np
import pickle as pkl
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
from sklearn.mode... |
9d95f9d8527a6e3ff850919010f2650b32429eb16dcc34b41e34be32a7554285 | Jupyter | 11,443 | 316 | # %% [markdown]
# # Multi-center analysis
# %% [markdown]
# ### Imports
# %%
import sys
sys.path.append('../')
from PAINTeR import connectivity # in-house lib used for the RPN-signature
from PAINTeR import plot # in-house lib used for the RPN-signature
from PAINTeR import model # in-house lib used... |
4d575a36315373dde1a27df2a85eceea2cf9e06b32b47b562b1cee5c80719261 | Jupyter | 11,444 | 289 | # %% [markdown]
# # Reproducibility 1: figure 2
# - Benchmark on 3 landscapes:
# - linear regulation of two genes (see [Kemble et al.](https://www.science.org/doi/10.1126/sciadv.abb2236) )
# - geometric model with Gaussian (see [Tenaillon et al.](https://www.annualreviews.org/content/journals/10.1146/annurev-... |
2f0d27c8e725f4a1623b026430ecd03c0d855bc7f40d043552c36853e0c3a995 | Jupyter | 11,447 | 289 | # %% [markdown]
# # Reproducibility 1: figure 2
# - Benchmark on 3 landscapes:
# - linear regulation of two genes (see [Kemble et al.](https://www.science.org/doi/10.1126/sciadv.abb2236) )
# - geometric model with Gaussian (see [Tenaillon et al.](https://www.annualreviews.org/content/journals/10.1146/annurev-... |
58ff2690b75afe15b442fef3a8ad953e89930e788760dd3a94c3de5458ae6bda | Jupyter | 11,478 | 429 | # %%
library(ggseg)
library(ggseg3d)
library(ggplot2)
library(dplyr)
library(scales)
library(ggsegDesterieux)
library(tidyr)
library(dplyr)
library(jsonlite)
# %%
set.seed(123456)
root_dir <- dirname(getwd())
data_dir <- file.path(root_dir, '../data')
result_dir <- file.path(root_dir, '../results')
roi_ids <- fr... |
275c88c6cb50697a0f2b5fe6cf427d4fbb4f2b206d213bc2c4634806aa1e3bf7 | Jupyter | 11,496 | 275 | # %% [markdown]
# # Using lifespan models to make predictions on new data ("Transfer")
#
# Created by Saige rutherford adapted by Charlotte Fraza, Johanna Bayer, Andre Marquand and Konstantinos Tsilimparis
#
# In this tutorial, we demonstrate how to use large, pretrained normative models to generate predictions for n... |
d57609f75b563336ea36aee04d9d4f7b4204d87631c1462e18edce0b91e2af48 | Jupyter | 11,592 | 411 | # %% [markdown]
# # Regression of pH range using machine learning (Random Forest)
# %%
HOME_DIR = '/Users/datatranslators/Documents/GitHub/acido_CEST_Machine_Learning/'
DESTINATION = 'outputs'
# %% [markdown]
# ## Libraries
# %%
#libs
from sklearn.model_selection import train_test_split
from sklearn.model_selection ... |
ea5b0ab259159c1daf98a7e88854df9ffc2973dc24d9b91a0c280ce55193cf37 | Jupyter | 11,611 | 287 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt
import torch
import numpy as np
from infopath.utils.functions import load_data, feature_pop_avg, mse_2d, session_tensor
import scipy.sparse as sp
from scipy.optimize import linear_sum_assignment
import os
from... |
181d7aea15d6e04bcf400d28bd0c0376dcaf018a54460086a71f9634f4131310 | Jupyter | 11,619 | 314 | # %%
# %%
"""
Import libraries, model, and datasets
"""
import sys
import os
from pathlib import Path
import numpy as np
import matplotlib.pyplot as plt
import shutil
import torch
src_dir = os.getcwd()
src_dir = os.path.abspath(os.path.join(src_dir, '..')) + '/src' # Adjust the path as needed
print(src_dir)
sys.pat... |
64abb46b2b49a56fd29466025271833b2be208dd93fba6d291bd06916f5b050b | Jupyter | 11,626 | 464 | # %%
%load_ext autoreload
%autoreload 2
# %%
%config InlineBackend.figure_format = 'retina'
from setup import *
# %%
# %%
# %%
# %% [markdown]
# # Figure
# %% [markdown]
# ## Sejourn Time
# %%
from itertools import groupby
def sejourn_time_seq(seq, times):
boutypes, sejourns = [], []
start = 0
fo... |
cf656a5238765a01d11ce4cc60fa80268ad607562de119c6fe2eb22d1b15e205 | Jupyter | 11,641 | 424 | # %%
%matplotlib notebook
import sys
import os
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
import numpy as np
import h5py
from filters import taper_filter
music_dir = os.path.join(os.getcwd(), "PyMUSIC")
sys.path.append(music_dir)
from src.base import MUSIC
# %%
file_DASH = os.path.joi... |
df054074685f2e3f487813bed0a0750238ab2a0e8803166104272722c0c62056 | Jupyter | 11,642 | 321 | # %%
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from sklearn.linear_model import LinearRegression
import statsmodels.api as sm
import glob
import os
from statsmodels.stats.multitest import fdrcorrection as fdr
# %%
custom_palette = {
'SpD1': '#ED5E70', # blue
... |
f5e6d7550a5e7acb863058fae5644270d3c9b62ab1cecc64273c058b685d2b8c | Jupyter | 11,676 | 263 | # %%
from infopath.model_loader import load_model_and_optimizer
from infopath.config import load_training_opt
import torch
from infopath.utils.functions import run_with_perturbation
import os
from infopath.utils.plot_utils import plot_with_size, strip_right_top_axis
import numpy as np
import random
%reload_ext autore... |
4bacde4212f7b9b76cb5ebbf2e09b86f944d8e57b76b0cebac66e73748463824 | Jupyter | 11,706 | 238 | # %% [markdown]
# # Supplementary Tables: Accuracy
# %%
import matplotlib.pyplot as plt
import EIANN as eiann
import EIANN.utils as ut
from EIANN.generate_figures import *
eiann.update_plot_defaults()
root_dir = ut.get_project_root()
model_dict_all = load_model_dict()
# %%
def latex_to_unicode(text):
"""
Con... |
858907bf888d7719c4f7df3fb7f11aeb7cc33b3c8f510a4ad7978e613c7b9d21 | Jupyter | 11,728 | 445 | # %%
import scipy as sp
import statsmodels
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
from numpy import mean
from statsmodels.formula.api import ols
import statsmodels.stats.multitest as multi
import statsmodels.formula.api as smf
import statsmodels.api as sm
import war... |
8f7adcbef5dcbc32f14508c90c205b6467385664d30b157fc79a1b0994015218 | Jupyter | 11,756 | 317 | # %%
import torch
import torchvision
import torchvision.transforms as transforms
# %%
transform = transforms.Compose(
[torchvision.transforms.ToTensor(),
torchvision.transforms.Normalize(
(0.1307,), (0.3081,))])
batch_size = 100
trainset =... |
f818bdb8c8ac7ea5155617bfec59de382228c3993c9721bb8d0bc50c972c066f | Jupyter | 11,843 | 298 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/additional_example_workflows/examples/03a_training_phasenet.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# 
import re
# %%
# List of congresses
congresses = [str(i) for i in range(97, 115)]
congresses = ["0" + x if len(x) =... |
b077125d5a2fc2e4fb4b89bebab2830512e7e757ce9e88b25e0ff1532a88f84c | Jupyter | 11,878 | 452 | # %% [markdown]
# # Classification of pH range using machine learning
# %%
#libs
from sklearn.model_selection import train_test_split
from sklearn.model_selection import GridSearchCV
from sklearn import linear_model
import pandas as pd
import numpy as np
import scikitplot as skplt
import matplotlib.pyplot as plt
from ... |
5d3be621dfe50442c026c87a11db4549371946b66cfc4b60331fd596d8851d15 | Jupyter | 11,879 | 247 | # %%
import tifffile
import euler_gpu
import os, random
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
import numpy as np
import torch
import h5py
from tqdm import tqdm
from math import pi as PI
device = torch.device("cuda:0")
BATCH_SIZE = 256
red_channel = 1
fixed_frame = 0
MAX_NUM_CENTROIDS = 100
# %% [markdown]
# ## Ali... |
cdde8b85ae6186532477a387ca5352a285ca3611defa11d738dd82f5405e44ef | Jupyter | 11,908 | 254 | # %%
from QHT import QHT
from exactqcnn import ExactQCNN
from matplotlib import pyplot as plt
import numpy as np
import json
# %%
exactqcnn = ExactQCNN(15)
ins = QHT(None, exactqcnn, None)
# %%
ins.calc_error_separable_CSqNeyman(n=1, seed=2,
a_li=[i/10 for i in range(-10,11)],shots... |
0e0f516a64ddf7856f6ebd8b84fdefd84c9b6da904dec3b6529b79cdcfa01125 | Jupyter | 11,911 | 384 | # %%
import os
import sys
import scipy
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
import scipy.io as sio
import anndata as ad
import matplotlib.pyplot as plt
os.chdir("/data/wuqinhua/scPhase/CRC")
# %% [markdown]
# # 1. Cell-level
# %%
adata = sc.read_h5ad("./ensemble_adata_with... |
09b3ce54d5b4c313806c2085592652197b68a145b55e1c9e3a4ca92691eeaf26 | Jupyter | 11,918 | 339 | # %%
import torch
import matplotlib.pyplot as plt
import featurevis
from featurevis import models
from featurevis import ops
from featurevis import utils
device = 'cuda' if torch.cuda.is_available() else 'cpu'
if device == 'cpu':
print('Running models on CPU!')
# %% [markdown]
# First, let's get a pre-trained ... |
80f6468218995a1c37dfeece184188c5c132da1cdbaec532c78c36cdabe0d63f | Jupyter | 11,939 | 389 | # %% [markdown]
# # Import
# %%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import shap
import tensorflow as tf
import sys, os
sys.path.append(os.path.abspath(".."))
import xgboost as xgb
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier... |
e8f866b91048134c502f85a3ca715576cc92d79bf780c59eb38df0fd5c680dc2 | Jupyter | 11,963 | 231 | # %%
import numpy as np
import os, cv2
import h5py
import tifffile
from tqdm import tqdm, trange
os.environ["CUDA_VISIBLE_DEVICES"] = "1"
from deepreg.predict import unwrapped_predict, normalize_batched_image
from deepreg.model.layer import Warping
import tensorflow as tf
import matplotlib.pyplot as plt
batch_size = ... |
0f712619f6114bfb4fdb9211a8d649413ac542b193b656088fce5c53d0e1369d | Jupyter | 12,040 | 307 | # %% [markdown]
# # Fit Normative Models
# %% [markdown]
# ### Imports
# %%
import os
import json
import re
import pickle
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import tqdm.notebook as tq
from IPython.display import clear_output
from sklearn.model_selection impor... |
ef08c78d1ce6bcbf4d6f145a3f3f32de8a4f6449db2c384e932c56632ac568c4 | Jupyter | 12,069 | 273 | # %% [markdown]
# # EEG bandpower
#
# This notebook demonstrates how to use YASA to calculate the spectral bandpower per channel and per sleep stage.
#
# Please make sure to install the latest version of YASA first by typing the following line in your terminal or command prompt:
#
# `pip install --upgrade yasa`
# %... |
8c3d3864d512d977fc02e52cef9dc741ab4648883c8b2e137dbeadfcb5978472 | Jupyter | 12,080 | 312 | # %% [markdown]
# # Dendritic Spine Classification
# %% [markdown]
# 1. Set `dataset_path` and choose metrics reduction method.
# %%
dataset_path = "example dataset"
show_method = "tsne"
# show_method = "pca"
# %% [markdown]
# 2. Load Metrics.
# %%
from spine_metrics import SpineMetricDataset
from spine_fitter impo... |
ad09ec2bfb09c086d5212d8150d3eaf65bec07c6eb7007b3e4307198f8ca9eec | Jupyter | 12,083 | 378 | # %%
import os
import re
from scipy import stats
import tempfile
from pathlib import Path
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.colors import rgb2hex
import pickle as pkl
from sklearn.model_selection import train_test_split
from sklearn.discriminan... |
3dcf42988405fd1d758f1956f07c0b29cbc3dd902839a52e49f503a8f065e76a | Jupyter | 12,114 | 304 | # %% [markdown]
# ### Initialization
# %%
import os, logging, datetime
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import skimage.morphology as skim
%matplotlib inline
%load_ext autoreload
%autoreload 2
# %%
from network_flow_tracker import particle
import trackpy as tp
from network_flow_t... |
5f6d991b9e0a1088930bb76d86a9bee5e5d0264722bc89b14376f961279f3a71 | Jupyter | 12,151 | 358 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import scipy
from scipy.signal import hilbert
import sys
sys.path.append('..')
from cann import CANN1D
#set backend to cpu
bm.set_platform('cpu')
# %% [markdown]
# ### define... |
9fb31bd5008c53d4f0901280f278293249182e3bce7184593ae13e9fa177ec6b | Jupyter | 12,151 | 376 | # %%
import re, time, warnings, os, sys, copy
import gzip, pickle
import numpy as np
import pandas as pd
import gzip, pickle
import scipy, sklearn, mne
import auxiliary as aux
import data, rsa
sys.path.append('../spaces/')
import embeddings as emb
import pubplot as pub
import matplotlib.pyplot as plt
pub.styles.set(... |
e031445436fbcebf4e0a33dab2a7a416b61eb62a15ab990dc19be8937fdde22c | Jupyter | 12,170 | 328 | # %%
import os
import mne
import glob
import numpy as np
import pandas as pd
from tqdm.notebook import tqdm
import matplotlib.pyplot as plt
import seaborn as sns
# Suppress MNE and PyTorch warnings
import warnings
warnings.filterwarnings("ignore")
# %%
def load_data(experiment, task, window_duration, onset, dataset_... |
c725fb7ef4ab9c363d17203d3acd570bdf7b7aae8fae55fe46f7a0c6a7e25161 | Jupyter | 12,186 | 227 | # %% [markdown]
# # Li2026 (Triple-N) packaging validation -- from the Brain-Score packaged data
#
# Every figure here is regenerated from `load_dataset('Li2026')`,
# `load_dataset('Li2026.temporal')`, and `load_stimulus_set('Li2026')` -- i.e. the
# assemblies served from S3, not the raw `.mat` files. Reproducing the ... |
748bbfa475ad83f2ef44d3613cc5e13351cf0754dd40fe1923fd2190f0a81668 | Jupyter | 12,205 | 284 | # %% [markdown]
# # Matching Model
# To find the expected effect of the intervention on the population, we match each treated individual with one or more untreated individuals which are "almost the same" as him or her.
# %%
from causallib.estimation import IPW, Matching
import matplotlib.pyplot as plt
import seaborn a... |
79808660336ea93c9743cba0007d54a5d29f86006e7d028a70bb1ebaf301e8d9 | Jupyter | 12,227 | 303 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/main/examples/03f_training_dkpn.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# 
from lib_alban.libplot_metrics import *
import csv
# %%
def analysis(list_labels_ref, MATCHES, conditions, cube=False, oneinst=False):
gvalue = np.arange(0.2,0.81,(0.8-0.2)/(len(conditions)-1))
colors_ref = [tupl... |
81b4333a209fa01b6217fbd44091715af2647a7971c92eca006bdf46653285bb | Jupyter | 12,287 | 292 | # %% [markdown]
# # PyDesigner Example
# This notebook serves to educate on PyDesigner and it's usage. Currently, this example will only cover portions past preprocessing for stability testing of **dwipi**.
# %% [markdown]
# ## Load Modules
# Start by loading modules necessary to execute this script
# %%
import os
im... |
98a3717cdb51b867de55caae5d5011d3e47b907662a4876c544f82515a5e17fa | Jupyter | 12,287 | 236 | # %% [markdown]
# # Deconfounding
#
# This notebook provides a quick overview of the rationale behind the use of confounds within `genbed`.
#
# It is principally a discussion about demeaning covariates, which is something that Jeanette Mumford has covered much more eloquently already: <http://mumford.fmripower.org/me... |
8ccc371674dc18c571663ecd339fc0ac5e1a4c4dc8320cb51d249eb9d9932f7c | Jupyter | 12,288 | 336 | # %%
# Core libraries
import numpy as np # array ops and numerical routines
import pandas as pd # dataframes, CSV I/O
# Plotting
import matplotlib
from matplotlib import pyplot as plt # plotting API
import seaborn as sns # statistical plotting, themes
# Preprocessing and models
from sklearn.preprocessing import S... |
8ed0c55576d64f52c980c6bcdd665c3e7cba3f6cc3285365410202ad11e47b8b | Jupyter | 12,292 | 336 | # %% [markdown]
# # 04 - Allen2022 fMRI Benchmark Smoke Test (Surface)
#
# Score AlexNet on both the **8-subject** (515 images) and **4-subject** (~1000 images)
# fsaverage surface fMRI benchmarks.
#
# **Sections:**
# 1. Load and verify assemblies (both variants)
# 2. Compare with volumetric assemblies
# 3. Verify be... |
c843c6a11b5d9480154487d4b3b23a2fb7a177455be8ebbe9db10e0af079bb3e | Jupyter | 12,302 | 271 | # %% [markdown]
# # Json Generation Tutorial:
# In this tutorial, we'll go over how to run the json_generation.py script, which takes a given brain parcellation nifti file and registers it to MNI space. Json files containing relevant labels and coordinates are also generated for each parcellation. This script is also a... |
8d0e617db8117bd0b449628ac5f6423d99e93537cb7487e23e6389ef735d9674 | Jupyter | 12,362 | 341 | # %%
import numpy as np
import pandas as pd
import pegasus as pg
import json
import os
import pegasusio
from pegasusio import UnimodalData, MultimodalData
import matplotlib.pyplot as plt
import itertools
from matplotlib import cm
import seaborn as sns
# from statannotations.Annotator import Annotator
# import pzfx_par... |
f2faa0e91fa15aaeac07a9f42a92bba9f7b8409f7df1281a1e7555668e5f9b60 | Jupyter | 12,371 | 382 | # %%
import os, importlib, sys, time, h5py
# %%
import numpy as np
from scipy import linalg, stats, ndimage, io
from scipy.sparse import diags
# %%
import matplotlib.pyplot as plt
from matplotlib import rc
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica'], 'size':13})
## for Palatino and other serif fonts... |
b9f19433fa692bbf3563a5b3d90d4438f60777d3b2376636e3d67f4e78438438 | Jupyter | 12,395 | 231 | # %% [markdown]
# # Make adjective-noun phrases
# %% [markdown]
# Now that we have a cleaned list of concrete and abstract words, we can work on constructing phrases.
# %%
import os
import random
import re
import requests
import numpy as np
import pandas as pd
from scipy import stats
from datetime import date
im... |
04edcfb7b0a003dd05162a4652bb8e9f92be50ec5c0a012cd128424b1407a3e5 | Jupyter | 12,409 | 375 | # %% [markdown]
# # Scoring and visualizing a single variant
# %% [markdown]
# Here we go through the process of predicting the effect of a single variant on
# different modalities, such as gene expression and chromatin accessibility.
#
# ``` {tip}
# Open this tutorial in Google Colab for interactive viewing.
# ```
... |
3dac00138a7a9bb00e263236d8d44696d5dac4b98d2767964d5243ac9875f32e | Jupyter | 12,421 | 411 | # %%
%matplotlib notebook
import sys
import os
import matplotlib.pyplot as plt
import numpy as np
import obspy as obs
from obspy.signal.invsim import corn_freq_2_paz
import pandas as pd
from filters import taper_filter
music_dir = os.path.join(os.getcwd(), "PyMUSIC")
sys.path.append(music_dir)
from src.base import... |
a8eb19438c7453cf3f1bfd559fa4b2fce2254157d3c98b2c2b3062ee4098691f | Jupyter | 12,434 | 381 | # %%
import numpy as np
import matplotlib.pyplot as plt
import os
os.environ["OPENCV_IO_ENABLE_OPENEXR"]="1"
import cv2
from os.path import join
import imageio.v2 as imageio
# %%
path2outs = "/home/alban/Documents/blender_testset/testset/"
#directory = 'images_eevee_patterns'
directory = 'images_floorpattern_eevee3p... |
9682d3a4c872efb96ce50a9f9118a4bafede5f49c2d6e3f3346e3b004f2b05e3 | Jupyter | 12,513 | 425 | # %% [markdown]
# Use EvoAug to generate OOD mutated sequences given a reference sequence (DeepSTARR).
#
# Mutations:
# - random shuffle: apply `tf.random.shuffle(seqs)` to seqs
# - mutagenesis: apply `RandomMutation(mutate_frac=0.25)` to seqs
# - evoaug: apply list of augmentations with `max_augs_per_seq=2` to seqs
#... |
707148bf849d3decb2cff3676cf794c4f1fc5cd46d33ea6e48ccdb7fcbe378a8 | Jupyter | 12,527 | 344 | # %%
import pandas as pd
import matplotlib
import matplotlib.font_manager as fm
fm.fontManager.addfont('/usr/share/fonts/truetype/msttcorefonts/Arial.ttf')
matplotlib.rcParams["font.family"] = "Arial"
import matplotlib.pyplot as plt
import seaborn as sns
# sns.set_theme(style = "ticks", font = "Arial")
from adjustText ... |
555cafb79445909d3f0668695666fb431a45b7188d1a76bf903725ef8020d45d | Jupyter | 12,529 | 328 | # %%
import os
import SimpleITK as sitk
import numpy as np
import random
import cv2
from skimage.measure import regionprops_table
import pandas as pd
# %%
folder_path = '' #path to top folder containing patient directories.
label_meta_data_path = '' #csv file with patient IDs and corresponding diagnostic labels.... |
05183ca89e52076122e3d9021f7553fb19ec42cc0460d59af119ee0213ba9d54 | Jupyter | 12,531 | 372 | # %%
import os
import tensorflow as tf
import numpy as np
from megnet.utils.models import load_model
print("=" * 60)
print("🔍 GPU DEBUG VE TEST SCRİPTİ")
print("=" * 60)
# 1. TensorFlow GPU kontrolü
print("\n1️⃣ TensorFlow GPU Durumu:")
print(f"TensorFlow versionu: {tf.__version__}")
print(f"CUDA build: {tf.test.is_... |
7f47289f3861bc604f2201436d0019b1e459821103ecb0e523ac01b1de9623df | Jupyter | 12,579 | 256 | # %% [markdown]
# <a href="https://colab.research.google.com/github/seisbench/seisbench/blob/main/examples/03b_creating_a_dataset.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# 
import matplotlib
# import matplotlib.font_manager as fm
# fm.fontManager.addfont('/usr/share/fonts/truetype/msttcorefonts/Arial.ttf')
from matplotlib import rcParams
rcParams["font.family"] = "Arial"
import matplotl... |
6b9c0562d4d57507d11d66e35ea14fa52e86bf048ec4a0882e19c2e5fd63cd78 | Jupyter | 12,646 | 439 | # %% [markdown]
# # PRELUDE
# %%
import matplotlib.pyplot as plt
import seaborn as sns
import cooler
import cooltools
import pandas as pd
import bioframe
import glob
import os
from matplotlib.colors import LogNorm, SymLogNorm
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
from cooltools.lib... |
89b0701a449842793ec65f3017baf7cf758e3abc51ec6670e9b7e4d7850b17ba | Jupyter | 12,689 | 324 | # %%
from models import models
from utils import *
from sklearn.metrics import mean_absolute_error
from sklearn.metrics import mean_squared_error
from sklearn.metrics import r2_score
from models.keras_vision_transformer import transformer_layers
from models.keras_vision_transformer import swin_layers
from sklearn.multi... |
c34d279ed99a49b6a613631de3abac93bd71a233609b840351b64b81122b4d34 | Jupyter | 12,694 | 398 | # %%
import re, time, warnings, os, sys, copy
import gzip, pickle
import numpy as np
import pandas as pd
import gzip, pickle
import scipy, sklearn, mne
import auxiliary as aux
import data, rsa
sys.path.append('../../spaces/')
import embeddings as emb
import pubplot as pub
import matplotlib.pyplot as plt
pub.styles.s... |
498ccd0894dfa1b8371346b5b1cd6c566003d78bc213df378d6bc1fbfcb4d53c | Jupyter | 12,759 | 334 | # %% [markdown]
#
# # ChemEmbed — Simple Testing Notebook (Single File)
# ## 1. Overview
# This Jupyter Notebook, ChemEmbed_Simple_Test.ipynb, serves as a self-contained testing environment for the ChemEmbed chemical structure prediction pipeline. It is designed to allow a user to execute the entire workflow—from data... |
357af19349f7d8ba304c150bd11fd9285956d4480d77e6a13cece6b78c7dfbb5 | Jupyter | 12,854 | 412 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import Normalize
from matplotlib.cm import ScalarMappable
from matplotlib.colors import ListedColormap
from scipy.stats import pearsonr
import scipy
import sys
sys.pa... |
a8b142c45ef5abaf1ea275d6d681a18a3a62d69f85d807106d9e9d8fccd68d87 | Jupyter | 12,860 | 453 | # %%
import sys
if "/rhome/naotok/.local/lib/python3.10/site-packages" in sys.path:
sys.path.remove("/rhome/naotok/.local/lib/python3.10/site-packages")
# %%
# import library
import numpy as np
import pandas as pd
pd.set_option("display.max_columns", 1000)
import scanpy as sc
sc.set_figure_params(dpi_save = 1000, ... |
b08ea60fd56016c09d5e2962d0e616921a4fb1c66a5553b33349cbb328c3dcfd | Jupyter | 12,894 | 284 | # %% [markdown]
# <a href="https://colab.research.google.com/github/yetinam/pyocto/blob/examples/02_velocity_models.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# . How to analyze the results, can be found in the figure repoducibility notebooks.
#
# Input for the functions can be downloaded from Zenodo
# %%
import t... |
21b933e5da58670e9b9a9eac7303d657d4c5ed75a2bd6545ce8a2cbbc6cdd3be | Jupyter | 13,010 | 250 | # %% [markdown]
# ## Plotting psychometric performance
#
# The goal of this notebook is to familiarize you with how to plot some basic metrics for psychometric quantification and visualize data.
#
# %%
import numpy as np # math and array handling
import pandas as pd # some functions to load data and handle t... |
b2286b9467ad7e0e24c20a7ea98bf1618fd4d11ccaf4c5afee98319e4bc48b5f | Jupyter | 13,049 | 621 | # %% [markdown]
# ## Import Packages
# %%
import os
import yaml
import pandas as pd
import numpy as np
import scanpy as sc
import scipy.io
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
%config InlineBackend.figure_format = "retina"
# %%
# verbosity: errors (0), warnings ... |
d55d4a2f142c93f158932b97a4927ee7e340d0f731dd4062f2930c42f52d4bd9 | Jupyter | 13,052 | 521 | # %% [markdown]
# ## Downloading the data
#
# We are downloading a dataset with a total size of 65 GB - so take a deep breath, make yourself a tea and take a cookie, and relax :-)
# %%
filename = {'40282102': '002.tiff',
'40282099': '001.tiff',
'40282096': '016.tiff',
'40282105': '008.tiff',
'40282111': '003.tiff... |
8b9b90b02d7d154b093166873b89aec9e6c4d6ba8c20e16dbfcea578dd6971f5 | Jupyter | 13,067 | 416 | # %%
import brainpy as bp
import brainpy.math as bm
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
from matplotlib.colors import Normalize
from matplotlib.cm import ScalarMappable
from matplotlib.colors import ListedColormap
from scipy.stats import pearsonr
import scipy
import sys
sys.pa... |
e1233ee565fa5341fc97c0266a66e5d7bea6dc8b9d0d54ebcb5a58188b170617 | Jupyter | 13,090 | 337 | # %%
import nrrd
import pandas as pd
import numpy as np
import pickle
import os, ast, re
import json
from voxcell import RegionMap
import multiprocessing as mp
# %% [markdown]
# # USE annotation hierarchy generated densities
# Use both new json and evolved CCFv3a to produce average regional cell type densities
# %%
... |
09c6261ed40a14dfad03b37f87e77928048624005e0ac3cf4cc021e27338ed39 | Jupyter | 13,147 | 365 | # %% [markdown]
# # Site Effect illustration plots
# %%
import pandas as pd
import os
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.lines as mlines
import re
import pickle
from pathlib import Path
import matplotlib.patches as mpatches
from sklearn.prepro... |
5d8bbf8343141bd544b6e305ac722dd59d2915961bbfaf4444d21b9ee78e3d21 | Jupyter | 13,200 | 249 | # %% [markdown]
# # Slow/fast spindles
#
# This notebook demonstrates several ways to differentiate between slow and fast spindles using YASA. Notably, we will see many ways to detect the peak frequencies of these two types of spindles. But, first, a primer on the distinction between these two types of spindles:
#
# ... |
5059b5d982aec06fc15ed1849e56ba31445a8a0c7560344d4d0f750fa9ac713c | Jupyter | 13,213 | 404 | # %%
import os
import sys
import scipy
import numpy as np
import pandas as pd
import scanpy as sc
import seaborn as sns
import scipy.io as sio
import anndata as ad
import matplotlib.pyplot as plt
os.chdir("/data/wuqinhua/scPhase/Lung")
# %% [markdown]
# # 1. Cell-level
# %%
adata = sc.read_h5ad("./ensemble_adata_wit... |
401300a252799096ab188c8d9c9ff9c497cedf551156e81d8106ae4b7cf600e5 | Jupyter | 13,218 | 370 | # %%
import xml.etree.ElementTree as ET
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from mne.viz import plot_topomap
# === 1. Channel mapping and coordinates ===
channel_map = {
"EEG 1": "Fp1", "EEG 2": "Fp2", "EEG 3": "F3", "EEG 4": "F4",
"EEG 5": "C3", "EEG 6": "C4", "EEG 7": "P3",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.