sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
ec468bd23bbb1ad9fecb7035b2b50c59db6bc2e4c96ec3c7b686fa90225256bc | Jupyter | 14,737 | 200 | # %%
In this tutorial, we will step line-by-line through implementation of a Bayesian linear regression model. Our data consists of mean single-unit firing rates from rat inferior colliculus in response to
varying depths of sinusoidal amplitude modulated auditory stimuli (see paper for details).
# %% [markdown]
# The ... |
baf7300fb08918778d98d5b73054f82365f1a59b3d8ba47f65778933484e46cc | Jupyter | 14,774 | 363 | # %%
import pandas as pd
import numpy as np
import re
from bs4 import BeautifulSoup
from sklearn.model_selection import train_test_split
from sklearn.neural_network import MLPClassifier
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import accuracy_score
import shap
from sklearn.feature_extraction.... |
2a22aceb0f0d59f69806a8338d1494d89bc74c6af83bde5bac137b9ac2b55e8e | Jupyter | 14,879 | 376 | # %% [markdown]
# # Fusion Chip Conversion Utility Example
#
#
# <a href="https://colab.research.google.com/github/IBM/aihwkit/blob/master/notebooks/analog_fusion.ipynb" target="_parent">
# <img src="https://colab.research.google.com/assets/colab-badge.svg"/>
# </a>
#
# ## 1) Goal of the notebook
# This is an ex... |
9a6352ce4f3824e50291023864f96d3f739b4b0b53c94e3c3f2ff7cc5edf9767 | Jupyter | 14,961 | 358 | # %% [markdown]
# # LeNet5 Analog Hardware-aware Training Example
# Training the LeNet5 neural network with hardware aware training using the Inference RPU Config to optimize inference on a PCM device.
#
# <a href="https://colab.research.google.com/github/IBM/aihwkit/blob/master/notebooks//analog_training_LeNet5_hwa.... |
ff60ff959c81f54d804610a2f39568a52a2ede846b444d1bf35122002557fbd8 | Jupyter | 14,971 | 366 | # %% [markdown]
# ### I. Load the data
# %%
from sklearn.model_selection import train_test_split
from sklearn.metrics import precision_score, recall_score, f1_score, confusion_matrix, accuracy_score
from transformers import AutoTokenizer
from datasets import Dataset
from transformers import AutoModelForTokenClassifica... |
c3f60ac69c3f4973d8b533bb7d079dacf61d0503259974f240d54e8be41f1df4 | Jupyter | 14,979 | 413 | # %% [markdown]
# See code at https://github.com/google-research/vision_transformer/
#
# See papers at
#
# - Vision Transformer: https://arxiv.org/abs/2010.11929
# - MLP-Mixer: https://arxiv.org/abs/2105.01601
# - How to train your ViT: https://arxiv.org/abs/2106.10270
# - When Vision Transformers Outperform ResNets ... |
ec7fcbe7e600b3298507f1e0f35b70c8de628ccd1b6f1f3cc28d8633bbc9ed62 | Jupyter | 15,001 | 382 | # %% [markdown]
# # Fusion Chip Conversion Utility Example
#
#
# <a href="https://colab.research.google.com/github/IBM/aihwkit/blob/master/notebooks/analog_fusion.ipynb" target="_parent">
# <img src="https://colab.research.google.com/assets/colab-badge.svg"/>
# </a>
#
# ## 1) Goal of the notebook
# This is an ex... |
e8e00553eec15205512983204806cc194fed2ee6a2b0afbd3a128b3c0c4b1444 | Jupyter | 15,015 | 360 | # %% [markdown]
# # LeNet5 Analog Hardware-aware Training Example
# Training the LeNet5 neural network with hardware aware training using the Inference RPU Config to optimize inference on a PCM device.
#
# <a href="https://colab.research.google.com/github/IBM/aihwkit/blob/master/notebooks//analog_training_LeNet5_hwa.... |
9ec130e65ee75eaa4cb2646625fcbea1f08905db850537b6803c6c954ad00b1c | Jupyter | 15,027 | 584 | # %%
%load_ext autoreload
%autoreload 2
# %%
import pandas as pd
metlin = pd.read_parquet(
"ccs-prediction/metlin-clean-all-columns.parquet"
)
# %%
metlin["correct_CCS_avg"] = round(
((metlin["CCS1"] + metlin["CCS2"] + metlin["CCS3"]) / 3), 2
)
# %%
# calculate murcko scaffolds using smiles
from rdkit impor... |
26bd09ef8fb26f6bf3e936a0b405cdb9f86a9faad194f3462a0b74f7872b3fed | Jupyter | 15,163 | 474 | # %% [markdown]
# <a href="https://colab.research.google.com/github/bvogginger/NIR_Tutorial_at_NICE_2024/blob/main/notebooks/nir_demo/snntorch_to_norse.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# # snnTorch to Norse (Sim2Sim)
#... |
a94c32649000e78dcb4e0a77b7cda85028c76c201409fe11f565b5666929b82d | Jupyter | 15,167 | 474 | # %% [markdown]
# # Held-Suarez Forcing Test
#
# This notebook uses Dinosaur to run Held-Suarez integration test[1]. In this test a heuristic forcing terms are added to the primitive equations to produce steady state solution. The goal is to reconstruct statistics of the equilibrium state.
#
# The notebook is split i... |
6f3823cbf18db107e20e67763fe940f05bd6a04ca21d406a78ca04eec525dc9c | Jupyter | 15,200 | 528 | # %%
%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 ... |
bbebed4b7d373468a18890fb26d241b17dd42444f7e2b3b247b42141f3df3f4a | Jupyter | 15,205 | 473 | # %%
! pip install -q -U git+https://github.com/google-research/dinosaur
# %%
import functools
import jax
import dinosaur
import numpy as np
import matplotlib.pyplot as plt
import xarray
units = dinosaur.scales.units
def dimensionalize(x: xarray.DataArray, unit: units.Unit) -> xarray.DataArray:
"""Dimensionalizes ... |
3d5097cf5f9db556f9668d13b025afa3f4f88d58a830c637cf8a1332ff407558 | Jupyter | 15,306 | 537 | # %%
import omicverse as ov
from omicverse.utils import mde
import scanpy as sc
import scvelo as scv
ov.utils.ov_plot_set()
# %%
adata=scv.datasets.dentategyrus()
adata
# %%
adata.obs['celltype']=adata.obs['clusters'].copy()
# %%
import numpy as np
import pandas as pd
bulk=pd.read_csv('data/GSE74985_mergedCount.txt.... |
8738263336cf31cd23bb45d040dfb1f33d54d98ac308830441a9ba84285cd299 | Jupyter | 15,335 | 414 | # %%
%load_ext autoreload
%autoreload 2
# %%
from argparse import ArgumentParser
import os
import os.path
import skimage
import skimage.segmentation
import sklearn.preprocessing
import sklearn.model_selection
import math
import pathlib
import glob
import shutil
import uuid
import random
import platform
import torch
i... |
bb8d5bfc9af783c5b4e0c76a1e541f4eb0f643067da297b14b35976fbaf8c1f8 | Jupyter | 15,343 | 369 | # %% [markdown]
# # Domains: features of domains and their synapses - Figure 6
# %% [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
from sci... |
07cb9d979e32b4811cbfb9c5e778477d05e2a3019d6c936e5d2af39877d9f7cb | Jupyter | 15,352 | 455 | # %% [markdown]
# # Seq2Seq Translation using skorch
#
# This notebook demonstrates how to use the code from the [sequence-to-sequence tutorial][1] with skorch!
#
# [1]: http://pytorch.org/tutorials/intermediate/seq2seq_translation_tutorial.html
# %%
import random
import matplotlib.pyplot as plt
import numpy as np
... |
7c21951bd2f961f8b6ff782c2701438e4c429a4df9215750430b14c7e093e46f | Jupyter | 15,358 | 372 | # %% [markdown]
# # Domains: features of domains and their synapses - Figure 6
# %% [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
from sci... |
54b1298fd822791c466ed1f64dd334935a37d65d2453be4ce5e8411654ab8d24 | Jupyter | 15,368 | 398 | # %%
# Import necesary libraries for data import/analysis
import pandas as pd
import numpy as np
import scipy
from scipy.io import loadmat
# %%
#!pip install kaleido
# %%
# Importing necessary libraries for visualization
import plotly # plotting engine
import plotly.graph_objects as go
from plotly.subplots import mak... |
188a6dc015c6f41894ef3b94e470840b128c0c56d9a1b79ef17c71b0873a11dc | Jupyter | 15,423 | 359 | # %% [markdown]
# # Play With Speck's DVS
#
# Speck integrates a Dynamic Vision Sensor(DVS) on the chip itself, the resolution of the DVS is 128 x 128. By modifying the "hardware configuration" object, the "DVS layer/Pre-Processing Layer" on the hardware can optionaly apply:
# - polarity merging.
# - pooling.
# - cro... |
12bf2141eaf6f4430d8c061b9dd337828561b179435feba28a6a8c75af2bb956 | Jupyter | 15,426 | 327 | # %% [markdown]
# ## Why Analog AI
#
# In-memory computing hardware increases the speed and energy-efficiency needed for the next steps in AI. Analog AI delivers radical performance improvements by combining compute and memory in a single device, eliminating the von Neumann bottleneck.
# Based on von Neumann architec... |
d142b9af7c21894538643468498cc060127b70e98f103aab7205c2992c319ee2 | Jupyter | 15,429 | 659 | # %%
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_density,
plot_overlapping_signal,
plot_phase_line,
plot_sd,
polar_hist,
)
from ntd.utils.utils im... |
4fc696b03f7a15fdf004c6d8ca0886ce3ad91b031fcae638ef3ae5c235bb6841 | Jupyter | 15,439 | 378 | # %%
using Distributed
addprocs(8);
# %%
@everywhere using PulseInputDDM, MAT, Flatten
# %%
x_joint = Vector(undef, 3);
x_choice = Vector(undef, 3);
# %%
ratnames = ["B068","T034","T036","T063","T030", "T035","T011","B053", "T080","T103","E021"];
dt, n, cross = 1e-2, 53, false
data_path = joinpath(abspath(joinpath(p... |
23ba18a89af9719f60168b92942acf5ed7a493a947b38df9cb119b40c0bf974e | Jupyter | 15,482 | 329 | # %% [markdown]
# ## Why Analog AI
#
# In-memory computing hardware increases the speed and energy-efficiency needed for the next steps in AI. Analog AI delivers radical performance improvements by combining compute and memory in a single device, eliminating the von Neumann bottleneck.
# Based on von Neumann architec... |
518b24208a2f8f02f1df0b31ec2b8bfb1f139ccf5850d8f2a005c6611b9fbd36 | Jupyter | 15,493 | 358 | # %%
from rabies.utils import recover_3D,recover_4D
import numpy as np
import SimpleITK as sitk
import pathlib # Better path manipulation
import nilearn.plotting
import pandas as pd
import matplotlib.pyplot as plt
import glob
bold_file = 'sub-015_ses-1_task-rest_acq-EPI_bold_combined.nii.gz'
confounds_file = 'sub-015... |
aa1e03bca28b5667f8934b400ed7a2e5b9217e7954c34900b8da061611daf2dd | Jupyter | 15,506 | 389 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): extending functionality
#
# ### Authors: [Malte Rasch](https://www.linkedin.com/in/malte-j-rasch-08731817/)
#
# The AIHWKit is highly configurable and can be easily extended and customized. In this notebook, we show exemplarily how custom functionali... |
73803b231c98f6e62ac1f2c759adfbb5e30b4f41451ba48282716a29cb453105 | Jupyter | 15,527 | 407 | # %% [markdown]
# # Bidsify TUAB
# > Script to convert the TUAB dataset to BIDS format.
# %%
import re
import os
import glob
import datetime
from joblib import Parallel, delayed
from pathlib import Path
import numpy as np
import pandas as pd
import mne
from mne_bids import write_raw_bids, BIDSPath
from mne.io.edf.e... |
a3f3dea00166da0e64b1c9977c4da36ea5617b46563a3c2aaeb0210e3ddd225b | Jupyter | 15,548 | 396 | # %%
from sklearn.datasets import fetch_california_housing
import pandas as pd
import numpy as np
import statsmodels.api as sm
import nibabel as nib
import matplotlib.pyplot as plt
from scipy.stats import percentileofscore
import os
from scipy.stats import rankdata
from scipy.stats import spearmanr
from sklearn import ... |
4f030678d40e9cefb907d440e4e646d12a23c50bbed73f31065dcc005826b5c5 | Jupyter | 15,588 | 390 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): extending functionality
#
# ### Authors: [Malte Rasch](https://www.linkedin.com/in/malte-j-rasch-08731817/)
#
# The AIHWKit is highly configurable and can be easily extended and customized. In this notebook, we show exemplarily how custom functionali... |
31d7acc6c1b41955cf559a07c042bc6558dcf44dcc8f6314a5c380a1493a3497 | Jupyter | 15,596 | 420 | # %% [markdown]
# # Generate synthetic data for the ml4h featured workspace
#
# This notebook is a companion to the ml4h Terra featured workspace, but it is not included in that workspace because it contains the *answers* to the *quiz*. It is checked into GitHub so that people can see how this static data was generate... |
780d2460080571d4ece3325d430bb8cd6022332b9c5a18d6c07380973fa71c7a | Jupyter | 15,623 | 416 | # %%
import numpy as np
import geopandas as gpd
import json
import slideio
import matplotlib.pyplot as plt
import numpy as np
import tifffile
import glob
import slideio
import matplotlib.pyplot as plt
import numpy as np
import tifffile
import os
from rasterio import features
import pandas as pd
from matplotlib.colors i... |
89fae2d7cfbf5edd3c01cbad4cbe3b08085775e419f0c4c304169b02fae2b42c | Jupyter | 15,632 | 430 | # %%
%pip install davos
import davos
davos.config.suppress_stdout = True
# %%
smuggle datawrangler as dw # pip: pydata-wrangler==0.2.2
smuggle numpy as np # pip: numpy==1.24.2
smuggle matplotlib.pyplot as plt # pip: matplotlib==3.7.0
from matplotlib.patches smuggle Rectangle
smuggle pandas as p... |
d459baa765bdb72d2a3a7ca5960aec1e0ebb0056a1bc72e224b9aa2a13e24371 | Jupyter | 15,656 | 311 | # %% [markdown]
# ## Pipeline for microendoscopic data processing in CaImAn using the CNMF-E algorithm
# <p><img src="../../docs/img/quickintro.png" /></p>
# This demo presents a complete pipeline for processing microendoscopic data using CaImAn. It includes:
# - Motion Correction using the NoRMCorre algorithm
# - Sour... |
8bedef9a1d057426394b11e76618a7c101ef133a56824495ab968078b4882eb1 | Jupyter | 15,673 | 423 | # %%
%pip install davos
import davos
%conda install pytables
davos.config.suppress_stdout = True
# %%
smuggle nltools as nlt # pip: nltools==0.4.7
smuggle nilearn as nl # pip: nilearn==0.10.0
smuggle nibabel as nib # pip: nibabel==5.0.1
smuggle datawrangler as dw # pip: pyd... |
9e77b2e6c1dce15e8ea0ab8871ef6bc87bcb58937a42ec00a96a33481205d86d | Jupyter | 15,725 | 354 | # %%
import sys
sys.path.insert(1,'../src_VI/')
import torch
from torch import nn
import numpy as np
import matplotlib.pyplot as plt
import xarray as xr
import copy
import pandas as pd
from torch.utils.data import Dataset, DataLoader
from full_slab_spike_model_constructor import *
from training_func import *
import pyr... |
2654f79e0c23b9c9a80fb46e08116065d58ecf230e2bbd2997ce223b97adbeaf | Jupyter | 15,807 | 288 | # %% [markdown]
# # RL Post-Training using Hugging Face TRL with GRPO
#
# This notebook builds on the TRL GRPO Example, [GRPO Trainer](https://huggingface.co/docs/trl/en/grpo_trainer), to fine-tune a Qwen2.5 0.5B model to answer math questions using the DeepMath-103k dataset and Group Relative Policy Optimization (GRP... |
2d8a73c87498a07c3d596feb07bd0d67055cc1716c461e8b45790c9065b5bc89 | Jupyter | 15,821 | 438 | # %%
import numpy as np
import nibabel as nib
import matplotlib.pyplot as plt
import os
import sys
import glob
import subprocess
from brainspace.gradient import GradientMaps
from scipy import stats
import random
import re
from scipy.sparse.linalg import svds
import pandas as pd
import seaborn as sns
import numpy as np
... |
fde647c306b3c99044fc9891935ec48590544b1554e966d1734230c92cee8cbc | Jupyter | 15,844 | 482 | # %% [markdown]
# # Held-Suarez Forcing Test
#
# This notebook uses Dinosaur to run Held-Suarez integration test[1]. In this test a heuristic forcing terms are added to the primitive equations to produce steady state solution. The goal is to reconstruct statistics of the equilibrium state.
#
# The notebook is split i... |
4fbdc29bda4e526c7f8ba57b8912146ded41551c4840f4b1e2c20675e9e753af | Jupyter | 15,877 | 632 | # %% [markdown]
# # Comparision to single-cell foundation models
# %%
!pip install scanpy
# %%
from os.path import join
import anndata
import scanpy as sc
import numpy as np
import pandas as pd
import dask.dataframe as dd
from scipy.sparse import csr_matrix
from tqdm.auto import tqdm
# %%
# %% [markdown]
# ## sc... |
f7526cc351d33f813dacb9331ac550e55105dc1f981e1db122a601401a9b9e2b | Jupyter | 15,884 | 449 | # %%
import os
import numpy as np
import seaborn as sns # for plots
import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
from scipy import stats as sps # to calcualte confidence intervals, etc
from adjustText import adjust_text # to adjust the text labels in the plots (pip install adjustText)
fr... |
0083017eba88851829b08b28ce2a194cf986a41497d98216e918fffe1a221d33 | Jupyter | 15,918 | 356 | # %% [markdown]
# <html><head><meta content="text/html; charset=UTF-8" http-equiv="content-type"><style type="text/css">ol</style></head><body class="c5"><p class="c0 c4"><span class="c3"></span></p><p class="c2 title" id="h.rrbabt268i6e"><h1>CaImAn’s Demo pipeline</h1></p><p class="c0"><span class="c3">This note... |
f91e54fdaf6853ce71ec74c8ee105d75ef753be68644c052fdbe6aeefe3b24ae | Jupyter | 15,961 | 409 | # %%
import pandas as pd
import numpy as np
from tqdm import tqdm
import os
os.chdir('/home/chujunyi/5_ZY_MHC/Anthem/Dataset')
# %%
with open('experimental_dataset.txt', 'r') as f:
experimental_dataset = f.readlines()
experimental_dataset
# %%
experimental_dict = dict()
lengths, hlas, peptides = [], [], []
for it... |
68676a250a50fd087c21df218f5fb1bae6b8f19c0a0c92b1b2907224159dc412 | Jupyter | 15,970 | 364 | # %%
import pickle
neq_switching_length = 50_000
all_systems_results = pickle.load(open(f'all_results_{neq_switching_length}.pickle', 'rb'))
# %%
import numpy as np
# bootstrap metric
def bootstrap_exp(fct, values):
assert callable(fct) == True
bootstrapped_metric = []
# bootstrap metric to generate test... |
1edc7eba3f3d92bd7d159cdd8485493da3a8ecb98beae292bc4128a62dc34217 | Jupyter | 16,030 | 631 | # %%
import pandas as pd
import numpy as np
# %%
from difflib import SequenceMatcher
def similar(a, b):
return SequenceMatcher(None, a, b).ratio()
# %% [markdown]
# # PubChem
# %%
important_columns = {
'cid',
'cmpdname',
'cmpdsynonym',
'inchikey',
'meshheadings'
}
# %%
pubchem_df = pd.read... |
2b1eefa8d02b4c2b51569d376b0d2cfef7cea35b92ee3b98e4a8b2a301f11784 | Jupyter | 16,104 | 466 | # %%
%load_ext autoreload
%autoreload 2
# %%
import numpy
import os
import pandas
import matplotlib
import torch
from torch import nn
from matplotlib import pyplot
from scipy.signal import windows
PATH = "../../results"
def calc_shape(shape, layers):
"""
Calculates the shape of the tensor after the layers
... |
5ce1fa8ede52b09fbe0e9c573d27cc50327daa61293de25b909ff4856ec0e1e9 | Jupyter | 16,208 | 362 | # %% [markdown]
# # A Gentle Introduction to Ray Core by Example
#
# <a id="try-anyscale-quickstart-gentle_walkthrough" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=gentle_walkthrough">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-an... |
fa173ccc106a0d1421b08010bbadfe0729cd871da30293d13061715ab8df2a2a | Jupyter | 16,227 | 369 | # %% [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... |
e57dab8f2a9299383791cdd3c1e0183e42e22d4c9ee9e87017352041bbe5565a | Jupyter | 16,269 | 582 | # %%
import os
import numpy as np
import pandas as pd
# %%
from bionlp import nlp, disease_service, chemical_service, genetic_service
# %%
nlp.remove_pipe("ner")
# %%
def exact_match_test(ents, ents_to_evaluate):
TP = 0
FP = 0
FN = 0
true_positives = []
false_positives = []
false_negatives =... |
fc7e0d3e816f59359d9ba6374b9295823ef0641e683db30abeb32ebbc662650a | Jupyter | 16,285 | 413 | # %% [markdown]
# # PubDigest Run Example
# %% [markdown]
# ## Installation
# %% [markdown]
# ### Setup Environment
# git clone https://github.com/dansteiert/PubDigest.git
# cd PubDigest
# conda env create -f environment.yml
# %% [markdown]
# ## Imports
# %%
import os
import yaml
from IPython.display import Image
... |
2726f6118dc00f03e31ee766d558457aa9070fb9868144341927bd26f188a073 | Jupyter | 16,328 | 412 | # %%
import scanpy as sc
import scvi
import covbat
import warnings
#warnings.simplefilter(action='ignore', category=FutureWarning)
warnings.filterwarnings("ignore")
import pandas as pd
import numpy as np
import numpy.random
import matplotlib.pyplot as plt
import pingouin as pg
import anndata
import sklearn
import skle... |
a1dd595f4919b4dff7bc6e91b2e8151f89400db21115be93645e9fa772ccd0be | Jupyter | 16,357 | 408 | # %% [markdown]
# # Process of converting FHS dataset to UDS format
#
# Note: Please Download FHS datasets from (<a href="https://www.framinghamheartstudy.org/fhs-for-researchers/data-available-overview/">www.framinghamheartstudy.org/fhs-for-researchers/data-available-overview/</a>) prior to running this script.
# %%... |
faa2484218a772cf64eca9a15c1ac38663c7632f71a5d98743782c4ba769746e | Jupyter | 16,369 | 463 | # %% [markdown]
# # IBM Analog Hardware Acceleration Kit (AIHWKIT): Post Training Input Range Calibration
#
# ### Authors: [Julian Büchel](https://www.linkedin.com/in/julian-büchel-0673991a3/), [Manuel Le Gallo-Bourdeau](https://research.ibm.com/people/manuel-le-gallo-bourdeau), and [Kaoutar El Maghraoui](https://www.... |
a43da0bd444c5f10a033a68e1b664722e5ae39d93da4ff15d5bed5da4c231955 | Jupyter | 16,449 | 419 | # %% [markdown]
# # How to use Tune with PyTorch
#
# <a id="try-anyscale-quickstart-tune-pytorch-cifar" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune-pytorch-cifar">
# <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstar... |
870ddc236e84e80acfee3ab83f921ee848283e1a45c827408ff8b403b4b05770 | Jupyter | 16,492 | 502 | # %% [markdown]
# # LSL hands-on 2:
# # Latency tests and how to LSL on a heavy 3D environment
# <br>
#
# ### Tea Time 13.08.2020 - Doborah Nolte and Marc Vidal De Palol
# %% [markdown]
# ## Outline
#
# 1. Recap: Aligning data streams sampled from different sources
# 2. Recap: Lab Streaming Layer (LSL) as data strea... |
dbe902026964f36c918a4d237f603b93283cde1ba57eb91dc1f030d15f881302 | Jupyter | 16,555 | 471 | # %% [markdown]
# # imports
# %%
%matplotlib inline
import eelbrain as eel
import numpy as np
import scipy, pathlib, importlib, mne, time, os, sys, statsmodels, statsmodels.stats.multitest
from tqdm import tqdm
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
mne.set_log_level(verbose='error')
impor... |
a7c23b38ac1655bb491ca723e0992db4fab095b6fcb67138e1c707c2e307b2a3 | Jupyter | 16,599 | 453 | # %% [markdown]
# (mmt-tune)=
#
# # Batch training & tuning on Ray Tune
#
# <a id="try-anyscale-quickstart-ray-tune-batch_tuning" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-batch_tuning">
# <img src="../../_static/img/run-on-anyscale.sv... |
8c2535a419500bb0f320a3bf335aea81de0023bd94dfde3c9f3692829c0e3f6d | Jupyter | 16,623 | 526 | # %% [markdown]
# **Steady-State Energy Constrained Neural Networks (ECNN)**
#
# This code develops steady-state ECNN models for the cases when *no noise* or *constant bias with / without Gausssian noise* is added to true data to generate training data.
#
# The unconstrained network model is trained first, followed b... |
08121fe74f0a581961b707286cb65ed616b6c0404f8261b37afc2e43438fdcbf | Jupyter | 16,643 | 453 | # %% [markdown]
# # Analyse the difference between the hand-labeled data and the classification algorithm
# %% [markdown]
# Many parts of this code have been written by Pelin Kömürlüoğlu.
# %% [markdown]
# Import the packages
# %%
import numpy as np
import random
import pandas as pd
import matplotlib.pyplot as plt
f... |
9c742c03b27b2477035e95dbdfc98b00b4e9821594310889fa320d530740579a | Jupyter | 16,667 | 415 | # %% [markdown]
# <h1> Here we will be focusing more on the cnmf part and its main functions <h1>
# <img src='docs/img/cnmf1.png'/>
# %%
try:
if __IPYTHON__:
# this is used for debugging purposes only. allows to reload classes when changed
get_ipython().magic(u'load_ext autoreload')
get_ipy... |
1eaed48b218b8a6922b9989cee1ca535753fcff25c5b26d318d4dc119a1d3f81 | Jupyter | 16,702 | 457 | # %%
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras import optimizers, losses, Model
import tensorflow.keras.layers as L
from transformers import AutoTokenizer, TFAutoModel
from tensorflow.keras.callbacks import ModelCheckpoint
training_df = pd.read_csv("/kaggle/input/sentiment-c... |
9f29a7d09ad83eee94f098adec795c0729dc6df9f00487e43637fb346acb3cbc | Jupyter | 16,747 | 635 | # %%
%load_ext lab_black
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from os.path import join
from IPython.display import display, Markdown, Latex
import sys
import seaborn as sns
import matplotlib
matplotlib.rcParams["pdf.fonttype"] = 42
matplotlib.rcParams["ps.fonttype"] = 42
sys.path.ap... |
2b03cfe7180bd14579f81e2f1eb7adc5a66933b54391c9a524500cf0f916b5ec | Jupyter | 16,864 | 400 | # %% [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... |
c7874348974b704a2a3ec2818960d4d0a7d2a715a9f6b847afa6a6bf3cbee7d8 | Jupyter | 16,964 | 392 | # %%
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 statsmodels.api as sm
import matplotlib.pyplot as plt
import seaborn as sns
import os
from os.path import join
import time
from gprofiler import G... |
2f7c8ed47e698f28fb70b4cb486b0c960b22977108c42be3e65d2bd96568287c | Jupyter | 16,979 | 430 | # %% [markdown]
# # Overview
#
# This notebook is for creating new a [single-sample mode](https://broadinstitute.github.io/gatk-sv/docs/gs/calling_modes#single-sample-mode) reference panel.
#
# Outputs from the workspace data table are mapped to the corresponding resources in the GATK-SV [input build framework](https... |
734302a4925bffc8f506abe45117ed7f13de965b767fc4f08ccb4eaccd704175 | Jupyter | 17,082 | 537 | # %% [markdown]
# **Steady-State Energy Constrained Neural Networks (ECNN)**
#
# This code develops steady-state ECNN models for the cases when *random bias with / without Gausssian noise* is added to true data to generate training data. The linear noise model works fine for all cases considered in this work. However,... |
82a3e8e21941e3f02da417e37c2e8fd657213089d118df5899c0d58821f0dff1 | Jupyter | 17,091 | 423 | # %% [markdown]
# # PubDigest Run Example
# %% [markdown]
# ## Installation
# %% [markdown]
# ### Setup Environment
# git clone https://github.com/dansteiert/PubDigest.git
# cd PubDigest
# conda env create -f environment.yml
# %% [markdown]
# ## Imports
# %%
import os
import yaml
from IPython.display import Image
... |
cf73de7a6e280ca879cb004cb23a564bd6aca507c0fef2fffcad05a18eb9d2a4 | Jupyter | 17,127 | 499 | # %% [markdown]
# ### 1.2) Preprocessing - Plaque Detection and Image Cropping
#
# The previous dataset color normalizes the whole slide images and regularly tiles them to 1536 by 1536 pixel images. To generate the plaque dataset for expert annotation, we apply an HSV filter and smoothing to detect candidate plaques. ... |
385da1cb90b9d31225622733a24e04edfd0dee7ebe696f859a8e3b8766b92298 | Jupyter | 17,337 | 454 | # %% [markdown]
# (pbt-guide-ref)=
#
# # A Guide to Population Based Training with Tune
#
# <a id="try-anyscale-quickstart-ray-tune-pbt_guide" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-pbt_guide">
# <img src="../../_static/img/run-on-a... |
6796f4132a39306e82f6c77a2570259ebdcd264aed6986c9190d2c29b64a0647 | Jupyter | 17,337 | 415 | # %%
# Python Script
# Calibration of the diffraction projection
# from a diffraction pattern of a known crystal
#
# by J. Barthel / Forschungszentrum Jülich GmbH, Jülich, Germany
# email: ju.barthel@fz-juelich.de
#
# 2019 July 3
#
# Part of the emilys project: https://github.com/ju-bar/emilys
# published under the GNU... |
88069c9e16cff9f21934529cb0dbf6439832fc72de34d0b18eb9649f25d36bfe | Jupyter | 17,376 | 422 | # %%
import SimpleITK as sitk
import numpy as np
import os
import glob
import matplotlib.pyplot as plt
from rabies.visualization import otsu_scaling, plot_3d
import nilearn.plotting
from rabies.utils import recover_3D
from rabies.analysis_pkg.diagnosis_pkg.analysis_QC import masked_plot, percent_threshold
import pandas... |
fddcec733cd0ecd56209bfd583141d76f1244deb82b8137b130ac673c4ffa133 | Jupyter | 17,464 | 536 | # %% [markdown]
# This notebook is for preparation data before an analysis
# %%
import numpy as np
import pandas as pd
import cooler
from cooltools.api.sample import sample
from cooltools.api.insulation import calculate_insulation_score
from cooltools.api.eigdecomp import eigs_cis
import bioframe
from matplotlib impo... |
3ea816e2da7139e61b39f19e163bb8ca8cf0363afe99016a0d9effaec919bbfc | Jupyter | 17,468 | 493 | # %% [markdown]
# # Selectivity categories for connectivity results
# %%
# return figures in svg
%config InlineBackend.figure_formats = ['png']
import h5py
import bayesprev
import numpy as np
import pandas as pd
from string import ascii_letters as abc
from itertools import product
from os.path import join as pjoin
... |
7a6f4e8923a708e429997208c95368df8e6f953d2db1cf5abb0d851401f46a61 | Jupyter | 17,540 | 434 | # %% [markdown]
# <a href="https://colab.research.google.com/github/shksherry/TIBDA-Numenta-Anomaly-Benchmark-NAB-dataset-Analysis-/blob/main/TIBDA_(Numenta_Anomaly_Benchmark_(NAB)_dataset_Analysis).ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# ... |
e167034a838d994d19b7b8a96c2e2509480dca66e8121a63e871eb6617534b92 | Jupyter | 17,541 | 691 | # %%
import multiprocessing
import tqdm
import numpy as np
import scipy.stats as st
import scipy
import numba
import math
#import biocircuits
# Plotting modules
import bokeh.io
import bokeh.plotting
from bokeh.models import LinearColorMapper, ColorBar
#from bokeh.io import export_svgs
bokeh.io.output_notebook()
# ... |
c2e9c20d694bd5344b3f43a8dcccdc7fe9a20e16af76b1efc412772adbdca335 | Jupyter | 17,576 | 407 | # %%
import os
import sys
import nibabel as nib
import numpy as np
import subprocess
from scipy.interpolate import griddata
from tirl.timage import TImage
from plotly.subplots import make_subplots
import tirl
import plotly.graph_objects as go
import matplotlib.pyplot as plt
print(tirl.__version__)
# %%
def surf_data_f... |
f666ebf11979ae57ee253c2c629e453ed9c32014f246fdc0bac55c3cf2a474a1 | Jupyter | 17,650 | 508 | # %% [markdown]
# The code was adapted from the tutorial 'https://naturalistic-data.org/content/Intersubject_Correlation.html', which was written by Juha Lahnakoski and Luke Chang
# %%
import nltools
from nltools.data import Brain_Data
from nltools.mask import expand_mask, roi_to_brain
from nilearn.maskers
import niba... |
ea988ac8045322768a0f8c7e89feacfc2ebf1cfc0467681eba43a159ea26142f | Jupyter | 17,687 | 456 | # %% [markdown]
# # Weather forecasts on ERA5
#
# This notebook shows how to initialize the Dinosaur dynamical core to perform a retrospective weather forecast initialized with ERA5.
#
# It shows:
#
# 1. How to construct a Dinosaur initial state from reanalysis data, including data loading and unit conversion.
# 2. ... |
f71b58b581d7b2898de54005d55fe6016527a2d235f750071ef75a560cf2ac58 | Jupyter | 17,801 | 465 | # %% [markdown]
# # Loading the packages
# %%
import os.path
from scipy.io import mmread
# %%
#import xb.formatting as xf
# %% [markdown]
# # Example of formatting
# %% [markdown]
# We input the path wher our original xenium data is and we use ```format_xenium_data``` to transform the datasets
# %%
import numpy a... |
af30bbfe605f3d274338b1b7dc509428b1e991ce528ed82485be6fc62966e9a7 | Jupyter | 17,859 | 632 | # %% [markdown]
# # Optic flow task
#
#
# This notebook illustrates the optic flow task and how to use it with our pretrained fly visual system model and decoder.
# %% [markdown]
# **Select GPU runtime**
#
# To run the notebook on a GPU select Menu -> Runtime -> Change runtime type -> GPU.
# %%
# @markdown **Check... |
7aeef3dcf7238e80950cee689c8f33d10f7f354a1423e2d5354940c6d6095d36 | Jupyter | 18,047 | 497 | # %%
%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 pysted import base, utils, raster, ... |
98730b8de507382e8666deee7d1ccd70410169755583fbfe7816d702ea36c8f7 | Jupyter | 18,072 | 518 | # %% [markdown]
# # 2D Classification Example on MedNIST and rising
# Welcome to this rising example, where we will build a 2D classification pipeline with rising and pyorch lightning. The dataset part of this notebook was inspired by the [Monai MedNIST](https://colab.research.google.com/drive/1wy8XUSnNWlhDNazFdvGBHLfd... |
da20620d17d8b326dd35d3fd08e831a325c8254a0d0819a16e56d7c0d8bc87d1 | Jupyter | 18,167 | 389 | # %% [markdown]
# # Analog-Digital Mixed-Precision Training and Inference
#
# ### Authors: [Athanasios Vasilopoulos](https://www.linkedin.com/in/thanos-vasilopoulos/)
#
# In this notebook, we demonstrate the capability of performing mixed-precision training and inference in AIHWKit. The notebook uses a ResNet32 as a ... |
b57e5a75dd6cc789e3391db36a43870dd99e26a0b6e3a2311c687eb33655d285 | Jupyter | 18,181 | 516 | # %%
# %matplotlib widget
# %%
import numpy as np
from pathlib import Path
import pandas as pd
import flammkuchen as fl
import os
from matplotlib import pyplot as plt
from matplotlib.colors import LinearSegmentedColormap, Normalize
import seaborn as sns
from itertools import product
from skimage.filters import thresh... |
0dfc08f54f5ae7ffb178c52f18490538b15680324879fbded710a6ce37641cb1 | Jupyter | 18,375 | 351 | # %% [markdown]
# (hpu_resnet_training)=
# # ResNet Model Training with Intel Gaudi
#
# <a id="try-anyscale-quickstart-intel_gaudi-resnet" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=intel_gaudi-resnet">
# <img src="../../../_static/img/run-on-any... |
bc7abaf2f9b0b824143041357218416c0317c09f5fb6b49c4ff4148b83b5a75e | Jupyter | 18,547 | 402 | # %% [markdown]
# # 2nd - the validation of the RCPL model.
# %%
import pandas as pd
from paintone_rsn.data_loading import load_subjectiid, exclusion, load_timeseries, samplecalibration
from paintone_rsn.data_preproc import connectivity_matrix, connectivitylabelname
import paintone_rsn.mlfunctions as myml
from scipy.s... |
e020442e8e19cdae89de5cfed15222844b686cd187e401e4f9597bf23bd9c8f2 | Jupyter | 18,682 | 534 | # %%
# Imports
## General
import os
from copy import deepcopy
from itertools import product
from types import SimpleNamespace
import sys
sys.path.append("..")
from RNN_helpers import *
from IPython.display import display, Markdown
## Numerical
import numpy as np
import pandas as pd
import scipy.stats as sps
import m... |
9cecf58026892ac7ebb77cf1053337996d0f37194ff4a9c89b79094972beb43d | Jupyter | 18,710 | 651 | # %%
import argparse
import os
import numpy as np
import math
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import ... |
1bd5e828fd41908c568fd1bd9b027bb5fdd7a906f8336275ba36cdd660a9e706 | Jupyter | 18,727 | 465 | # %% [markdown]
# <a href="https://colab.research.google.com/github/BojarLab/CandyCrunch/blob/main/CandyCrunch.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a>
# %% [markdown]
# <img src="https://raw.githubusercontent.com/BojarLab/CandyCrunch/main/im... |
00a2c87f33fa36309d30a24322061bc93711111461af5ff94fbf49bbea6a0744 | Jupyter | 18,764 | 554 | # %%
!pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps
# %%
!pip install celltypist==1.5.3
# %%
import os
import re
import gc
from os.path import join
import anndata
import numpy as np
import pandas as pd
import xgboost as xgb
import dask.dataframe as dd
import pandas as pd
import lightning.pytorch as p... |
00e16a1bf084da85a567cbe60cb7e4386d47bd55bf2f05b13ac6bc5ed0fc909b | Jupyter | 18,951 | 658 | # %%
import argparse
import os
import numpy as np
import math
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import ... |
bb171fde3f5d2c183b17eae53c6410d85c47b9aaa2ddf8aca9ec170dd19efd6a | Jupyter | 18,967 | 476 | # %%
import numpy as np
from tirl.timage import TImage
import os
import sys
import nibabel as nib
import numpy as np
from scipy.interpolate import griddata
import matplotlib.pyplot as plt
from sklearn.cluster import KMeans
import scipy.stats
from scipy.ndimage import gaussian_filter
from sklearn.decomposition import PC... |
0dac95c2707bebcec88b0f76c6938050e103d820bf000ce4b5606fc83657c2da | Jupyter | 19,015 | 558 | # %%
%load_ext autoreload
%autoreload 2
# %%
%matplotlib inline
import numpy
import os
import yaml
import copy
import sklearn
import h5py
import sys
import matplotlib
import io
import pickle
import random
import array
import json
from cycler import cycler
from matplotlib import pyplot
from matplotlib.animation impo... |
63825368cba6f4eb8c5e501f845af980fa377faea460a701d97fac6fa8444170 | Jupyter | 19,091 | 458 | # %% [markdown]
# # Visualizing Population Based Training (PBT) Hyperparameter Optimization
#
# **Assumptions:** The reader has a basic understanding of the [PBT algorithm](https://www.deepmind.com/blog/population-based-training-of-neural-networks) and wants to dive deeper and verify the underlying algorithm behavior ... |
aa67ea7b9c7d9ce9a66c8aeed0a25eb21bb1ed501132c22124a799715048c4c9 | Jupyter | 19,103 | 538 | # %%
using Distributed
addprocs(8);
# %%
@everywhere using PulseInputDDM, MAT, LinearAlgebra, Flatten
# %%
x_joint = Vector(undef, 3);
# %%
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(), "..")), ... |
94fca6292317eb2b7192e683787630f16bfb6b06ba3ce825cda23eafd56d53fd | Jupyter | 19,190 | 523 | # %% [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... |
53f8ac2db7d04099c921c2cbac1a4877a37770c6f76bcf38baab73f6ae1764ff | Jupyter | 19,213 | 537 | # %%
%load_ext autoreload
%autoreload 2
# %%
import os
import os.path
import sak
import sak.signal.wavelet
import numpy as np
import scipy as sp
import scipy.signal
import pandas as pd
import wfdb
import json
import tqdm
import matplotlib.pyplot as plt
from scipy.stats import norm
from sak.signal import StandardHeader... |
c119ed48a94100a0d615ad663f7a49abb56455d7c12c5036c74b8becb25ba2f7 | Jupyter | 19,217 | 623 | # %% [markdown]
# # General UMA Workshop
#
# This 1–2 hour tutorial is intended for classrooms, workshops, and guided
# self-study. It combines several UMA workflows in one linear lesson. The same
# topics also appear as shorter, task-focused pages elsewhere in the
# documentation; use [Hello World](../core/quickstart... |
1cefebec60410767d4541ad4b3e499f5c827a50abababb437ff40c2c0f81017c | Jupyter | 19,246 | 517 | # %% [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... |
190c5c0900a8d731732f363b94cf9a7a3805ca3826fa64ad53d768ca07b815cf | Jupyter | 19,295 | 519 | # %% [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... |
dccae43e8dab94578da4b6ca2070ec752a76fddfce36f182ffa367b0f12bf2a9 | Jupyter | 19,477 | 561 | # %%
%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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.