sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
4cd7d5280689509b0ac421ca0f418fd72d3e3a97eeb1a6dd37a3a6bd16b75468 | Jupyter | 9,551 | 367 | # %%
import anndata
import scanpy as sc
import pandas as pd
import numpy as np
import torch
from tqdm.auto import tqdm
# %%
torch.set_float32_matmul_precision('high')
# %% [markdown]
# ## Download data
# %%
# download from scVelo: https://github.com/theislab/scvelo/blob/main/scvelo/datasets/_datasets.py#L278-L302C1... |
7581b628b9f85cf7fe9f88626e6093fdd437e4a51c4a82c4e165b1184df2ee15 | Jupyter | 9,573 | 336 | # %%
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# # to interacte with plot
%matplotlib widget
import csv
import numpy as np
import pandas as pd
import ptitprince as pt
import matplotlib.pyplot as plt
import seaborn as sns
import os
import re, seaborn as sns
import numpy as np
from mpl_toolkits.mplot3d import Axes... |
a0eb93cb717cec15dc45bc8eb3d1a07f717d8649938e3b0b6343a05b42d7b3f6 | Jupyter | 9,621 | 223 | # %% [markdown]
# # Hungarian Chickenpox Tutorial
#
# <a
# target="_blank" href="https://colab.research.google.com/github/google/bayesnf/blob/main/docs/tutorials/BayesNF_Tutorial_on_Hungarian_Chickenpox.ipynb">
# <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
# </a>
# %%
# D... |
3c9d121ed246e70b3d332121947c497f92d1e21e55c8a3de081a54ae73217c79 | Jupyter | 9,640 | 387 | # %%
# required packages: countdown-timer pyserial numpy av
# %%
%load_ext autoreload
%autoreload 2
# %%
import numpy as np
import subprocess
import datetime
import multiprocessing as mp
import sys, time
#sys.path.append('simple_pyspin/')
from multicamera_acquisition.simple_pyspin import Camera
import PySpin
from cou... |
14cf19d217f4a97357ca70a89fda2439ce50ff7ffcbde758d9a48e3529b2f778 | Jupyter | 9,644 | 304 | # %%
%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 glob
import uuid
import pathlib
import random
import platform
import torch
import torchvision
import numpy as np
import scipy a... |
1bc7af53a0f30deaf5ce747a8a6f803c0088d67b27d9595894e9e0b9dbf41b91 | Jupyter | 9,659 | 284 | # %% [markdown]
# # Fine-tune a PyTorch Lightning Text Classifier with Ray Data
#
# <a id="try-anyscale-quickstart-lightning_cola_advanced" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=lightning_cola_advanced">
# <img src="../../../_static/img/run-... |
4f924a118e992f9dcd443248d8ef64756c70cef9e60705d2d9834f5d822f5174 | Jupyter | 9,665 | 277 | # %%
using Distributed
addprocs(8);
# %%
@everywhere using PulseInputDDM, MAT
import Statistics: mean
# %%
ratnames = ["B068","T034","T036","T063","T030", "T035","T011","B053", "T080","T103","E021"];
dt, n, cross = 1e-2, 53, false
data_path = joinpath(abspath(joinpath(pwd(), "..")), "data/by_session");
# %%
region, ... |
3bd6957bdc02270f2d7744733c5c3a6fd81ed84a28be1cba9cee9c49dab64d48 | Jupyter | 9,695 | 335 | # %%
print(__doc__)
import numpy as np
np.random.seed(237)
import matplotlib.pyplot as plt
from skopt.plots import plot_gaussian_process
# %%
noise_level=0.
def f(x):
return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2))
# %%
# Plot f(x) + contours
bounds = np.array([[-2.0, 2.0]])
x = np.linspace(bounds[:, 0], bo... |
30086e04e03eafbaedf958dd81eb4fcd595a7c633b3be1b12d8574080bfe180f | Jupyter | 9,699 | 309 | # %% [markdown]
# # Table of Contents
#
# 1. [Import & Set Up](#import_everything)
# 2. [Load data](#load_data)
# 3. [Get the parameter that's being adjusted and the values](#Get_the_parameter_thats_being_adjusted_and_the_values)
# 3. [Plot learning rate vs. within pair correlation (pre- and post-learning)](#Plot_lear... |
759f7ad3428533e8832f4dade4e15ef16eec2b0614f2b9433f0136cced7e5216 | Jupyter | 9,728 | 214 | # %% [markdown]
# # STARDUST (full version)
# %% [markdown]
# This STARDUST interactive full version Jupyter Notebook allows for STARDUST signal determination and feature extraction. This version of analysis is ROA-based and contains cell segmentation. Functions are defined and imported from util.py. Use help(function... |
c445bbe6032daf3e5a165bf647cb56d62fd47d7b8a3cbf4f4c2e876c0308c28f | Jupyter | 9,760 | 295 | # %% [markdown]
# # Parameter Server
#
# <a id="try-anyscale-quickstart-plot_parameter_server" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=plot_parameter_server">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstart">
# ... |
68845eae024098d9f1a8cc21475c0cdfafc0414ae1bc1589fb3c4321b77d3bed | Jupyter | 9,769 | 433 | # %%
import pandas as pd
import numpy as np
# %%
def set_term(column1,column2):
if not pd.isnull(column1):
return column1
if not pd.isnull(column2):
return column2
else:
return np.nan
# %%
def set_term_list(column1,column2):
if isinstance(column1,list):
return column1
... |
0e4624d0982205ce739c440e9b786a2f1999c24729ca96fc391dd7aee3790956 | Jupyter | 9,786 | 235 | # %%
from multiprocessing.pool import ThreadPool
import subprocess
import os
path_project = "/home/conchae/prediction_depolymerase_tropism/prophage_prediction/depolymerase_decipher/ficheros_28032023"
path_pdb = f"{path_project}/sword2_DepoSeq_pt2"
path_db = "/home/conchae/depolymerase/RefDepo_domains/RefDepo_domains_d... |
e79eb53153f39e554a28f17695bef9c0f6376c1821340b5b02bb3dfc812ee9db | Jupyter | 9,810 | 348 | # %% [markdown]
# # Imports
# %%
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from tqdm.auto import tqdm as pbar
import torch
import torch.nn as nn
import pickle
from multisensory import ClassicalTask, BalancedComodulationTask, DetectionTask
plt.style.use('./style_sheet.mplstyle')
path = 'C... |
4d1dba461b4d241f403ea0c6b74ff337c20a15918c26d82f0f58cd09a04eb425 | Jupyter | 9,836 | 273 | # %%
from google.colab import drive
drive.mount("/content/drive", force_remount=True)
# %% [markdown]
# **Load Data**
# %%
import matplotlib.pyplot as plt
import numpy as np
import scipy.optimize
#Tableau of standard colors
tableau20 = [(31, 119, 180), (255, 127, 14), (44, 160, 44), (214, 39, 40),(148, 103, 189),
... |
a2cda31c3c9d6df7d491cfa42d15d8933191e777d3b19d8a30f4c32d8755b70c | Jupyter | 9,845 | 284 | # %%
import importlib
import lisa
lisa = importlib.reload(lisa)
from lisa.core.data_interface import DataInterface,PACKAGE_PATH
from lisa.core.genome_tools import Genome
from lisa.core.utils import indices_list_to_sparse_array
from lisa.core import data_interface
data_interface = importlib.reload(data_interface)
impo... |
25e38f1f90006ca285c8947b3f23a435b27cf8b2941f6d433501edc22ed69aca | Jupyter | 9,857 | 246 | # %% [markdown]
# (tune-analysis-guide)=
#
# # Analyzing Tune Experiment Results
#
# <a id="try-anyscale-quickstart-tune_analyze_results" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune_analyze_results">
# <img src="../../_static/img/run-on-anys... |
ca2c1597739e544f125b6f2bb039bfd721a7f3182b6c2991ec95e9f30c5fa119 | Jupyter | 9,896 | 220 | # %% [markdown]
# # Object Detection Batch Inference with PyTorch
#
# <a id="try-anyscale-quickstart-batch_inference_object_detection" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=batch_inference_object_detection">
# <img src="../../_static/img/run... |
6c69daa697d3b0295a1924a7ef3f065daabc7f2b1096afc427869c20851970ee | Jupyter | 9,918 | 193 | # %% [markdown]
# # Load the library
# %%
from signed_module_partition import *
# %% [markdown]
# # Load an example network
# %%
# Example graph for module partition
session = '797828357'
stimulus = 'spontaneous'
G = load_graphs(directory='./files/adjacency_matrices', session=session, stimulus=stimulus, weight=True)... |
1415930ad82b6e00fde7a1f4fa55f4d6a867c6182992697da2428dd258a60fdb | Jupyter | 9,957 | 227 | # %%
import xarray as xr
# %% [markdown]
# <!-- (data-guide)= -->
# # WeatherBench 2 Data Guide
#
# One core part of WeatherBench 2 are ready-to-use, cloud-based datasets. This page lists and describes all the available datasets.
#
# The datasets are stored in this public Google Cloud bucket: [`gs://weatherbench2/da... |
2cf7fbe1c2cefbb1ae1fb5269947d5780422f56d155d47d5eaa73fe93c6922d4 | Jupyter | 9,982 | 191 | # %% [markdown]
# # Spherical Deconvolution with Global Constraints
# %% [markdown]
# Constrained Spherical Deconvolution (CSD) *(Tournier et al. 2007)* is one of the most proven ways to estimate Fiber Orientation Distributions (FODs) that describe the orientation of the white matter tissue. In short, CSD's *single-sh... |
f121566c60dbce4e1224d8831ee6e151c08634ddc228d74f3308a053a3e4d9f5 | Jupyter | 10,039 | 266 | # %%
from datasets import Dataset
from sklearn.model_selection import train_test_split, GroupShuffleSplit
from transformers import AutoModelForTokenClassification,AutoTokenizer, TrainingArguments, Trainer
from transformers import DataCollatorForTokenClassification
from evaluate import load
import numpy as np
import p... |
069167ea573c0eb2aa4e64f3c97d657d82e9c8390a7196540fa19b9c22bda852 | Jupyter | 10,159 | 360 | # %%
import matplotlib.pyplot as plt
import numpy as np
import torch
from ntd.utils.plotting_utils import (
FigureLayout,
basic_plotting,
plot_overlapping_signal,
plot_sd,
)
from ntd.train_diffusion_model import init_dataset
from ntd.utils.utils import path_loader
FL = FigureLayout(
width_in_pt=3 ... |
432880bcde54193b88400ea6df2d9cf984c2dd99a3ca3184c1b6e9a520324a27 | Jupyter | 10,159 | 281 | # %% [markdown]
# # Predicting sentiment on the IMDB dataset
# %%
!date
# %% [markdown]
# In this notebook, we show you how to train an RNN to classify movie review sentences. We mostly start from scratch, so that you should be able to plug in your own dataset without too much hassle. Furthermore, we explain some bes... |
4b024ad011ad00a0b21e8215962e12b19fd82fcc0e9205be12731ebd4b360d9a | Jupyter | 10,162 | 243 | # %% [markdown]
# ## Import all necessary packages to notebook
# %%
import mat73
import numpy as np
import pandas as pd
import os
import hdf5storage
# %% [markdown]
# ## get mat files and compile them to excel
# %%
##---------------------------------------------------------------
def find_indices(array, freq_bands):... |
1672ac3b2f52bf232927634c0cca1362e4d046ee384b9f9991461149957f84f9 | Jupyter | 10,198 | 297 | # %%
rsync -avzhe ssh \
conchae@garnatxa.srv.cpd:/home/conchae/PhageDepo_pdb/Deposcope.esm2_t12_35M_UR50D.2203.full.model \
/media/concha-eloko/Linux/depolymerase_building
rsync -avzhe ssh \
conchae@garnatxa.srv.cpd:/home/conchae/PhageDepo_pdb/script_files/esm2_t12_35M_UR50D__fulltrain__finetuneddepolymerase.2103.4_l... |
3ec88ff13003c90db4ba30539687a454cd26aeda503d1db63f9fc87cbcf3c643 | Jupyter | 10,213 | 270 | # %% [markdown]
# # Running Tune experiments with Optuna
#
# <a id="try-anyscale-quickstart-ray-tune-optuna_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-optuna_example">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-... |
c64f58b0283590e3ea5a31b94ffd500c25be4166b1e40d253931715bbd6dff73 | Jupyter | 10,245 | 196 | # %% [markdown]
# Figure 5 data analysis
# ============
# %%
# Only run this code cell if you are not running this notebook from the binder
pkg install -forge io statistics tablicious
pkg install "https://github.com/gnu-octave/statistics-resampling/archive/refs/heads/master.zip"
pkg load io statistics tablicious stati... |
2f3f54e064d6ad9d4d9ffe795412f66f83d58cac00f2fa9a7cbb7adcebf384e7 | Jupyter | 10,247 | 344 | # %% [markdown]
# # Imports
# %%
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import copy
from tqdm.auto import tqdm as pbar
from scipy.integrate import quad
from scipy.special import erf
from scipy.interpolate import griddata
import warnings
warnings.filterwarnings... |
3c061c5aa91640f93dc53e5ad9b2085aeaa61c7f42c47f7633035700da85d1f8 | Jupyter | 10,288 | 382 | # %%
import numpy as np
np.random.seed(3)
from tqdm import tqdm
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings('error')
# %%
def change_state(x, x1, x2):
if np.array_equal(x, x1):
return x2.copy()
elif np.array_equal(x, x2):
return x1.copy()
def get_valence_sign... |
7958467872fb0e14dcc917b40fe32c9d3c1260e2c3546028b4ce6b83e11b22fd | Jupyter | 10,298 | 250 | # %% [markdown]
# # Domains: Analysis of direct neighbors - Fig 5B
# %% [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
import matplotlib
import seaborn as sns
import scipy
# %matplotlib inlin... |
198bf5c76b407ce4d409723ec6b48dc8817720866b2df6305cc1b131b41f3cf2 | Jupyter | 10,300 | 355 | # %%
%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 glob
import uuid
import random
import platform
import torch
import torchvision
import numpy as np
import scipy as sp
import sci... |
e8acfc4d168296bde168988e07904458afc3e505861146500c468099ff804b7d | Jupyter | 10,355 | 372 | # %% [markdown]
# # Additional results for Zeisel et al. 2015
# 1. Summary of cell type-disease association at the cell-type level.
# 2. Further UMAP for other diseases and traits
# 3. overlay spatial scores on UMAP.
# %%
%load_ext lab_black
import matplotlib
matplotlib.rcParams["pdf.fonttype"] = 42
matplotlib.rcPar... |
6bde8d00fe7e8849d206e339f713c448ba0132d5a83177f32fb022edaf84ec20 | Jupyter | 10,372 | 424 | # %%
# required packages: countdown-timer pyserial numpy av
# %%
%load_ext autoreload
%autoreload 2
# %%
import numpy as np
import subprocess
import datetime
import multiprocessing as mp
import sys, time
#sys.path.append('simple_pyspin/')
from multicamera_acquisition.simple_pyspin import Camera
import PySpin
from cou... |
9ad9816dcbdf16dd3fa9c4af1e30f1b18f7b6573690fdc3d8d8855735b4a690d | Jupyter | 10,376 | 280 | # %%
import csv
import numpy as np
import pandas as pd
import glob
from collections import Counter
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
import matplotlib.pyplot as plt
import pandas as pd
from operator import itemgetter
import seaborn as sns
from ... |
cd790bf61016c0e262e38c062e447c7fd6bccafe5c1c580e1cd5241b1f6f1392 | Jupyter | 10,379 | 298 | # %% [markdown]
# # Introduction to ML using ML4H
# %% [markdown]
# ## Prerequisites
# - Basic comfort with python, some linear algebra, some data science
# - Follow the instructions in the main [README](https://github.com/broadinstitute/ml4h) for installing ML4H
# - Now we are ready to teach the machines!
# %%
# Imp... |
11c394d8603f5329c8c20ac51f7d1f4c463f8cc3dbb46a807f5bf6bb89899962 | Jupyter | 10,423 | 300 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
c3d05c684449a296a9c076a8c0be9a3dbfd244375415d8100793eb240dab1d3c | Jupyter | 10,423 | 268 | # %%
import tirl
print(tirl.__version__)
import numpy as np
from tirl import fsl
from tirl.timage import TImage
import os
import sys
import nibabel as nib
import glob
from scipy.interpolate import griddata
from skimage.exposure import match_histograms
import shutil
import json
import geopandas as gpd
import rasterio.fe... |
457f1c9ebc403fd5f4f738a638b55832ef6f868ce1ef7faa7bbb5106e4a5d428 | Jupyter | 10,425 | 320 | # %% [markdown]
# ## This script compares the fraction of sequences with the RBP motif among the actual vs permuted edit clusters
# %%
import os
cwd = os.getcwd()
main_dir = cwd
print(main_dir)
# %%
import pandas as pd
from glob import glob
import pybedtools
from collections import defaultdict
import subprocess
fig... |
fd73de627b7d1a88e6ec03643537ed63c60a7fde9b593b49250d49b07ba716ef | Jupyter | 10,432 | 274 | # %%
from config import TrainConfig, InferenceConfig
from train import ModelConfig, get_data, get_model, trainer
from inference import InfConfig, get_trained_model_config, get_trained_model, denoise_data
from torchsummary import summary
import matplotlib.pyplot as plt
import numpy as np
import cv2
import torch
import o... |
9530ab99d316f30bc566602c47c58aa1a312df114df81523d05543178e431502 | Jupyter | 10,441 | 249 | # %% [markdown]
# # Image Classification Batch Inference with PyTorch
#
# <a href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=image-classification-batch-inference-with-pytorch&redirectTo=/v2/template-preview/ray-data-batch-image-classification">
# <img... |
894dbfaced8a46c8851bce89b873dcb3381ca30672fc97e29ec96327bbca3c1a | Jupyter | 10,445 | 246 | # %% [markdown]
# # Deep-dive into trained models
#
# Recall the high-level structure of NeuralGCM models, from Figure 1 of the
# NeuralGCM paper:
#
# 
#
# In code, trained models are encapsulated in a
# {py:class}`neuralgcm.PressureLevelModel` object, in particular the
# {py:... |
42c5fc30ccbbfd149e005b6e27b6e8c77ff9a659133cdc4059eec73e7d0ffb73 | Jupyter | 10,452 | 400 | # %%
# required packages: countdown-timer pyserial numpy av
# %%
%load_ext autoreload
%autoreload 2
# %%
import numpy as np
import subprocess
import datetime
import multiprocessing as mp
import sys, time
#sys.path.append('simple_pyspin/')
from multicamera_acquisition.simple_pyspin import Camera
import PySpin
from cou... |
29139e092d95be30ec3562368ccd9e9b36c8a5679a9193bc648c47b24feeb900 | Jupyter | 10,461 | 370 | # %%
!pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps
# %%
from os.path import join
import numpy as np
import pandas as pd
import lightning.pytorch as pl
import dask.dataframe as dd
import torch
import matplotlib.pyplot as plt
from cellnet.estimators import EstimatorCellTypeClassifier
from cellnet.mode... |
8b2309c39a0ff172b3eab32438761dd9fdff18ae4d749ca801d00d3afd28f3da | Jupyter | 10,464 | 287 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
c94dd8162efb37f4d609553c1aa0a5c5683cfe13fd56a8b7fe9f88834b8ec7f1 | Jupyter | 10,476 | 250 | # %% [markdown]
# # Machine learning and deep learning methods applied to predicting customer status
#
# Purpose: Predict active and not active clients based on the proposed data structure and naive data structure. Here, we implemented Support Vector Machines (SVM), Random Forest (RF), K-nearest Neighbours (KNN) and L... |
2a122c200c5cfca350b349ab00874f56e97333b07c471d02b86869cb1eedf543 | Jupyter | 10,509 | 325 | # %% [markdown]
# # Cluster analysis based on naturalistic stimuli responses
#
# This notebook illustrates how to cluster the models of an ensemble after nonlinear dimensionality reduction on their predicted responses to naturalistic stimuli. This can be done for any cell type. Here we provide a detailed example focus... |
b9fab3f8e65b0f16e1659dc35eb9dc75754cc192fba36e2e7d8ac3325536f1b3 | Jupyter | 10,520 | 289 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
119a88c0d1bfac97b0d82fb7b44c6eb66293901d5fd876d217a90ecff2178bcb | Jupyter | 10,524 | 242 | # %% [markdown]
# ## Import all necessary packages to notebook
# %%
import mat73
import numpy as np
import pandas as pd
import os
import hdf5storage
# %% [markdown]
# ## get mat files and compile them to excel
# %%
##---------------------------------------------------------------
def find_indices(array, freq_bands):... |
65513a1a905a6e6737b185e196fd9859005d7a4ca5df5a488fc4ec6730b69668 | Jupyter | 10,537 | 392 | # %% [markdown]
# # Power Monitoring
#
# This notebook demonstrates how to monitor the power consumption of the speck2e devkit.
# %%
! pip install matplotlib
# %% [markdown]
# %%
import samna
import samnagui
import time
import torch
import socket
import matplotlib.pyplot as plt
import matplotlib.font_manager as fo... |
d8491b9dc0efb8ab52747579570db8e50ff0c485d0c5f6d526240f974f745181 | Jupyter | 10,543 | 253 | # %% [markdown]
# # Machine learning and deep learning methods applied to predicting customer status
#
# Purpose: Predict active and not active clients based on the proposed data structure and naive data structure. Here, we implemented Support Vector Machines (SVM), Random Forest (RF), K-nearest Neighbours (KNN) and L... |
8738ea084211aba97f917cbdf595828e2fb4c88a9de9050d090e8e428efb88ca | Jupyter | 10,621 | 391 | # %%
import matplotlib.pyplot as plt
import numpy as np
import torch
from ntd.train_diffusion_model import init_dataset
from ntd.utils.plotting_utils import (
FigureLayout,
basic_plotting,
plot_overlapping_signal,
plot_sd,
)
from ntd.utils.utils import path_loader
FL = FigureLayout(width_in_pt=3 * 397... |
673926bb073ae072529010a7f6303f040e748e38d3b551f9421fa3ef75a795bb | Jupyter | 10,622 | 390 | # %%
# required packages: countdown-timer pyserial numpy av
# %%
#from llpyspin import secondary, primary
import numpy as np
import matplotlib.pyplot as plt
import os, time, serial, glob, struct
def packIntAsLong(value):
"""Packs a python 4 byte integer to an arduino long"""
return struct.pack('i', value)
d... |
1abd7e3d0aa95a499cadc4d7abd4c42dfebe9971c0eef88dc0f41558e68cc30c | Jupyter | 10,646 | 221 | # %% [markdown]
# # Batch Prediction with Ray Core
#
# <a id="try-anyscale-quickstart-batch_prediction" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=batch_prediction">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstart"... |
17631d2d15501d07be93508131d9471367c068717fa1428792484ab1e50ec0b5 | Jupyter | 10,685 | 256 | # %% [markdown]
# # This demo notebook, is a detailed guide throught the Unit Match pipeline.
#
# This notebook is only recomened if you want more detailed look at Unit Match, or have unconventional data
# %%
%load_ext autoreload
%autoreload
import sys
from pathlib import Path
import UnitMatchPy.Param_fun as pf
imp... |
199796a10e76a9977f04be909bb94f341e0cb58388cce15464a5781ff398cba4 | Jupyter | 10,700 | 305 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
17017f79c83d82628753498cdb5645dba9fb85f44b5ed4fa222225c724570c11 | Jupyter | 10,773 | 333 | # %%
import importlib
import lisa
lisa = importlib.reload(lisa)
from lisa.core.data_interface import DataInterface,PACKAGE_PATH
from lisa.core.genome_tools import Genome
from lisa.core.utils import indices_list_to_sparse_array
from lisa.core import data_interface
data_interface = importlib.reload(data_interface)
impo... |
816c222944eefc7ee04e1ea8e9b6c17941de96b677e4ee4605af43ceca220a30 | Jupyter | 10,817 | 326 | # %% [markdown]
# # Spike Count Visualization
#
# This tutorial demonstrates the way of visualizing the spike count of the last DynapCNN layer.
# %%
! pip install matplotlib
# %%
import random
import time
import samna
import torch
import matplotlib.pyplot as plt
from sinabs.from_torch import from_model
from sinabs.l... |
6134f86ae5706b022ac5fbb9f1a3454f48512f03520877682a78a69030a6c1ec | Jupyter | 10,859 | 332 | # %% [markdown]
# ### 2.2 CNN Models - Test Cases
#
# The trained CNN model was performed to a hold-out test set with 10,873 images.
#
# The network obtained 0.743 and 0.997 AUC-PRC on the hold-out test set for cored plaque and diffuse plaque respectively.
# %%
import time, os
import torch
torch.manual_seed(42)
fro... |
e28de5dfc208188832138fb6774b71f8e10fd2078455a4942bce9aa83299ba59 | Jupyter | 10,893 | 369 | # %%
print(__doc__)
import numpy as np
np.random.seed(237)
import matplotlib.pyplot as plt
from skopt.plots import plot_gaussian_process
# %%
noise_level = 0.1
def f(x, noise_level=noise_level):
return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2))\
+ np.random.randn() * noise_level
# %%
# Plot f(x) + c... |
c1343c0e69bd096b0f966613dc0a78dc692d75d2ceb3d63a0820f9f7b69bbd1e | Jupyter | 10,928 | 320 | # %%
import numpy
import json
import os
import torch
import io
import pickle
import matplotlib
import random
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
class PrefNet(nn.Module):
def __init__(self, nb_obj=2, middle_size=10):
supe... |
941627a88a0d239ab886dcea5e6ddc2d8884db01fe716ec54fae79fabb16c153 | Jupyter | 10,939 | 367 | # %%
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.gridspec as gridspec
import matplotlib as mpl
from matplotlib.lines import Line2D
import torch
import pickle
import os
# %%
from lib.dataset_config_parser.trained_model_config_parser import parse_prefit_gl... |
06b72e710bc0dc2c61ba217b5b1fd8217c9b893afdf199bb2b689a413dc9f19e | Jupyter | 10,942 | 333 | # %% [markdown]
# ## This script outputs the actual vs permuted eclip overlap fraction of the edit clusters
# %%
import os
cwd = os.getcwd()
main_dir = cwd
print(main_dir)
# %%
import pandas as pd
from glob import glob
import pybedtools
shuffled_dir = main_dir + '/shuffled_confident_clusters/'
shuffled_dir_invivo =... |
a0dc9b196c70c8b97e9747dbb18ee3012b1076861147f08e28321a6640442aca | Jupyter | 10,946 | 310 | # %% [markdown]
# # Learning to Play Pong
#
# <a id="try-anyscale-quickstart-plot_pong_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=plot_pong_example">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstart">
# </a... |
d0f7c17b9c581bf367b5af3fe633ba996de390d07458eb8be66a6e927192904e | Jupyter | 10,946 | 294 | # %%
from os import system, listdir, chdir, mkdir
from os.path import isdir
import os
residues_court=["164","211","224","323","337","401","412","473"]
residues_moyen=['37', '63', '98', '100', '137', '210', '237', '295', '301', '331', '335', '364', '512', '626', '629', '661']
residues_c=",".join(residues_court)
residu... |
2fda393266f01a08b251dc0a0348e358f2ee98c59dfc5595edfce273d709b0d3 | Jupyter | 10,956 | 497 | # %% [markdown]
# # Forward Simulation of 2D VEP model at Source level
# %%
import os
import sys
import time
import errno
import time
import timeit
import numpy as np
import numba
from numba import jit
import matplotlib.pyplot as plt
from matplotlib import colors, cm
# %%
import warnings
warnings.simplefilter("ign... |
8ddd6be6ae7c2b25b406ea175d101a33e06a258177f8fd2224cd0074190e8311 | Jupyter | 10,999 | 299 | # %% [markdown]
# # Using PyTorch Lightning with Tune
#
# <a id="try-anyscale-quickstart-tune-pytorch-lightning" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune-pytorch-lightning">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-anysc... |
5b5fc94d5cf1c715aec1b71653e6e30f6b06a7faf901a4f46172d76deffa3d41 | Jupyter | 11,022 | 401 | # %% [markdown]
# In this notebook, we propose a demonstartion of bulk RNA-seq to single cell RNA-seq analysis in omicverse. We apply our implementation as well as the original code on the bulk data of Alzheimer's disease.
#
# # bulk2single
#
# ## Setting up data
# %%
import scanpy as sc
import pandas as pd
import n... |
0fcdba021d836d46e640913345fd55f95606d8c1ec62145b337e800e05304efe | Jupyter | 11,057 | 286 | # %%
import torch
import torch.nn as nn
from sinabs.backend.dynapcnn import DynapcnnNetwork
from sinabs.layers import Merge, IAFSqueeze, SumPool2d
from sinabs.activation.surrogate_gradient_fn import PeriodicExponential
import sinabs.layers as sl
from torch.nn import CrossEntropyLoss
from torch.optim import Adam
from ... |
4c1437be079f357023dc23fbe47e9b50005b1572cc85b4e9e0d7cb05873f756f | Jupyter | 11,225 | 300 | # %% [markdown]
# ##### top
# %% [markdown]
# # Simulate potential span and range of reliabilities estimated using attenuation correction across days
#
# This ntb looks at synthetic data vs real data to estimate the range of possible reliabilities that we could observe by chance if we use attenuation correction on tw... |
e942187988200f0e8ae2e259446ff13a65ec8bee89d3d0921e18d072ef47e898 | Jupyter | 11,271 | 257 | # %%
try:
get_ipython().magic(u'load_ext autoreload')
get_ipython().magic(u'autoreload 2')
except:
print('NOT IPYTHON')
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
import caiman as cm
from caiman.source_extraction import cnmf
import boke... |
2c92a3ad7a9389d7b6e618bbbcd62866a3c8d56ac068f3b2faa6922f594720c7 | Jupyter | 11,286 | 335 | # %%
import copy
import datetime
import json
import os
import numpy as np
import snntorch as snn
from snntorch import functional as SF
from snntorch import surrogate
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, TensorDataset
seed = 42
np.random.seed(seed)
torch.manual_seed(seed)
torch.ma... |
1bff4fa423101a728b7cfbe02765a87605295efffaa650d6d070abd0de7c046c | Jupyter | 11,394 | 333 | # %% [markdown]
# # The goal here is to benchmark the DpoDetection tool with other depolymerase detection tools
# ***
# # I. Gathering the testing Data :
# #### 77 phages candidates
# >Detected Dpos <br>
# >Missed Dpos <br>
# #### Beas Dpos
# #### Training set of the DpoDetection tool
# #### Pires Dpos ?
# ***
# # II... |
2d2d69443545ee2922f178e6ca12208ae0929a6f8f47410cbc599e436b7e7e3b | Jupyter | 11,446 | 343 | # %% [markdown]
# # Quick start
#
# In this tutorial, we will show case main features of scDRS using the [Zeisel & Muñoz-Manchado et al. 2015](http://linnarssonlab.org/cortex/) cortex data set.
#
# We have preprocessed the scRNA-seq data set and disease gene sets (which are used in our manuscript). Alternatively you ... |
e14c68db6e304c8d20f299500f8ac884a768d4fad8b49e3ffb9c0beb6429f792 | Jupyter | 11,447 | 351 | # %%
%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 tqdm.auto import tqdm
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib import colors
import numpy as np
from sci... |
1fde69be58e73b1130aeecffd3cae37f979dcd91221809ae048865dbfc511740 | Jupyter | 11,448 | 334 | # %% [markdown]
# <h1> Here we will be focusing more on the cnmf part and its main functions <h1>
# %%
try:
if __IPYTHON__:
# this is used for debugging purposes only. allows to reload classes when changed
get_ipython().magic(u'load_ext autoreload')
get_ipython().magic(u'autoreload 2')
exce... |
102cab7099270c55017f5ab411a0c32adbd15308ef3c70ea2af958c2b1b56e1f | Jupyter | 11,482 | 416 | # %% [markdown]
# # Morphological Snakes to modify manual annotations
# ______________________________________________________
#
#
# In this notebook we will try to automatically convert manual point annotations of anatomical structures in fetal brain US into area anotations.
#
# - We will use gimpformats to read th... |
3c2cfb4f882892e71183ab6df95c3472b3d2e2a1695bbad4814d58c0a56f9468 | Jupyter | 11,483 | 298 | # %% [markdown]
# # The final DpoDetection Tool :
# ***
# %%
from transformers import AutoModelForTokenClassification, AutoTokenizer
import torch
from torch import nn
import torch.nn.functional as F
import os
import numpy as np
import tqdm
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ign... |
f4391ca3201b4e8e6ae2c9692db397f9428a850144c41f6a494021b5fdc00681 | Jupyter | 11,509 | 363 | # %%
%load_ext autoreload
%autoreload 2
# %%
from functools import partial
import pydicom
import math
import copy
import glob
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 ... |
3d19a128e1e867ccf48adc8f199a4362286c91bf39db2190448ff7a36cf4c6ec | Jupyter | 11,511 | 465 | # %%
import numpy as np
np.random.seed(1)
from tqdm import tqdm
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from scipy.optimize import fsolve
# %%
x1, x2 = np.array([1., 0.]), np.array([0., 1.])
def sigma(y):
if y<0.05:
return 0.05
else:
return y#1.5*np.tanh... |
4495beeb8e6fc354d1212f5f200ed27d06c0190b139cb0347b8b0ae049761b1f | Jupyter | 11,524 | 327 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): Inference 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. Na... |
b97895c0b5a41889b91d403867e42be249b2bdea26159507ef1d520bbb8f1ac7 | Jupyter | 11,530 | 239 | # %% [markdown]
# # Introduction to Survival Analysis with ML4H
# %% [markdown]
# _Survival analysis_ is a core modeling paradigm of clinical ML that data scientists from other domains are unlikely to be familiar with. In survival analysis, the aim is to predict when an event might occur, such as a heart attack, strok... |
9ab6ab5751486e2227d3dff8cdea0b75bd5225341a239391f80b21209c9b3e5d | Jupyter | 11,560 | 412 | # %% [markdown]
# # Perform Experiments with DeepFace on LFW dataset
# %%
# built-in dependencies
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
import statistics
# 3rd party dependencies
import numpy as np
import pandas as pd
from tqdm import tqdm
import matplotlib.pyplot as plt
from sklearn.metrics import ac... |
59c61ecca55490ab86522d26e55510d6057a5c8a2afcbf0cd3a05201631c5def | Jupyter | 11,570 | 321 | # %%
%load_ext autoreload
%autoreload 2
# %%
%matplotlib inline
import numpy
import random
import time
import sys
import os
import tifffile
import io
import pickle
import matplotlib
import yaml
from matplotlib import pyplot
from PIL import Image
from tqdm.auto import trange
from skimage import filters
from pysted ... |
a241312ac6c2ba84ea7276279e3aed18b0a134567b12e876fe70691e87b6a484 | Jupyter | 11,571 | 358 | # %%
!pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps
# %%
import torch
torch.set_float32_matmul_precision('high')
# %%
import os
import pickle
from os.path import join
import numpy as np
import pandas as pd
import lightning.pytorch as pl
import dask.dataframe as dd
import matplotlib.pyplot as plt
impo... |
d3c5c8b3036e9f3082bb21c21e1ea6bedfb62d8796498eae8380b8d9c450cffa | Jupyter | 11,600 | 366 | # %%
import numpy
import yaml
import os
import glob
import sys
import random
import seaborn
import umap
import ipywidgets
from matplotlib import pyplot, gridspec, colors
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from skimage import io
from PIL import Image, ImageDraw
from banditopt import algorit... |
bb6e57f99ce884cb30c28e04b5dec9b0b8b9f65e6db2c11ef51aebbcb6888555 | Jupyter | 11,601 | 285 | # %% [markdown]
# # Neural space-time model example on differential phase contrast microscopy (DPC) data
# Jupyter lab demo for "Neural space-time model for dynamic multi-shot imaging" by Ruiming Cao, et al. (2024)
# %%
%load_ext autoreload
%autoreload 2
%matplotlib widget
import os
import numpy as np
import jax
impor... |
41cffeb92a19dc1a963103ea7ea486d36131d7f82bca0bff05a9073759f105d2 | Jupyter | 11,724 | 228 | # %%
suppressPackageStartupMessages({
options(stringsAsFactors = FALSE)
library(Matrix)
library(Seurat)
library(ggplot2)
library(dplyr)
library(stringr)
library(readr)
})
# %%
sessionInfo()
# %%
set.seed(2021)
df_biomart <- read.table("./mart_export_human_mouse.txt", header=T)
df_biomart$link = paste0(df_biom... |
2de3a2d7b5d8c59513de2b429d07eec2fc14e59bcad14100b56988e14846b111 | Jupyter | 11,776 | 342 | # %%
import pyreadstat
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy import stats
import seaborn as sns
import os
from Mymodule.ModelHandler import *
from Mymodule.Utils import *
from Mymodule.GradCam import *
from Mymodule.BatchHandler import *
from sklearn.model_selection import ... |
e361f8a5fb5d67275a97739185a72e748b3d6ec2c248e8df3de4b8f9eb9bbccc | Jupyter | 11,779 | 222 | # %%
suppressPackageStartupMessages({
options(stringsAsFactors = FALSE)
library(Matrix)
library(Seurat)
library(ggplot2)
library(dplyr)
library(stringr)
library(readr)
})
# %%
set.seed(2021)
df_biomart <- read.table("./mart_export_human_mouse.txt", header=T)
df_biomart$link = paste0(df_biomart$Mouse_ID,"-",df_... |
3280eb815a1b8a9c8aaedaec9d7f87a92f8f2d85cab1254a118422fcfabb84ce | Jupyter | 11,786 | 246 | # %%
import numpy as np
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import font_manager
import matplotlib.pyplot as plt
from tqdm import tqdm
import pickle
font_dirs = ["./"]
font_files = font_manager.findSystemFonts(fontpaths=font_dirs)
for font_file in font_files:
font_manager.... |
04f71a6fecd74008c4a9a9791a6c38a2dbbcd5bc26e7bcd413364addc5402029 | Jupyter | 11,801 | 367 | # %% [markdown]
# # Table of Contents
#
# 1. [Import & Set Up](#import_everything)
# 2. [Load in data](#load_files)
# 3. [Within Pair Correlation](#within_pair_correlation)
# 3. [Center of Mass](#c_o_m)
# 1. [distance apart](#distance_apart)
# 2. [error by overlap](#error_by_overlap)
# %% [markdown]
# # Impor... |
b40827cd6dbc94c2ac3502d081949541d9981d7a1a7c3987d5d004a472aff63f | Jupyter | 11,816 | 248 | # %%
import pandas as pd
# %%
#adjust datapath to reflect the location of data in your file system
datapath = "/Users/paulreginato/Google Drive/genome seq in situ/Analysis/191202_embryo_analysis/embryo_seq_data_tables/201125_embryo_data_table_Y_nonchromosomal_fixed2.csv"
source_data = pd.read_csv(datapath,index_col=Fa... |
a49b1c4ec98493c3b1411c9b15a67bae7c4c81c818ddb01d09ec243a13b30301 | Jupyter | 11,868 | 499 | # %% [markdown]
# # Figure 4
# %% [markdown]
# ## a
# %%
%load_ext autoreload
%autoreload 2
import matplotlib.pyplot as plt
import numpy as np
from flyvis import EnsembleView
from flyvis.analysis.visualization import plots
from flyvis.analysis.moving_bar_responses import plot_angular_tuning
# %%
EnsembleView(
... |
e15066cb148da07bf0adffbe1aa4d08d6f6c4ba0808874d8bb9efa3a6f12e5b8 | Jupyter | 11,878 | 338 | # %%
dataDir = "6lu7/log336h_6lu7/data10/"
proteinName = "6lu7" # if dataDir includes 6lu7, proteinName is 6lu7, otherwise 3zosA
proteinName += "_prepared"
# %%
#GUI-part
#jupyterlab
%matplotlib widget
#jupyter notebook
#%matplotlib notebook
#GUI
#%matplotlib ipympl
#%matplotlib inline
import pandas as pd
import json
... |
23813fd77665928d09307d33d8c3df477b3322a4d35de6ae43163dc3a58be220 | Jupyter | 11,884 | 334 | # %% [markdown]
# # Baroclinic instability
#
# This notebook uses dinosaur to run the baroclinic test case from [1]. By default we use T42 grid with 24 layers. For more accurate agreement consider using higher resolution (e.g. T85 and 32 model levels).
# We recommend using a GPU runtime for this notebook.
#
# [1]:
# ... |
351b80b0a3c122a0da64e03183fc8d5d45b0bb53c61c2d0e2417aa68aa5d73fb | Jupyter | 11,885 | 329 | # %%
! pip install -q -U git+https://github.com/google-research/dinosaur --ignore-requires-python
# %%
import functools
import dinosaur
import jax
import numpy as np
import matplotlib.pyplot as plt
import xarray
# %% [markdown]
# This notebook uses dinosaur to run the baroclinic test case from [1]. By default we use ... |
efebd485d9e09aacf05075640f06164014fd503746645ae730029d1f6f599bae | Jupyter | 11,890 | 397 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import os.path
import sak
import numpy as np
import scipy as sp
import scipy.signal
import pandas as pd
import json
import tqdm
import matplotlib.pyplot as plt
from scipy.stats import norm
# Data loader to un-clutter code
def load_data(filepath):
dic = di... |
60df23d4a571956c46bc77e6465f36ef05a4c05ae551798dfd27f1367fcc2e4d | Jupyter | 11,918 | 294 | # %% [markdown]
# # Machine learning and deep learning methods applied to predicting customer status
#
# Purpose: Predict active and not active clients based on the proposed data structure and naive data structure. Here, we implemented Support Vector Machines (SVM), Random Forest (RF), K-nearest Neighbours (KNN) and L... |
5f963a120ab5b0cbc65798bedbf935b5a9caa5065be45b575156934fdf0738cc | Jupyter | 11,930 | 409 | # %%
%load_ext lab_black
import os, sys
%load_ext autoreload
%autoreload 2
sys.path.append("/n/home12/khou/holystore/")
import matplotlib
matplotlib.rcParams["pdf.fonttype"] = 42
matplotlib.rcParams["ps.fonttype"] = 42
import paper_utils
import matplotlib.pyplot as plt
import scdrs.data_loader as dl
import pandas ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.