sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
0e119e19df261badb7c60076f5a8ba8650969ac5ea66f97c50dde8dc93f641f3
Jupyter
6,091
214
# %% [markdown] # # Convert ERA5 hourly data to daily data # %% proj_dir='/path/to/main_project_folder/' # edit this line import pandas as pd import numpy as np import xarray as xr import netCDF4 as nc4 import re import sys import os import time import multiprocessing as mp years = range(1979, 2024) yr_mon_args = []...
0e5c466cdc2d731a8e086c0ef3f3e68ef7d04d630f16b3c9592d665502b6fb67
Jupyter
6,092
164
# %% [markdown] # # Import the required packages # %% import os from typing import Any from torch.nn import ( BatchNorm2d, Conv2d, Flatten, Linear, LogSoftmax, MaxPool2d, Module, ReLU, Tanh, NLLLoss ) from torchvision.datasets import FashionMNIST from torch import device as torch_device from torch.nn import ...
7daee3d9336d14ca32d04bd87ebea67b576dbbeb8b0c844cf49d71a06cf25f68
Jupyter
6,102
149
# %% %pip install davos import davos davos.config.suppress_stdout = True # %% smuggle numpy as np # pip: numpy==1.24.2 smuggle matplotlib.pyplot as plt # pip: matplotlib==3.7.0 smuggle scipy as sp # pip: scipy==...
0c57d502874c7365397f94985828731b2ae779785c2161fc156bd2a532a9a2e2
Jupyter
6,156
209
# %% [markdown] # # Figure 3 (Weakly coupled network) # #### This code runs the simulations and reproduces Fig 3B, 3D, and 3E # %% from KeyFunctions.TheoryFunctions import * from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.pyplot as plt import matplotlib as mp # %% [markdown] # ### Default p...
07e4c7846c8a5c565ce2a953d6804b0edd310e179730a53ce543a6ebaced241a
Jupyter
6,165
191
# %% [markdown] # # Import a model from NIR and deploy it to SPECK # # In this tutorial we will show how a NIR model can be deployed onto SynSense's Speck processor. # # We start by importing the model into sinabs and from there deploy it onto Speck. We will test the deployed model by streaming events onto the chip ...
463376b8fe9e5ecaee10740f6769b87b1489e446ac315ac7b979eb8986e458c9
Jupyter
6,166
156
# %% # Copyright 2022 NVIDIA Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
f0de2c2d46ff18c632b446cec94347ccf3eb1d3218d62fe26d8f82bd91a65de4
Jupyter
6,169
232
# %% !pip install zarr !pip install scipy # %% import os import dask import dask.array as da import dask.dataframe as dd import pandas as pd import numpy as np import pyarrow as pa from os.path import join import shutil # %% from dask.distributed import Client, LocalCluster cluster = LocalCluster(n_workers=5) # ...
39ab8d62f492a77387dd56db1dcea7f9291e30b41d8eb0744826262394ed38c4
Jupyter
6,179
186
# %% [markdown] # <!-- (evaluation)= --> # # WeatherBench 2 Evaluation Quickstart # # <a target="_blank" href="https://colab.research.google.com/github/google-research/weatherbench2/blob/main/docs/source/evaluation.ipynb"> # <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> # ...
139e17670aa11dc60299907ff2c09bf66a81c90797d15bf98179558075113543
Jupyter
6,196
194
# %% [markdown] # # How to extract features from fMOST data with [neuron_morphology](https://github.com/AllenInstitute/neuron_morphology) # # To obtain the package, please see [https://neuron-morphology.readthedocs.io/en/readthedocs/](https://neuron-morphology.readthedocs.io/en/readthedocs/). # # This step-by-step gu...
8e845e969e7845c75b9e5b3d3d0f23c55cc0ed6c1a74a3e05f38cd7777e05c7e
Jupyter
6,206
173
# %% [markdown] # # Import backage # %% import sys sys.path.append("../..") import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import random %matplotlib inline # %% import torch from torch import nn from torch import distributions from torch.nn.parameter import Parameter from exp.sir.train i...
18179802843cc2acf5cd5d5f81e2ac0c4b6ee100b701f8d1155bb71632a8e221
Jupyter
6,209
209
# %% from NER_processing import nlp, disease_service, chemical_service, genetic_service import pysolr # %% [markdown] # # Replicate paragraphs in local # %% solr = pysolr.Solr('http://librairy.linkeddata.es/data/covid-paragraphs', timeout=10) # %% solr_local = pysolr.Solr('http://localhost:8984/solr/covid_paragraphs...
a000506ed56b910727a46eaa096bbef43ee9e256b19aad25c47d5bdbcc6b4faf
Jupyter
6,221
171
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib import cm from scipy.in...
5f705c88031595393d06d6a73946900d5a6df238e12df9eefbc78fc4bc146731
Jupyter
6,223
162
# %% # import the experiment utilities package import exputils as eu import numpy as np # only collect data to plot every n'th step, otherwise the plots are too large plot_every_nth_step = 500 def get_every_nth_step_inds(data): # create indicies inds = np.full(len(data), False) step = 0 while ...
a2570f9ade869d66a77c8e8a2ba35f2d15b03cdf4cc1d9482624a112817ea4eb
Jupyter
6,238
152
# %% [markdown] # ## SHAP-based feature importance plots # %% import autoreload %load_ext autoreload %autoreload 1 %matplotlib inline # %% import numpy as np import pandas as pd import os from plotnine import * import glob import yaml import pickle import utils # %% annotation_names = utils.ANNOTATION_NAMES binary_a...
71460cc513f4ce114131bfbdcd06ff6146a2548ccb2dbb5738a0dcb7012b1a2e
Jupyter
6,269
176
# %% import sys sys.path.append("../..") import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import random %matplotlib inline # %% import torch from torch import nn from torch import distributions from torch.nn.parameter import Parameter from exp.sir.train import train from models_new import R...
e1a65c8d88ef573bbe0870e26a134abe219db121eea53b717eb62a0640a910e1
Jupyter
6,308
201
# %% [markdown] # # Figure 5 (Segregated I populations) # ### This code runs the simulations and reproduces Fig 5B and 5C # %% from KeyFunctions.TheoryFunctions import * from KeyFunctions.SimulationFunctions import * from mpl_toolkits.axes_grid1 import make_axes_locatable import matplotlib.pyplot as plt import matplo...
2b30e9b929403f32bf63303dc7e92ae365ff92fe2c3be369be310957aebefbc9
Jupyter
6,315
244
# %% %load_ext autoreload %autoreload 2 # %% import sys import time import logging import argparse import itertools import matplotlib import matplotlib.pyplot as plt from tqdm.auto import tqdm import numpy as np sys.path.insert(0, '../network') from measures import DataStore # %% directory = "4-state-transitions/da...
f52e46654577a9c2a8aae4d00dddf358bfb44489e9c1ed2aee19fca6ca33ff5e
Jupyter
6,322
182
# %% [markdown] # # 3rd - investigating the specificity and confounder effect on the RCPL model. # %% import pandas as pd import os import seaborn as sns from scipy.stats import pearsonr import pickle from mlconfound.stats import partial_confound_test from mlconfound.plot import plot_graph os.environ["PATH"] += os.pa...
2e1c522c0866b887eeace91111545c186709327b0cafb1fe230da65a11b47246
Jupyter
6,347
151
# %% [markdown] # # Running Tune experiments with AxSearch # # <a id="try-anyscale-quickstart-ray-tune-ax_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-ax_example"> # <img src="../../_static/img/run-on-anyscale.svg" alt="try-anysca...
c49638f04164153a4b5785afc5b347cd49c6d0dc58c485e62fc5d420d375c419
Jupyter
6,360
146
# %% [markdown] # (nirtorch_tracing)= # # To NIR: Tracing PyTorch # # When creating NIR nodes from PyTorch, we go through the PyTorch modules to create a graph structure that we can populate with NIR nodes. # This "going through" is what we refer to as "tracing" because we have to track the path of signals through pot...
e18abd4ac2957cb087f4f7be0d43b25aa2693ad06154fce1c131bfbabd834369
Jupyter
6,403
126
# %% [markdown] # # Interactive Quality Control (QC) of an ECG and MRI Prediction Model # # In this notebook, we review phenotypes and model results to identify where our model has room for improvement. This is a quality control (QC) step in the development of a model. # # <div class="alert alert-block alert-info"> #...
2e46d9a59f93e3d4740c0c760a0c21a452a6d9ab4dc19a90d6f4280a992c1e5d
Jupyter
6,422
223
# %% [markdown] # # Process TUAB # > Preprocessing and feature computation for the TUAB dataset # %% import pandas as pd from pathlib import Path from functools import partial from dask.distributed import Client, LocalCluster, fire_and_forget from dask_jobqueue import LSFCluster from fastcore.transform import Pipelin...
8c23ff46e9cb2096c8c94494f200616be9c9d7c4273b851ece7afbcb6f5924b6
Jupyter
6,439
151
# %% import numpy as np import pickle import pandas as pd from Bio.PDB.Polypeptide import PPBuilder import Bio.PDB from Bio.PDB.PDBIO import PDBIO import glob # %% def vtoa(v): return np.array([float(x) for x in v]) def unit(v): return v / (np.dot(v,v)**0.5) def norm(v): return np.dot(v,v) ** 0.5 #####...
855631d2705f58c5270264bd1719d1515fbc7e5363f66c29be9385cf7b0a1178
Jupyter
6,469
142
# %% import lime import sklearn import sklearn.ensemble import sklearn.metrics # %% [markdown] # ## Fetching data, training a classifier # %% [markdown] # In the [previous tutorial](http://marcotcr.github.io/lime-ml/tutorials/Lime%20-%20basic%20usage%2C%20two%20class%20case.html), we looked at lime in the two class c...
fc48ed8f7b40d74b9a7e891481efd98c9abed1527848796a39b31466c286f4f3
Jupyter
6,500
232
# %% !pip install zarr !pip install scipy # %% import os import dask import dask.array as da import dask.dataframe as dd import pandas as pd import numpy as np import pyarrow as pa from os.path import join import shutil # %% from dask.distributed import Client, LocalCluster cluster = LocalCluster(n_workers=5) # ...
797ac86add4f4a62a40fc5b72f8ce8d2022ad31d16387bd7e4da2beed1835ebd
Jupyter
6,501
195
# %% [markdown] # <!-- (evaluation)= --> # # WeatherBench 2 Evaluation Quickstart # # <a target="_blank" href="https://colab.research.google.com/github/google-research/weatherbench2/blob/main/docs/source/evaluation.ipynb"> # <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> # ...
483538912eb3a1e9da4a9717e9c890b3f984b23c2a4aee2f5616a5c9d3c200bf
Jupyter
6,514
166
# %% 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...
61d8be07e42e1393da0c2fade3be3a124c6892cfd9341b41ee47305fd4a56171
Jupyter
6,541
227
# %% import omicverse as ov #import scvelo as scv import pandas as pd import seaborn as sns import numpy as np import matplotlib.pyplot as plt ov.ov_plot_set() # %% import omicverse as ov ov.utils.ov_plot_set() from matplotlib import rcParams # 设置全局字体为Arial rcParams['font.family'] = 'Arial' # %% import os metric_l...
fcbdd553de45b5e3cf1705e8e6a79c03d953ae944dbaa214c711e5fdee2b5b4e
Jupyter
6,559
132
# %% import numpy as np import matplotlib.pyplot as plt import nibabel as nib import pickle from nilearn import plotting import os import nibabel as nib from scipy import stats from scipy.spatial.distance import squareform from tqdm import tqdm from statsmodels.stats.multitest import fdrcorrection # %% [markdown] # ##...
ce160d911c3205d2072376ea5d54f60ca0fc957cc13dcfe25106c5da7cd47d9b
Jupyter
6,560
195
# %% [markdown] # # Goal : Scan the 3D predcitions with the PD fold database (12/09/2023). # # ### A. Make the DB # ### B. Run Foldseek # ### C. Get the hits with good proba # ### D. Report the folds # *** # %% [markdown] # # A # %% # Generates the database : # mkdir /media/concha-eloko/Linux/PhageDEPOdetection/PD_...
01cb92e7ef5e47e3b748b6a3750fbc22f8a21faf619175ea988c7ce806f2e0d6
Jupyter
6,564
223
# %% [markdown] # # Load Wave files for ML # %% [markdown] # Loading modules # %% import os import IPython import IPython.display import matplotlib as mpl import matplotlib.pyplot as plt import numpy as np import time #import math #from tensorflow import keras #import seaborn as sns import random #import tensorflow ...
b320cdb062d6b4a0b2b96ee373844e596603c8fcee662570a200b1d9b6fe7f88
Jupyter
6,580
198
# %% [markdown] # # Goal : Scan the 3D predcitions with the PD fold database (12/09/2023). # # ### A. Make the DB # ### B. Run Foldseek # ### C. Get the hits with good proba # ### D. Report the folds # *** # %% [markdown] # # A # %% # Generates the database : # mkdir /media/concha-eloko/Linux/PhageDEPOdetection/PD_...
18ca6d799357336466c733f82385bd7de26b3f5d082e0d86308484c9f172ae97
Jupyter
6,581
219
# %% %load_ext autoreload %autoreload 2 # %% from multicamera_acquisition.interfaces import get_camera # %% # use spinview to get serial numbers for each camera # %% camera_list = [ {'name': 'top', 'serial': 22181547}, {'name': 'side1', 'serial': 22181612}, ] # %% import csv from multicamera_acquisition.pat...
21c60a637d12ae6fb5a89999c74032c246a47a6028fd3301236e6b5bf1ecd77b
Jupyter
6,583
171
# %% import scanpy as sc 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 sys.path.append("/n/home12/khou/holystore/") import paper_utils from scipy.stats import ttest_ind from scipy.stats import pearsonr, spe...
93a4cc3de6251fdeab839f25974810e2003a1c6131aa0a857d2087fd3bcd704f
Jupyter
6,594
215
# %% # import libaries 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 tqdm import tqdm import math import pickle from scipy import stats import ...
489d6c61764d43201e6c6afc3a89be6e4d33d53c3633d49b5d8f5f47f390ba3d
Jupyter
6,595
238
# %% !pip install zarr !pip install scipy # %% import os import dask import dask.array as da import dask.dataframe as dd import pandas as pd import numpy as np import pyarrow as pa from os.path import join import shutil # %% from dask.distributed import Client, LocalCluster cluster = LocalCluster(n_workers=5) # ...
803f1c959fc70f199c77677063e133f234dcd0fb2c3bfb92ca93c26974236929
Jupyter
6,607
217
# %% [markdown] # # Using Weights & Biases with Tune # # <a id="try-anyscale-quickstart-tune-wandb" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune-wandb"> # <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstart"> # </a> #...
e4c8dce0d4db3a893dc1ed6a2538ed9ec35df2c1cdd5a7426a00b1ed43bcf6ac
Jupyter
6,611
198
# %% [markdown] # # Training by backpropagation through time (BPTT) # # BPTT is normally a procedure used while training recurrent neural networks. In the case of spiking networks, even if the network is not recurrent, it has a memory of its previous processing steps through the persistence of membrane potentials. Unl...
63985240764941be4f9a7d64664e2c9dc3aacb34ff7340484511890db16ddc2c
Jupyter
6,634
189
# %% # Libraries # needs to be 3.5 import os import sys import nibabel as nib import subprocess import glob print('done imports') # %% if 'ipykernel' in os.path.split(sys.argv[0])[1]: sub = '100206' structure = 'cortex' density = '2mm' else: sub = sys.argv[1] structure = sys.argv[2] density = s...
02eabb14d544cb5a83713ee27b3c9b84bf94d062cda9b6f7f5d006058bc36949
Jupyter
6,637
183
# %% rsync -avzhe ssh \ conchae@garnatxa.srv.cpd:/home/conchae/PhageDepo_pdb/Dpo_domains.phagedepo.0805.final.tsv \ /media/concha-eloko/Linux/depolymerase_building # %% [markdown] # *** # # Local work : # %% import subprocess import os path_project = "/media/concha-eloko/Linux/depolymerase_building" path_pdb = f"{p...
5fa788c23c0ace4f03c9c5a3aeaca1a9c1afab6bfbf93d8a8f2b25bb4037df9a
Jupyter
6,641
258
# %% %load_ext autoreload %autoreload 2 # %% #!/home/dattalab/code/ArenaSDK_v0.1.68_Linux_x64/ArenaSDK_Linux_x64/Utilities/IpConfigUtility /list # %% from multicamera_acquisition.interfaces.arduino import ( packIntAsLong, wait_for_serial_confirmation, ) import struct import time import numpy as np from mult...
4c2ff8ef0d1d9769ec53a7d479e49997559a3ec85b18e671170b49584a6fc21b
Jupyter
6,643
251
# %% %load_ext autoreload %autoreload 2 # %% import os import os.path import skimage import skimage.segmentation import sklearn.preprocessing import sklearn.model_selection import math import shutil import pathlib import glob import shutil import uuid import random import platform import torch import torchvision impor...
632ece972b354c12655f484b6e997b200fe607f3e8f2491e979270b1f6b74d01
Jupyter
6,659
289
# %% # 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) ...
24128a32cafea99be13cd61bf6e15c2f332b54b6dc39840f24ebe92b45e2b3d5
Jupyter
6,682
290
# %% # 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) ...
4bd4f60ee570f0b551b11ef1bed45bca4c2278be5e5dfdaf579f08a38bbf02c5
Jupyter
6,696
223
# %% #import import glob import seaborn as sns from matplotlib import pyplot as plt import numpy as np import pandas as pd from scipy import stats # %% projections='PrL-ACC' # Fig.1 mn #projections='ACC-PrL' #Supplementary Fig. 3 mn if projections=='PrL-ACC': samples = [11215, 11217,11260] # Fig.1 mn else: s...
1826435b0f090da837dd82f5a0edb8ff84a9452811ec4f5c9f54e08c9f945461
Jupyter
6,723
185
# %% import scanpy as sc import matplotlib.pyplot as plt import pandas as pd import numpy as np import omicverse as ov import anndata import os from cellphonedb.src.core.methods import cpdb_statistical_analysis_method sc.settings.verbosity = 3 # verbosity: errors (0), warnings (1), info (2), hints (3) sc....
635349fe75bbda0afa928d5744ebfa887f7f1aa6a3df5472f145163d785b8230
Jupyter
6,738
193
# %% [markdown] # # Test spatial patterns for `scDRS` scores # %% %load_ext lab_black import numpy as np import pandas as pd import scanpy as sc from os.path import join from scipy import stats import statsmodels.api as sm import os # %% for dataset in [ "zeisel_2015", "zeisel_2018", "ayhan_2021", "y...
30421316c56282e341b897b5daefc431daae28e3360aa4e798ba2e3591d58ba9
Jupyter
6,759
152
# %% [markdown] # # Visualize DVS Input # # Speck integrates a Dynamic Vision Sensor(DVS) on the chip itself. Users can read, visualize, and save events generated by the embedded DVS after modifying the hardware configuration. # # This notebook demonstrates how to visualize the DVS Sensor events on the speck2e/speck2...
02ac34a9532bb998c41f9eb319d54bf53b10707596c2eeaf0c9b8a41850eeb3c
Jupyter
6,769
179
# %% [markdown] # # Quickstart Sinabs # If you're familiar with how SNNs work, you might find this quick overview about *Sinabs* useful. # # ## Sinabs is based on PyTorch # All of Sinabs' layers inherit from `torch.nn.Module`. Thus you will be able to access your parameters, wrap layers in a `nn.Sequential` module and...
f64bc8081e7a82ea44e55f6fa572211a938cf99311e84095391a062fd1878766
Jupyter
6,787
133
# %% [markdown] # # scoreCT: Automated cell type annotation in scRNA-seq data # ScoreCT is a script allowing automated annotation of scRNA-seq data analyzed with Scanpy. Providing your own reference or using the reference regularly updated and provided with the package, you can automatically assign clusters from your S...
6bce8f164ca8f533582bde1b3b2c2697359074087a5fcbc6a7ce866208972f99
Jupyter
6,822
208
# %% [markdown] # # Goal : Scan the 3D predcitions with the Dpo fold database # # ### A. Run Foldseek # ### B. Get the hits with good proba # ### C. Report the folds # *** # %% rsync -avzhe ssh \ conchae@garnatxa.srv.cpd:/home/conchae/PhageDepo_pdb/Dpo_domains.phagedepo.0805.final.tsv \ /media/concha-eloko/Linux/depo...
4af0934569511bd9446c7f4f1133e6b8c0f4eb49c3d84d6be2839c995af805c4
Jupyter
6,853
160
# %% [markdown] # ## This demo notebook can be used to (optionally) decompress ephys data and create two average waveforms per session needed for Unit Match. # %% %load_ext autoreload %autoreload import sys from pathlib import Path import UnitMatchPy.Extract_raw_data as erd import numpy as np from pathlib import ...
0ef1b83a66226891da11d0c0f8a8cabbd36a106162771c64c5e0a23af4548d5b
Jupyter
6,857
294
# %% # 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...
25f232645f2bdecdd186fc7d02d84d5553208a1dea17d44e3308c87cca057dcd
Jupyter
6,865
206
# %% # compare SOTA algorithms from sklearn.naive_bayes import GaussianNB from sklearn.ensemble import RandomForestClassifier from sklearn.linear_model import RidgeClassifier from sklearn.neighbors import KNeighborsClassifier from sklearn.linear_model import LogisticRegression from sklearn.neural_network import MLPClas...
19b7cdbe62aec73db2b112b3092ff1686d9f6f314e8b841c3e5da1a6a8e153af
Jupyter
6,917
240
# %% [markdown] # <a href="https://colab.research.google.com/github/cmartinezUCSC/Lyrics_Gender_Violence/blob/main/BETO_model.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> # %% !pip install transformers # %% from transformers import BertTokenizer...
c9c6e32b0dc9f2c1386fe6ff5c20b207466f0544c2d79b0bcf0d9e77ec11af5e
Jupyter
6,932
207
# %% [markdown] # # The Depo Detection tool # >We finetuned the ESM2 model successfully (92% accuracy)<br> # >The goal now is to stack a RNN layer for a binary classification into Dpo or Not Dpo categories # *** # ## I. Load prebuilt model # ## II. Stack RNN layer # ## III. Train Eval # ## IV. Metrics # *** # %% [mar...
d5ac4618b91074abb01456347f620a3a8d6956319557003fe2f7965df3a759a8
Jupyter
6,946
257
# %% [markdown] # # MNIST with SciKit-Learn and skorch # # This notebooks shows how to define and train a simple Neural-Network with PyTorch and use it via skorch with SciKit-Learn. # # <table align="left"><td> # <a target="_blank" href="https://colab.research.google.com/github/skorch-dev/skorch/blob/master/notebooks...
0584c1640c0eeb1579dcf89803ad822677c6c6044fad374d698033737b1eef22
Jupyter
6,947
280
# %% import numpy as np np.random.seed(2) 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...
248df37c542287cf713515aceb743ee29f645cf9ea954bed989c9b774a70fceb
Jupyter
6,973
256
# %% %load_ext autoreload %autoreload 2 # %% import os import os.path import skimage import skimage.segmentation import sklearn.preprocessing import sklearn.model_selection import math import shutil import pathlib import glob import shutil import uuid import random import platform import torch import torchvision impor...
f96d0dd5c055ae38033235b682872b96c7298fe90d8e5e424a279c400f610bab
Jupyter
6,985
201
# %% #@markdown Check type of GPU and VRAM available. !nvidia-smi --query-gpu=name,memory.total,memory.free --format=csv,noheader # %% [markdown] # https://github.com/ShivamShrirao/diffusers/tree/main/examples/imagic # %% [markdown] # ## Install Requirements # %% !wget -q https://github.com/ShivamShrirao/diffusers/r...
a930dab1a3f85b95e52a13b0d80c171415b9b1289f658f1b9dd4a06bc200e901
Jupyter
6,989
251
# %% [markdown] # # Evaluate CCSBase train and test # %% from mol2ccs.utils import performance_evaluation import pandas as pd import seaborn as sns import matplotlib.gridspec as gridspec from matplotlib import pyplot as plt from matplotlib_venn import venn3 from utils import ( compare_models_by_adduct, compar...
02246857b4688dc54621a110ccaf01fbd5300d78d6c759f1b24597d13f59da44
Jupyter
6,994
234
# %% %load_ext autoreload %autoreload 2 # %% import sys import time import logging import argparse import itertools import matplotlib import matplotlib.pyplot as plt from tqdm.auto import tqdm import numpy as np from measures import DataStore # %% directory = "5-bilinear-continuum/data/" keys=['I_ext_1','I_ext_2'] n...
1a7c0ed19d73b8d54e639c1451bb98768081be8ffdc25c0153e97e1687df641a
Jupyter
6,994
268
# %% !pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps # %% !pip install -U kaleido # %% from os.path import join import anndata import scanpy as sc import dask.dataframe as dd import dask.array as da import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # %% PATH...
257f9b34cb8022ab5fde5d1a77fd05f45888146eaa41efabe24b9ce362e3ae21
Jupyter
6,994
197
# %% [markdown] # ### 3 Visualization - Prediction Confidence Heatmaps # # A sliding window approach was applied on the whole slide images (WSIs) with the trained CNN model to generate confidence heatmaps. # # The WSIs were tiled into 1536 x 1536 images patches in the prepocessing steps. A sliding window approached ...
1a996dbeaf51f54d02747093a56bda55577c51a6e7ef69e5e5e903e1d34bbe34
Jupyter
7,002
207
# %% [markdown] # # Using MLflow with Tune # # <a id="try-anyscale-quickstart-tune-mlflow" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=tune-mlflow"> # <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quickstart"> # </a> # <br></b...
077eaa858d73e3206b102e34ae01009eb0387cee45bb47ad8b28f1ce52ded445
Jupyter
7,021
254
# %% %load_ext lab_black import os, sys %load_ext autoreload %autoreload 2 import matplotlib matplotlib.rcParams["pdf.fonttype"] = 42 matplotlib.rcParams["ps.fonttype"] = 42 import scdrs.util as util import scdrs.data_loader as dl import scdrs.method as md import submitit import os import yaml import os, sys import...
2308b3eb994f1e541e635f0ba5d523ed5b1fec8a1161d19f59077f4461617e9c
Jupyter
7,093
147
# %% [markdown] # # STARDUST (cell-based version) # %% [markdown] # This Jupyter Notebook provides an interactive version of STARDUST for analysis using cell-based fluorescence data (average fluorescence per cell). The required input for this analysis one mask/map and the time series generated from the map. Functions ...
fbb732e74dfb8cadfe3b346773cf96ffe09309f6c4c1a651fe2bad139f14c11e
Jupyter
7,101
198
# %% [markdown] # # Generate a MSA for each candidate protein # *** # ## A. Generate a fasta database with all the candidate proteins # ## B. Run mmseqs on the fasta database vs Uniref90 # ## C. Generate an MSA for each proteins # *** # %% [markdown] # A. Generate the query database # %% import os from tqdm import...
3d22841f404044130dc38745bd124b8feee27112734c1818275ea42ece96568f
Jupyter
7,106
179
# %% [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...
9ee9988bee232e98a1fce59915b2c970a1c85b76c7d588a37091ebf60342a144
Jupyter
7,106
192
# %% [markdown] # # Demonstration of using Hugging Face vision transformer with skorch # %% [markdown] # Based on this [blog post](https://huggingface.co/blog/fine-tune-vit), we show how with only a few lines of custom code, we can fine-tune a Vision Transformer model for a classification task. # %% [markdown] # In a...
18f83055a43d61ac56317e348181a71a6406d70dc0996f3f75c93795e63dfb1d
Jupyter
7,115
202
# %% import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt import seaborn as sns import matplotlib.pylab as pl import matplotlib.gridspec as gridspec import scipy.ndimage as ndimage from matplotlib.ticker import AutoMinorLocator, FormatStrFormatter import matplotlib.mlab as mlab from matplotlib i...
2205ac621a21c733ce44f4233f86f1a1cfddab377068f1c6a8023f110e5e0684
Jupyter
7,133
218
# %% [markdown] # # Create one DataFrame out of the split participant 8 # %% [markdown] # __Data Saved: (same as in 1v but only for participant 8)__ # %% [markdown] # uid == "19a33ac1-149b-407c-a506-a2c7f4f3fea1" # - __Timestamps_try_uid.json__ --> json with substracted start from most behavioral timestamps # - __Tim...
2653ecda53fb5996fcf31a8a76035232913b34cc145793df09edaa8f218ddb91
Jupyter
7,141
168
# %% [markdown] # # Imports # --- # %% from batchgenerators.dataloading.data_loader import SlimDataLoaderBase from batchgenerators.dataloading.multi_threaded_augmenter import MultiThreadedAugmenter import numpy as np import time import math # %% [markdown] # Defining an "Epoch Dataloader with Shuffle" # --- # This i...
27e28f15ec2cd52385695eba302ff97790dbee89b87dc07e29fed8f294439357
Jupyter
7,170
176
# %% [markdown] # ### Import modules # %% import json import numpy as np import pandas as pd from tqdm import tqdm from rdkit import Chem import os from typing import Optional from rdkit import Chem # %% [markdown] # ### Generate docking grid file # %% def calculated_docking_grid_sdf(work_path, json_path, pdbid, lig...
e4cbbcb5f7cf3306b6d30cb2a9c37bb0d58094cf272d3049c5baeaf862525405
Jupyter
7,199
187
# %% [markdown] # # Running Tune experiments with HyperOpt # # <a id="try-anyscale-quickstart-ray-tune-hyperopt_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-hyperopt_example"> # <img src="../../_static/img/run-on-anyscale.svg" alt...
f0555ca17bc0f55b26d992047fc9d36bcf1e4758025f9459f6bce35d4f3be71c
Jupyter
7,199
222
# %% [markdown] # # scTools # # > Single-cell large-scale analysis tools # %% #| default_exp tools # %% #| hide from nbdev.showdoc import * # %% #| hide import nbdev; nbdev.nbdev_export() # %% [markdown] # # import # %% #| export import numpy as np import scanpy as sc import math import matplotlib.pyplot as plt ...
ceea42928a042e6e614579fbe538b5d311ba6deeaec564e1cbfd3917d7a5615e
Jupyter
7,205
221
# %% [markdown] # # Running Tune experiments with BOHB # # <a id="try-anyscale-quickstart-ray-tune-bohb_example" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=ray-tune-bohb_example"> # <img src="../../_static/img/run-on-anyscale.svg" alt="try-anysca...
2559726f58437d74b55557238433f36f9be00fad9bbbde4ceb9ba0f63cc0a9e8
Jupyter
7,210
205
# %% [markdown] # ### 4.1 Saliency Mapping - Feature Occlusion # # Feature occlusion studies were performed to show the influence of occluding regions of input image to the confidence score predicted by the CNN model. # # The occlusion map was computed by replacing a region of the image with a pure white patch and g...
09a7aff27d8a20e75dc3da48580f3c0e847023b11eaf6633595ac3619fc4c7b5
Jupyter
7,236
162
# %% [markdown] # # Data preparation # %% [markdown] # NeuralGCM models take and produce data on defined on [37 pressure levels](https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-pressure-levels), including the following variables, provided in SI units and on the NeuralGCM model's native grid: # # - ...
8305493d9c00f8be1cb5e1d6184feb8f0f5317f830fb1f738075fe4724649a4a
Jupyter
7,288
192
# %% [markdown] # # Perform Experiments with DeepFace on LFW dataset # %% # built-in dependencies import os # 3rd party dependencies import numpy as np import pandas as pd from tqdm import tqdm import matplotlib.pyplot as plt from sklearn.metrics import accuracy_score from sklearn.datasets import fetch_lfw_pairs from...
0356bcac55ca2e4bc4d229fe25188e33873b08598f0397c27628dc1ba929015f
Jupyter
7,289
179
# %% [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...
89383738855c2b68ebf5f1a2052224644794cf476f8d221249a0dd5bb9a281a2
Jupyter
7,345
196
# %% import os import json import glob import numpy as np from collections import defaultdict import matplotlib.pyplot as plt import csv # %% # Set path to MRIQC outputs mriqc_path = '../../derivatives/mriqc/sub-*/ses-*/*/' def get_mriqc_summary(mriqc_path, image_type, metrics_to_plot): json_files = glob.glob(os...
0c740a96780fec42ce0baa38fd9a42c9573e126d3c66c679c3ce0c797a229223
Jupyter
7,359
244
# %% [markdown] # # Simple HRNet # This is a light Google Colab notebook showing how to use the [simple-HRNet](https://github.com/stefanopini/simple-HRNet) repository. # # It includes the conversion to TensorRT and a test of the converted model. # Please skip the section "TensorRT" if not interested. # # Initial idea...
e8a59b644e39f1830bd5c52978682071b4b86512d3d044fbbd798ff9644c48e3
Jupyter
7,399
230
# %% [markdown] # ### Models Genesis in Diffusion MRI # %% [markdown] # This is an example on how to implement the transforms proposed in Models Genesis: Generic Autodidactic Models for 3D Medical Image Analysi (Zhou et al., https://arxiv.org/abs/1908.06912). # The transforms here follow the propositions of Models Ge...
4a668823ae00a3d41f92f221ecdf7d65ccb6e6529fa59c1a4ab084b3983ba9d9
Jupyter
7,400
305
# %% !pip install -e /dss/dsshome1/04/di93zer/git/cellnet --no-deps # %% !pip install -q SPARQLWrapper # %% # !pip install -q cellxgene-census !pip install -q obonet # %% %load_ext autoreload # %% import pickle import os from os.path import join import numpy as np import pandas as pd import seaborn as sns import ...
4cf875f3ec3948e51ca6e78f31c0941b86f69436219124f80635c18d619e297e
Jupyter
7,414
231
# %% [markdown] # # Create Deep Neural Network for SF Analysis by Functional Term # %% #!conda install pytorch torchvision torchaudio cpuonly -c pytorch -y # %% import pandas as pd import numpy as np from sklearn.model_selection import KFold from sklearn.metrics import r2_score import torch import torch.nn as nn impo...
500c64cc4651997d06c84c58b43951cffaaf012973e4fce142850b5c8ade146b
Jupyter
7,421
179
# %% # Copyright 2022 NVIDIA Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
ad231868bb26516f55bf8ad8238db9347e5a1a31405506fe3c792c431fdf0ef0
Jupyter
7,428
235
# %% [markdown] # # Summarize results at cell-type level for the purpose of contrasting results across species # 1. Proportion of FDR < 10% at various parameter for scDRS. # 2. Cell type level p-value for scDRS # 3. Geary's C statistics for 10kb, 1000 genes default settings. # 4. LDSC-SEG p-value # %% %load_ext lab_b...
822087302695604df851cb3b5fdd5321407446d71d21fed6fe5a71d58d51f25b
Jupyter
7,445
136
# %% [markdown] # (nirtorch_interpreting)= # # To PyTorch: Interpreting NIR # # We rely on [`torch.fx`](https://pytorch.org/docs/stable/fx.html) to interpret NIR graphs. # We first translate all the NIR nodes into PyTorch nodes, by going through the nodes in the NIR graph one by one. # This mechanism relies on a dicti...
fb8b58d2c8eda00a8333845a0651a0ee38189b6bb2d3677b5c425155b08f2174
Jupyter
7,447
198
# %% [markdown] # # GOAL : generate ESMfold prediction for the selected proteins after V3 # ### I. Generate the sequence file # ### II. The prediction script # *** # %% [markdown] # I. # %% # Build the sequence idex file : import os from Bio import SeqIO import pandas as pd path_millard = "/home/conchae/ML_depolym...
d8602430c2522706b58753261b195a6c74a2bfefbd8f23897a10d019a77cf47a
Jupyter
7,448
200
# %% [markdown] # # GOAL : generate ESMfold prediction for the selected proteins after V3 # ### I. Generate the sequence file # ### II. The embedding script # *** # %% [markdown] # I. # %% # Build the sequence idex file : import os from Bio import SeqIO import pandas as pd path_millard = "/home/conchae/ML_depolyme...
369c24bfc514a091f1b0ed0e43eb65b727475c86918284ef2d699422752ad747
Jupyter
7,450
278
# %% import Pyomic %matplotlib inline # %% import pandas as pd import matplotlib.pyplot as plt import numpy as np from sklearn import linear_model from scipy.stats import norm from scipy import stats import networkx as nx import datetime import seaborn as sns import pandas as pd from scipy.cluster import hierarchy f...
912059e3a9912d31467a96324215108607007120b2a89159aece43e1d7950874
Jupyter
7,453
206
# %% import numpy as np import matplotlib.pyplot as plt from lgca import get_lgca from itertools import product import pickle as pkl import string from itertools import cycle PATH = '.\\data\\gog\\nonlocaldensity_10reps\\' parameters = np.load(PATH+'params.npz', allow_pickle=True) constparams = parameters['constparams...
e6849c8101afbcca6164efa693a179c89bfd0d497574b44e65d20b7a8ae81302
Jupyter
7,479
204
# %% from sklearn.metrics import multilabel_confusion_matrix, classification_report, roc_curve, auc, confusion_matrix, \ RocCurveDisplay, precision_score, recall_score, average_precision_score, PrecisionRecallDisplay, precision_recall_curve import numpy as np import seaborn as sns import pandas as pd import numpy ...
5a6ba9dbd5b8ae5eb2bfdaa54eb405c315a4096dd30c39f233990e175cb95954
Jupyter
7,501
166
# %% [markdown] # # Lava-dl hdf5 export # # In order to test the export process, we used the [Oxford example](https://lava-nc.org/lava-lib-dl/slayer/notebooks/oxford/train.html) available in the LAVA-dl repository. Since this page is focused on NIR implementations, we are not covering the training aspects, but readers...
3ecf15500eb7472d266299ec574d8dbf2693ea75db71b53d3f12ebdd1dc88861
Jupyter
7,504
194
# %% import math from sklearn import metrics from sklearn import preprocessing import matplotlib.pyplot as plt import numpy as np import pandas as pd import re import time import datetime import random random.seed(1234) from scipy import interp import warnings warnings.filterwarnings("ignore") from collections import...
c47cd0d07da4f485c902bb7b97c94ab00f61f74b9acd5d432f412c4039e4c735
Jupyter
7,556
206
# %% [markdown] # # Change activations in spiking layers # Sometimes it's helpful to change spiking, membrane reset or backpropagation behaviour. Let's look at a few examples based on the Integrate and Fire (IAF) layer. # %% import torch import torch.nn as nn import sinabs import sinabs.layers as sl import sinabs.acti...
ae2a17979430678b9244fffb8ee1bae42dd25e4ece5a5b864d9831ff2a58d37c
Jupyter
7,557
229
# %% import scanpy as sc import seaborn as sns import scvi import matplotlib.pyplot as plt # %% [markdown] # ## Load data # %% adata=sc.read_loom('merged_IN.loom') plt.rcParams['figure.figsize']=(8,8) #rescale figures plt.rcParams.update({'font.size': 18}) # %% adata.obs_names=adata.obs.obs_names adata.var_names=ada...
ad04e6814f92218dadaef8d3e3dd54f139b135d0dc56bf88563183600f1039aa
Jupyter
7,560
236
# %% [markdown] # # Simple Parallel Model Selection # # <a id="try-anyscale-quickstart-plot_hyperparameter" href="https://console.anyscale.com/register/ha?render_flow=ray&utm_source=ray_docs&utm_medium=docs&utm_campaign=plot_hyperparameter"> # <img src="../../_static/img/run-on-anyscale.svg" alt="try-anyscale-quic...
a74e09873c478bf19d32b8dc27351b1560a9e8b9ffb0bf2b3ca530b6098ff527
Jupyter
7,568
221
# %% import numpy as np import os from pynwb import NWBFile, NWBHDF5IO, image from pynwb.ophys import TwoPhotonSeries, OpticalChannel, ImageSegmentation, ImagingPlane from pynwb.file import Subject from pynwb.device import Device import math import statistics import pandas as pd import h5py #Provides methods to supple...