sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
ff56b8f2a5450e03eb8dc908042e8f3f6a335d3ccc0036f208e53540a207b82a
JavaScript
72,824
1,502
import * as json from './json.js'; import * as python from './python.js'; const keras = {}; const tfjs = {}; keras.ModelFactory = class { async match(context) { const identifier = context.identifier; const extension = identifier.lastIndexOf('.') > 0 ? identifier.split('.').pop().toLowerCase() : ...
f3f46b6dc8a003e536bde5c214b591f6e6bd2b2e585dc3cce9cd387c09cc3064
JavaScript
73,807
1
var hpo_umls = {"HP:0003449": ["UMLS:C1861675"], "HP:0003565": ["UMLS:C0151632"], "HP:0003292": ["UMLS:C1837802"], "HP:0002584": ["UMLS:C0267373"], "HP:0002583": ["UMLS:C0009319"], "HP:0000729": ["UMLS:C0856975", "UMLS:C1510586"], "HP:0010976": ["UMLS:C1855067"], "HP:0010878": ["UMLS:C0948242"], "HP:0000722": ["UMLS:C0...
e02b82992182f9561d9a8f6a4b2fdb51b6c8d4f9b87f46b6e22521fdce2867a6
JavaScript
75,448
1,274
import * as child_process from 'child_process'; import * as fs from 'fs/promises'; import * as os from 'os'; import * as path from 'path'; import * as process from 'process'; import * as readline from 'readline'; import * as tablegen from './tablegen.js'; import * as url from 'url'; const write = (message) => { i...
4eb1bae9c54e56fdea4dc686255011e7cd2680212e2b46e9a3f9cad20f6260c6
JavaScript
77,209
2,282
export const tosa = {}; tosa.v0 = {}; tosa.v0.DType = { UNKNOWN: 0, '0': 'UNKNOWN', BOOL: 1, '1': 'BOOL', UINT8: 2, '2': 'UINT8', INT4: 3, '3': 'INT4', INT8: 4, '4': 'INT8', INT16: 5, '5': 'INT16', INT32: 6, '6': 'INT32', INT48: 7, '7': 'INT48', FP32: 8, '8': 'FP32', UINT16: 9...
5509b7fe6d175ad1143bdef9550f3e8bc4bf83be02736ec31ffccd81c4789224
JavaScript
77,363
31
/* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2015 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the r...
2aebc2552d7dadf4e3a0b80cc830c274e91146584dad8e29b04338b9ecedb363
JavaScript
78,468
7
/*! * Bootstrap v5.1.0 (https://getbootstrap.com/) * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=...
cf6418ad1f0d70c24a6bc3a0257988d25933e8878ccf456ae6e5f74c981b0614
JavaScript
78,857
2,337
// Experimental import * as base from './base.js'; const mlnet = {}; mlnet.ModelFactory = class { async match(context) { const entries = await context.peek('zip'); if (entries instanceof Map && entries.size > 0) { const root = new Set(['TransformerChain', 'Predictor']); ...
60eec6d07a0a0b638aca5b35985b08ac46c8be77d639fd9e3d0500e96c5b1778
JavaScript
83,962
1
Search.setIndex({"docnames": ["example 0 hyperparameter groundtruth test", "example 1 load data", "example 2 heuristic parameter lgcp infer", "example 3 optimize hyperparameters", "example 4 confidence intervals", "example 5 heading dependence", "index", "lgcpspatial", "lgcpspatial.estimators", "lgcpspatial.gridsearch"...
633ba16fa4ae95cc60b2a7dd1dceff0a235d31edc5340e6249ee9c0fcd96d0c8
JavaScript
86,350
4
/*! jQuery v3.1.0 | (c) jQuery Foundation | jquery.org/license */ !function(a,b){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?wi...
b10cbd29d770f3036a820ef73bb797e27499ff67c8ed770cb604f445c3d7750b
JavaScript
87,357
2,429
export const mgb = {}; mgb.serialization = mgb.serialization || {}; mgb.serialization.fbs = mgb.serialization.fbs || {}; mgb.serialization.fbs.DTypeEnum = { Float32: 0, '0': 'Float32', Uint8: 1, '1': 'Uint8', Int8: 2, '2': 'Int8', Int16: 3, '3': 'Int16', Int32: 4, '4': 'Int32', IntB1: 5, '5'...
7e8993540ebc6d27129b3e0cd6a124573a473baac465ffeff82991bf2db7b3cb
JavaScript
92,728
2,715
export const onnx = {}; onnx.Version = { "_START_VERSION": 0, "IR_VERSION_2017_10_10": 1, "IR_VERSION_2017_10_30": 2, "IR_VERSION_2017_11_3": 3, "IR_VERSION_2019_1_22": 4, "IR_VERSION_2019_3_18": 5, "IR_VERSION_2019_9_19": 6, "IR_VERSION_2020_5_8": 7, "IR_VERSION_2021_7_30": 8, ...
71739e31aac58c067bdb8899a35fec39ad298ae96f1fa6034046ccb9703bf83b
JavaScript
100,942
2,249
import * as base from './base.js'; const kmodel = {}; kmodel.ModelFactory = class { async match(context) { const reader = kmodel.Reader.open(context.stream); if (reader) { return context.set('kmodel', reader); } return null; } async open(context) { co...
f937ea654a669e942dc57687bf6967866bc140e891b408e0cbaf7df3fcaa5e60
JavaScript
102,220
2,221
// Experimental import * as base from './base.js'; import * as protobuf from './protobuf.js'; import * as zip from './zip.js'; const tf = {}; tf.ModelFactory = class { async match(context) { const identifier = context.identifier; const extension = identifier.lastIndexOf('.') > 0 ? identifier.sp...
cbd5cd24d786593f01dc138958bbfce44c254bcde7c3724bf85e6bcd7fe2a6e1
JavaScript
104,796
2,455
const dagre = {}; // Dagre graph layout // https://github.com/dagrejs/dagre // https://github.com/dagrejs/graphlib dagre.layout = (nodes, edges, layout, state) => { let uniqueIdCounter = 0; const uniqueId = (prefix) => { const id = ++uniqueIdCounter; return prefix + id; }; const fla...
6b239ec52155c4819d7ac89f8c4c530e9dde3490566cecb3c278fb368b5aaaac
JavaScript
111,788
2,917
import * as protobuf from './protobuf.js'; const onnx = {}; onnx.ModelFactory = class { async match(context) { const identifier = context.identifier; const extensions = [ 'saved_model.pb', 'predict_net.pb', 'init_net.pb', 'predict_net.pbtxt', 'init_net.pbtxt', 'predict_ne...
03b2b970a6add9aca3295f080511b58c0247f9279a462ea36841dc7053a8cb2e
JavaScript
116,695
1
var dischargeSummaryObj = [{"end": 152, "text": "Admission Date: [**2199-5-10**] Discharge Date: [**2199-5-11**]\n\nDate of Birth: [**2126-3-7**] Sex: M\n\nService: SURGERY\n\n", "section": "", "anns": [{"endNode": {"id": 4085, "offset": 60}, "startNode": {"id": 4084, "offset": 46}, "type...
d58de4e899ed5730734820f733f22181975c96557a963141e49427611ff89a54
JavaScript
124,733
3,418
export const MNN = {}; MNN.NetSource = { CAFFE: 0, '0': 'CAFFE', TENSORFLOW: 1, '1': 'TENSORFLOW', TFLITE: 2, '2': 'TFLITE', ONNX: 3, '3': 'ONNX', TORCH: 4, '4': 'TORCH' }; MNN.DataType = { DT_INVALID: 0, '0': 'DT_INVALID', DT_FLOAT: 1, '1': 'DT_FLOAT', DT_DOUBLE: 2, '2': 'DT_DOUBLE',...
ef6d82272718401948b63c684f383eeff6dc74b013c134592f5585ad2d80d5b6
JavaScript
125,662
3,085
export const armnnSerializer = {}; armnnSerializer.ActivationFunction = { Sigmoid: 0, '0': 'Sigmoid', TanH: 1, '1': 'TanH', Linear: 2, '2': 'Linear', ReLu: 3, '3': 'ReLu', BoundedReLu: 4, '4': 'BoundedReLu', SoftReLu: 5, '5': 'SoftReLu', LeakyReLu: 6, '6': 'LeakyReLu', Abs: 7, '7': 'Ab...
ada9fa2ba3f548947074d9b2580feb25738ba0cbc73263cb75af3387a13619fa
JavaScript
130,917
2,812
// Experimental import * as base from './base.js'; import * as flatbuffers from './flatbuffers.js'; import * as python from './python.js'; const pytorch = {}; const nnapi = {}; const numpy = {}; pytorch.ModelFactory = class { async match(context) { const reader = await pytorch.Reader.open(context); ...
fc8f53ccfba3585554755c686f86309078cf067f9f1b7a72218dd1040c77ce8e
JavaScript
134,619
3,675
export const circle = {}; circle.TensorType = { FLOAT32: 0, '0': 'FLOAT32', FLOAT16: 1, '1': 'FLOAT16', INT32: 2, '2': 'INT32', UINT8: 3, '3': 'UINT8', INT64: 4, '4': 'INT64', STRING: 5, '5': 'STRING', BOOL: 6, '6': 'BOOL', INT16: 7, '7': 'INT16', COMPLEX64: 8, '8': 'COMPLEX64', ...
de3cfdfca11fbe7a093a07d5d012b2b98754698d6d948f42773263b829bd3e13
JavaScript
142,627
3,731
/* eslint-disable */ /* pako 1.0.11 nodeca/pako */ // added for lightweight web worker support const _pakoMod = { exports: {} }; const _pakoExp = _pakoMod.exports; (function (f) { if (typeof _pakoExp === "object" && typeof _pakoMod !== "undefined") { _pakoMod.exports = f(); } else if (typeof define === "functio...
78c4f3ef9a486f7dd4b122fcf2891174adbbcb4c5fcba991ea8e8681ef109587
JavaScript
148,053
4,041
export const tflite = {}; tflite.TensorType = { FLOAT32: 0, '0': 'FLOAT32', FLOAT16: 1, '1': 'FLOAT16', INT32: 2, '2': 'INT32', UINT8: 3, '3': 'UINT8', INT64: 4, '4': 'INT64', STRING: 5, '5': 'STRING', BOOL: 6, '6': 'BOOL', INT16: 7, '7': 'INT16', COMPLEX64: 8, '8': 'COMPLEX64', ...
da4013b083a8c088200995e519c576424fec4bd8862719f5256c626cde21a252
JavaScript
148,331
3,495
import * as fs from 'fs/promises'; import * as path from 'path'; const tablegen = {}; tablegen.Location = class { constructor(file, line, column) { this.file = file; this.line = line; this.column = column; } toString() { return `${this.file}:${this.line}:${this.column}`;...
fedf48eca5b48690cdbe0a7a4470d4099b6215209c4ec6cb4813a5e462040de3
JavaScript
166,286
4,600
export const mindspore = {}; mindspore.schema = mindspore.schema || {}; mindspore.schema.ResizeMethod = { UNKNOWN: -1, '-1': 'UNKNOWN', LINEAR: 0, '0': 'LINEAR', NEAREST: 1, '1': 'NEAREST', CUBIC: 2, '2': 'CUBIC' }; mindspore.schema.CoordinateTransformMode = { ASYMMETRIC: 0, '0': 'ASYMMETRIC', ...
0a816647e4df48aa9271fc16b5b39a3e878f9bf1be843f490274bcd9be533076
JavaScript
182,571
5,221
export const caffe = {}; caffe.BlobShape = class BlobShape { constructor() { this.dim = []; } static decode(reader, length) { const message = new caffe.BlobShape(); const end = length === undefined ? reader.length : reader.position + length; while (reader.position < end) ...
028d1cfbe88ac0b08801b314598d5bfa8c5b270475a0aa15562243fb6e311ff6
JavaScript
200,000
5,214
export const nnabla = {}; nnabla.Shape = class Shape { constructor() { this.dim = []; } static decode(reader, length) { const message = new nnabla.Shape(); const end = length === undefined ? reader.length : reader.position + length; while (reader.position < end) { ...
2e0115fa2dd5c2f5c56b3457d659f914602cba3ff2770722c34b4e2a79b3b3ea
JavaScript
200,000
1
var disease_model_100k = {"Severe multi-system atopic disease with high IgE": [{"hpo_label": "Eczema", "hpo_id": "HP:0000964"}, {"hpo_label": "Increased IgE level", "hpo_id": "HP:0003212"}, {"hpo_label": "Allergy", "hpo_id": "HP:0012393"}, {"hpo_label": "Cow milk allergy", "hpo_id": "HP:0100327"}, {"hpo_label": "Season...
31efb20d75260d8e91ab9b7e147fed2c255f84ebd9d2c7ccdc821ad3e9305158
JavaScript
200,000
5,650
export const tensorflow = {}; export const google = {}; tensorflow.SavedModel = class SavedModel { constructor() { this.meta_graphs = []; } static decode(reader, length) { const message = new tensorflow.SavedModel(); const end = length === undefined ? reader.length : reader.posit...
346c98caa0c26fddac337315a5b96be16fd936e60604753ff2df9f91ae649e11
JavaScript
200,000
6,687
/*! elasticsearch - v12.1.3 - 2016-12-14 * http://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/index.html * Copyright (c) 2016 Elasticsearch BV; Licensed Apache-2.0 */ ;(function () { /* prevent lodash from detecting external amd loaders */var define; /******/ (function(modules) { // webpackB...
3a1581d077442ce14b6428be1f63157d36c783a81d13ed1ca61555269e33dfcb
JavaScript
200,000
5,012
import * as base from './base.js'; import * as grapher from './grapher.js'; const view = {}; const markdown = {}; const png = {}; const metadata = {}; const metrics = {}; view.View = class { constructor(host) { this._host = host; this._defaultOptions = { weights: true, at...
8d984a80128c35a5fa0da48861c543f89c97d053ecb8fe3167dd22c65562733d
JavaScript
200,000
1
var hpo_umls = {"HP:0003566": ["UMLS:C3150358"], "HP:0003295": [], "HP:0003296": ["UMLS:C2673931"], "HP:0003297": ["UMLS:C4021733"], "HP:0003562": ["UMLS:C3277127"], "HP:0003563": ["UMLS:C0020597", "UMLS:C0853085"], "HP:0003292": ["UMLS:C1837802"], "HP:0003561": ["UMLS:C1855650"], "HP:0001151": ["UMLS:C1866753"], "HP:0...
b7311faa13414737c0601e9e0e6334083c4be72436b86a751c0fb1ffeedb135d
JavaScript
200,000
2,324
var json = { meta: [ { chromosome: "1" startPoint: 1 endPoint: 249250621 color: "#FF0000FF" }, { chromosome: "2" startPoint: 1 endPoint: 243199373 color: "#FF3D00FF" }, { chromosome: "3" startPoint: 1 endPoint: 198022430 color: "#FF7A00FF" }, { chromosome: "4" startPoint: 1 endPoint: 191154276 color: "#FFB800FF" }...
b9de0f9c2990b9b2f9f9eaae7767e9e77826ad4a83237629c1a1e34d762c5ad8
JavaScript
200,000
1
var _subconcepts = {"C2219717": [["C0002453", "RO"]], "C0043515": [["C0017152", "RN"], ["C0039082", "RN"], ["C0597168", "RN"], ["C0013395", "RO"], ["C0017150", "RO"], ["C0025267", "RO"], ["C0027662", "RO"], ["C0030920", "RO"], ["C0232567", "RO"], ["C0242003", "RO"], ["C0376180", "RO"]], "C1837084": [["C1836192", "RO"],...
d396944f96472a3c4fb328ef99c35406367096ff40476f11bba7b113dfddb6dd
JavaScript
200,000
5,414
// Experimental import * as base from './base.js'; import * as text from './text.js'; const mlir = {}; const _ = {}; mlir.ModelFactory = class { async match(context) { const stream = context.stream; const identifier = context.identifier; const extension = identifier.split('.').pop().toL...
fa33a2087cc4cd06899c57ccb42ede13b086034f712a2fd4cebfdd07852e36bc
JavaScript
200,000
5,325
export const CoreML = {}; CoreML.Specification = {}; CoreML.Specification.Pipeline = class Pipeline { constructor() { this.models = []; this.names = []; } static decode(reader, length) { const message = new CoreML.Specification.Pipeline(); const end = length === undefine...
7e13cb548c24278d6e3dfd7d3d7fe325ab8e1eac569f8504b5fa9d4e27e43136
JavaScript
200,001
2
// https://d3js.org Version 4.13.0. Copyright 2018 Mike Bostock. (function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.d3=t.d3||{})})(this,function(t){"use strict";function n(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function e(t){return...
e84861aeb022c84f3b574e47e13ed7cf67dec543749debbb79a803a98b4a717d
JavaScript
200,002
3,877
// Experimental Python Execution const python = {}; python.Execution = class { constructor(sources) { /* eslint-disable consistent-this */ const self = this; /* eslint-enable consistent-this */ const execution = self; this._sources = sources || new Map(); this._ev...
20833df2bcc52f4d9688b9fad877e7ff8aefca8338b2f64740f03f043932a559
Jupyter
364
11
# %% #Only need to do once for each hemisphere from brainsmash.workbench.geo import cortex surface = "./SurfL10kConte.gii" cortex(surface=surface, outfile="./SurfL10kConte.txt", use_wb=True,euclid=False) from brainsmash.workbench.geo import cortex surface = "./SurfR10kConte.gii" cortex(surface=surface, outfile="./Surf...
3491fc876e89963c7ba765c13a14c327233812ed707f0991e15611ef5ef0d896
Jupyter
371
21
# %% # test without view import torch import pandas as pd import numpy as np from simple_mlps.datas import ParcellationDataCorrelated df = ParcellationDataCorrelated(1, 'all', correlation_coeff=3.0) df = pd.DataFrame({"hit": df.hit, "time": df.time_obs}) df.groupby("hit").apply(np.mean) # %% import seaborn as sns ...
d9439c658d59eaaaee3725a0138013d3caa489b3e57ed89f54bf6fa0c2bf1349
Jupyter
375
17
# %% import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import yasa # %% data = np.load(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure1d_data.npy') hypno = np.load(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure1d_hypno.npy') sf = 100 # %% fig = yasa.plot_spectrogram(data, sf, h...
9fcf21d7fd931c0e09d419cd03fa7f59db15e23e8dd2cc0221f24037e0e248db
Jupyter
515
27
# %% %load_ext autoreload %autoreload 2 from config import * fn = 'r2405_051216b_cell1816.mat' data = Dataset.from_file(datadir+fn).prepare() arena = data.arena # Used to locate peaks in the autocorrelogram kf = kernelft( data.shape, data.P, data.V, angle=data.angle, style='grid') result,model...
ed52a6e9b02ac2c747ad9e9026e1c62eb6423d1bdcfab396cc989c32c688c3ec
Jupyter
552
25
# %% import os from rdkit import Chem from serenityff.charge.dataset_preperation.MolMorganDataset import MolMorganDataset # %% dummy_set1 = MolMorganDataset('./dummyset1.sdf') dummy_set2 = MolMorganDataset('./dummyset2.sdf') # %% dummy_set1.plot_compare(dummy_set2) # %% dummy_set1.missings(dummy_set2, DrawMolecules...
b38c519dda3d1d66c430956026d12d7337a77fd2f93a0d08dd4cc618ad50fc6d
Jupyter
578
21
# %% import numpy as np # %% def arclength(azi1, alt1, azi2, alt2, degrees=True, method="gs"): # https://en.wikipedia.org/wiki/Great-circle_distance from numpy import sin, cos if degrees: azi1, alt1, azi2, alt2 = np.radians((azi1, alt1, azi2, alt2)) delta_alt = np.abs(alt2 - alt1) if meth...
f6d2098968d528b007f596c72b343bb13bc6df8c3b90e3bc038497fb458ef741
Jupyter
640
29
# %% import pandas as pd import grequests import urllib.parse from tqdm import tqdm # %% SERVER_URL = "https://npclassifier.ucsd.edu" df = pd.read_csv("smiles.tsv", sep="\t") all_urls = [] for entry in tqdm(df.to_dict(orient="records")): smiles = str(entry["smiles"]) if len(smiles) > 5: request_url...
52931b2b9e5b3a7b1a545f54f994579aaabaae8247efaf70804a100c55556b66
Jupyter
667
32
# %% from statistics.survival_analysis import get_raw_kmf_by_group_full, load_metadata_mlp_pivot mlp = load_metadata_mlp_pivot() get_raw_kmf_by_group_full(mlp) # %% from statistics.shap_viz.shap_stats_cnn import bootstrap_pvals bootstrap_pvals('cnn') # %% from statistics.survival_analysis import * mlp_pivot = load...
a6c374c56fc710f0e5cd4406f4ec0c225bdfad7188955e7fc802f24b3213a269
Jupyter
816
29
# %% from matplotlib.pyplot import imshow from models.models import SegmentationModule, build_encoder, build_decoder from src.eval import segment_image from utils.constants import DEVICE # %% # path to image on which to run wall segmentation path_image = 'PATH_TO_IMAGE' # Model weights (encoder and decoder) weights_...
76ae075e9fdffec7e2173f58edc0964a31e483acde18deb24eac4860698f6a09
Jupyter
849
38
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt #import seaborn as sns %matplotlib inline # %% df = pd.read_csv('C:\\Users\\arif\\OneDrive\\Journal Paper\\Code\\Irshad\\Dataset\\4_fill_consectives_missing.csv', parse_dates=['date_and_hour'], index_col='date_and_hour') # %% df # %% df['Sys...
a7f20d1b2f71e085993d423d79a620d004f18d30d46751b85e428a4af55cfa5f
Jupyter
904
26
# %% [markdown] # # How to resume training # %% [markdown] # In many cases, you might want to continue training after an intitial training run (but with the same data). # # `sbi` supports this with the `.train(..., resume_training=True)` argument. # %% [markdown] # ## Main syntax # %% [markdown] # ```python # infer...
5d02eb57554159125f5cedde0b44841b3020f28a145028e62cd1400ede5e8795
Jupyter
957
63
# %% # mri-pet environment from statistics import demographic_statistics demographic_statistics.main() # %% # mri-pet from statistics import survival_analysis survival_analysis.main() # %% # mri-pet from statistics import brain_visualization brain_visualization.main() # %% # mri-surv from statistics.radiology_an...
717a08b5e7fc93aa73e786dfa07b7e692d7ffd9c21d55a330cbfc5614eee01a2
Jupyter
1,021
27
# %% from protein_mpnn_utils import StructureDataset # By default pandas isn't in the enviroment that the dockerfile setup # so run 'pip install pandas' if running this cell doesn't work import pandas as pd # %% # This is a good preliminary test before running the save train cell below # This is much smaller so if i...
ec59ed93a4ae7fd1caa3802786a95897a3846dbaaff6711d324066371e59aa75
Jupyter
1,034
48
# %% import sys import os from os import path import glob import json import re import matplotlib.pyplot as plt %matplotlib inline import numpy as np import pandas as pd from tqdm import tqdm from allensdk.core.brain_observatory_cache import BrainObservatoryCache # Local imports (hacky approach) if ".." not in sys.pa...
2ba9142ff73126ef8f465ab908409b0206e38ca534519868531575ae849b2b6d
Jupyter
1,048
11
# %% [markdown] # # How to choose neural nets # %% [markdown] # `sbi` implements a wide range of neural networks for the different inference methods. By and large, we expect that the default choices of `sbi` perform well. This tutorial describes how you can optimize the performance of `sbi` by choosing the best neural...
377719a95714654c276161e0eca4b103796f9458006e2683c85c0e4fea535541
Jupyter
1,074
43
# %% import os PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset # %% [markdown] # # Split the 1800s podcast audio into the 5 continguous chunks # %% import os import librosa import soundfile as sf # Parameters root_dir = f"{PODCAST_ROOT}/stimuli...
f7668998c1134886055285c9ac99235f99dbe292aa7d8610cce5976db2408dad
Jupyter
1,243
35
# %% [markdown] # # How to save and load objects # %% [markdown] # Save a trained inference object or posterior with `save()` and load it with the # `load()` class method of the same class. # # ```python # from sbi.inference import NPE, DirectPosterior # # # ... run inference # posterior = inference.build_posterior(...
74879c573d624cc6007a3e63c705c1217dbe868630466c06722d04546c46ee5f
Jupyter
1,265
36
# %% import seaborn as sns import pandas as pd import matplotlib.pyplot as plt # %% path = '/home/brainstimmap/Documents/DATA/20xx_Projects/2025_DBSinDepression/03_Data/Patient3/VTA_tracts/plot/structural/data4heatmap.csv' assessment_list = ['BDI', 'HAMD', 'MADRS', 'SHAPS', 'Sheehan', 'SOFAS', 'BARS'] complete_df = pd...
db1eff62b2912e05dfd5e36f24afbf1b39844cb83c6f3b74222943f018828543
Jupyter
1,308
13
# %% [markdown] # # How to choose summary statistics # %% [markdown] # Many simulators produce outputs that are high-dimesional. For example, a simulator might # generate a time series or an image. In the tutorial [04_embedding_networks](https://sbi.readthedocs.io/en/latest/tutorials/04_embedding_networks.html), we di...
bf16c1e2dde6461a37a8612eba91140de499d9413c33f3189e569186c9aeae9c
Jupyter
1,372
53
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt #import seaborn as sns %matplotlib inline # %% df = pd.read_csv('C:\\Users\\arif\\OneDrive\\Journal Paper\\Code\\Irshad\\Dataset\\2_Missing_Values_Identified.csv', parse_dates=['date_and_hour'], index_col='date_and_hour') # %% df.boxplot('Sys...
267992f2bf993afd86e05cafe20a23c39f67f45535e75ff2d1843aa55240984c
Jupyter
1,376
52
# %% import os PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset # %% [markdown] # # Save Downsampled High-gamma signals first so that other codes can use them # %% import mne import numpy as np from mne_bids import BIDSPath import os import scipy...
9fa9db4b5b3f12b892760e44a4a1f5df6eb6228d493ac2ed7e2807d15564ee4e
Jupyter
1,393
41
# %% import glob import pandas as pd # FIXME: replace with dir to ISRUC data/annotations f_path = "<path-to-ISRUC>" xlsx_paths = glob.glob(f"{f_path}/**/*.xlsx", recursive=True) s_id_to_l_events_map = {} for xp in xlsx_paths: ds_idx = xp.find("isruc-sg") ds = xp[ds_idx:ds_idx + len("isruc-sg") + 1] s_id ...
1cde68f154ac6a1bd0b2aeae798cb3f4f60ab368c800218906c7a37bfb1ba00a
Jupyter
1,423
37
# %% [markdown] # # How to refine posterior estimates with importance sampling # %% [markdown] # The `sbi` toolbox only requires samples from a simulator. When the likelihood can also be evaluated, importance sampling can refine a fixed-observation posterior estimate by using it as the proposal. Check importance-weigh...
a688960c8ab69f2e2ec096c1f3625a62bff81281cf653718d604034c0f8c321e
Jupyter
1,462
28
# %% [markdown] # # Example 2: Heuristic hyperparameters # %% [markdown] # We will use heuristic parameters to infer the posterior log-rate from an example dataset. The period of the grid can be inferred reasonably well from the radial autocorrelogram. The height of the kernel, reflecting the overall prior variance (u...
c0f22e1648f3a1e238e454adf906b8702a4a561b0d027af9ac32ebe1ea299074
Jupyter
1,489
59
# %% [markdown] # # Scikit-learn API # # For those not familiar with PyTorch, we've created a wrapper for scikit-learn. This contains the familiar fit/predict-methods. # %% from binn import BINNClassifier, Network, SuperLogger import pandas as pd # %% [markdown] # Similar to the PyTorch API, we load data and create...
a2b04c10342b5c6553d9c6fcde72765e4d73d4685d40558e5abf580b066da9fb
Jupyter
1,516
32
# %% [markdown] # # Example 2: Heuristic hyperparameters # %% [markdown] # We will use heuristic parameters to infer the posterior log-rate from an example dataset. The period of the grid can be inferred reasonably well from the radial autocorrelogram. The height of the kernel, reflecting the overall prior variance (u...
72b21269532f38862de69eab3f3e9793538fb3f0336c4cd52a60666dad337f8e
Jupyter
1,560
63
# %% import pandas as pd import numpy as np from tqdm import tqdm from rdkit import Chem from serenityff.charge.tree.dash_tree import DASHTree import time import os from matplotlib import pyplot as plt # %% # set matplotlib font size plt.rcParams.update({'font.size': 14}) # %% folder_aa = "/localhome/mlehner/dash_dat...
63ddcd4f74ea99426b3a9fa0888b5857651d834b70a2cba4fb89f18de64f7f8e
Jupyter
1,569
83
# %% [markdown] # # Generate Heatmap of Cell Type Markers for Different Genetic Backgrounds # %% import seaborn as sns import matplotlib.pyplot as plt import pandas as pd import numpy as np INPUT_CSV = "raw/genetic_backgrounds_marker_genes.csv" OUTPUT_PATH = "out/genetic_backgrounds_heatmap.pdf" V_MAX = 2000 # Max R...
49a361b015583342d60e9f26fcbbae96a4f150daef166f2d346d7b012defb77b
Jupyter
1,589
72
# %% %load_ext autoreload %autoreload 2 #%matplotlib notebook %matplotlib inline # %% import numpy as np import matplotlib.pyplot as plt import sys sys.path.append("../") if "../" not in sys.path else None # avoid adding multiple relave paths to sys.path # custom packages from ratsimulator import Agent, trajectory_g...
acbd442d231f3a956d49ebcb3fb4a887b8533e425ad92a60760e3d7c6a659b5c
Jupyter
1,672
28
# %% [markdown] # # How to sample the posterior given iid observations (for NLE and NRE) # %% [markdown] # > Important: This how-to guide is only relevant if you have iid observations **and** you are using NLE or NRE. You can use NPE with iid observations directly by passing `sample_with="mcmc"` or `sample_with="vi"` ...
604eb30173eb8c3f2ba6dad7ab8a07cef3349ccde81ddb0d4ef3e8bc359e1716
Jupyter
1,674
73
# %% [markdown] # # Single Cell RGC Subtype Marker Expression Analysis in Liang et. al. 2023 # %% import scanpy as sc import anndata as ad sc.settings.verbosity = 3 # %% [markdown] # ### Data Collection # %% ### Read .h5ad data into an AnnData object # RGC subset obtained from # https://cellxgene.cziscience.com/co...
ef379aaf25ed647ddc12fc5e855e0bd275ca5c5c269ad6061dbb8a997d23926b
Jupyter
1,683
50
# %% import os import numpy as np import pandas as pd import seaborn as sns import matplotlib import matplotlib.pyplot as plt from scipy.stats import spearmanr # %% pd_sub = pd.read_excel(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure3ab_pdsub.xlsx', index_col = [0]) pd_rem = pd_sub[pd_sub['...
a8cf9a65b4bcf379a42772932c1b510fcdadb1b99dd7cd778b35d0aed0e8d69b
Jupyter
1,715
100
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline # %% path='selected_data_ISONE.csv' df=pd.read_csv(path, parse_dates=True, index_col='Date') df.head(5) # %% df.reset_index('Date',inplace=True) df['temp_date']=df['Date'] # %% df.set_index('Date',in...
3d3709cccf7a452c8b0afa8773b4cb38140d0c101ba1325a6be21f01a999d198
Jupyter
1,765
14
# %% [markdown] # # How to choose a diagnostic tool # %% [markdown] # `sbi` implements a range of diagnostic tools. Here, we provide an overview of what they do: # # - **expected coverage**: allows you to evaluate whether the joint posterior is over- or under-confident (on average across prior predictives). Unlik...
be873df2b539ebf9c12e2f4b954d8a94610227c2f471a4b68147509cad3be62d
Jupyter
1,768
70
# %% from binn import Network, BINN import pandas as pd input_data = pd.read_csv("../data/test_qm.csv") translation = pd.read_csv("../data/translation.tsv", sep="\t") pathways = pd.read_csv("../data/pathways.tsv", sep="\t") network = Network( input_data=input_data, pathways=pathways, mapping=translation, ...
89a5d4455f59ac57af53931d8309b0df711904a1360b12624b9672e1a2b8660e
Jupyter
1,772
61
# %% [markdown] # # BINN - Biologically Informed Neural Network # # This notebooks demonstrates some examples on how a BINN can be created. # %% [markdown] # Read some test data. This requires and input and a pathway file. These correspond to the first layer (input) and intermediary (hidden) layers in the model. We a...
e346f6745a86a9567b2fd4d5c5b0dfc69d51c0a2406e209a8d52a01e1d3aa621
Jupyter
1,803
75
# %% import os import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt from sklearn.model_selection import train_test_split import numpy as np import pathlib import cv2 import splitfolders # %% train_dir="data/intel_dataset/images/seg_train/seg_train" test_dir="data/intel_dataset/images/se...
f9595f3fd6bab66c8d05508752863bb5403c477fffddfc2b7782cef30222f3d3
Jupyter
1,878
85
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns %matplotlib inline # %% df=pd.read_csv('E:\\0_PYTHON\\9_Datasets\\PJM\\AEP_hourly.csv' ,parse_dates=True) df.head(1) # %% # Drop Duplicates Except the First Occurrence df.drop_duplicates(subset=['Datetime'], keep ='first...
3f7fbbac16c5a711a62ce58a7fb93fa84f968e82c5d839e7b162f671381e98d6
Jupyter
1,939
73
# %% #!sudo pip3 install "foolbox==3.1.1" # %% import time import torch import torchvision import foolbox import eagerpy as ep print(torch.__version__) print(torchvision.__version__) print(foolbox.__version__) print(ep.__version__) # %% model = torchvision.models.resnet18(pretrained=True).eval() # %% preprocessing =...
ab97ab726b24b9c6018fe6aae06597e640f341a80cc49564ac49e15b35e49748
Jupyter
2,007
71
# %% %matplotlib inline %load_ext autoreload %autoreload 2 # %% [markdown] # # Prepare Data # %% import numpy as np import matplotlib.pyplot as plt import trefide.preprocess as preprocess import scipy.io as io # %% # Load Data stim = io.loadmat("../../data/sampleMovie.mat")['stimulationSignal'][1:-50].squeeze() data...
7b8c1c968de8da04872aed1b024b666d5b95f193bfbf8257d2b15f5f8f66b17a
Jupyter
2,017
86
# %% #%matplotlib widget %load_ext autoreload %autoreload 2 #%matplotlib notebook %matplotlib inline # %% import sys from pathlib import Path import torch import numpy as np import tqdm from ripser import ripser from persim import plot_diagrams # Plotting import matplotlib from matplotlib import pyplot as plt plt.st...
f5990ee0bc0f00fba1cee0854861901bea37089d5d3660c7c9db420d8c951a99
Jupyter
2,052
54
# %% [markdown] # # How to visualize the conditional posterior distribution # # In all tutorials, we used the `pairplot` method to visualize the posterior. This method visualizes the posterior _marginals_. Another option to visualize the posterior _conditionals_. You can do this with the `conditional_pairplot` functio...
0d1c4a8c4d00b02f7fc18a64bc8199e15708c4d9261ae1e87c26495b858b969a
Jupyter
2,069
76
# %% #!sudo pip3 install "foolbox==2.4.0" # %% import time import warnings import torch import torchvision import foolbox import numpy as np print(torch.__version__) print(torchvision.__version__) print(foolbox.__version__) print(np.__version__) # %% model = torchvision.models.resnet18(pretrained=True).eval() # %% p...
2d174246c14eac43de4dd3b42a7d70fb77f9cdc73308127267e04e6ec3dd5d7d
Jupyter
2,134
85
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt from rdkit import Chem from rdkit.Chem import Draw from rdkit.Chem.Draw import rdMolDraw2D import IPython.display from collections import defaultdict from tqdm import tqdm from serenityff.charge.tree.dash_tree import DASHTree # %% dftd4_sdf_p...
65cc9a3f2e5c9be09966ac4858651cdb8ec73e1daf7b3ec36baeca2d70150076
Jupyter
2,235
75
# %% [markdown] # # Usage example for the DASH tree # %% [markdown] # ## Import and initialize the DASH tree # %% from rdkit import Chem from tqdm import tqdm from serenityff.charge.tree.dash_tree import DASHTree from serenityff.charge.tree.atom_features import AtomFeatures # %% [markdown] # The default dash tree is...
7ce2fadba5d8921e480f7478b593c7cd8c150a2ed8ad28303f15c75079610758
Jupyter
2,246
59
# %% import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # %% mean_nrem = np.load(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure4f_nremmean.npy') error_nrem = np.load(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure4f_nremerror.npy') data_nrem = pd.read_excel(...
0df97472622e95c447bd05dffc3574bbdf6f82647c750639881330cae898afa7
Jupyter
2,262
59
# %% import numpy as np import scanpy as sc import scvelo as scv import latentvelo as ltv # %% adata = scv.read_loom('simdata_bursts.loom') adata.obs['celltype'] = ['cluster'+str(x) for x in adata.obs['celltype']] # %% adata = ltv.utils.anvi_clean_recipe(adata, spliced_key='spliced', unspliced_key='unspliced', ...
3ce3468c2b2a796c6a7d8014825c1b9bab4184f0c504acdc590f15c243cdc319
Jupyter
2,282
88
# %% import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import pdb import matplotlib import seaborn as sns # %% df = pd.read_csv('C:\\Users\\arif\\OneDrive\\Journal Paper\\Code\\Irshad\\Dataset\\7_Dataset.csv', parse_dates=['date_and_hour'], index_col='date_an...
02ea4e7cbd04ccd1e14a700e01593e8741dc34519fa9f876236c112afcbe5b58
Jupyter
2,306
85
# %% %matplotlib inline %load_ext autoreload %autoreload 2 # %% [markdown] # # Prepare Data # %% import numpy as np import matplotlib.pyplot as plt import trefide.preprocess as preprocess from trefide.pmd import batch_decompose import scipy.io as io # %% X = np.load("../../data/demoMovie.npy") X = np.tile(X, (10, 1...
822c626671608ff0023a9a3e22d33bd5a631a6648262c1357efe96b4bb7a38ea
Jupyter
2,325
71
# %% %load_ext autoreload %autoreload 2 import sys sys.path.append('../') from config import * import multiprocess import pickle configure_pylab() L = 128 # %% rp = 1.5 # Range (ratio) to search for optimal period rv = 10 # Range (ratio) to search for optimal kernel height Np = 101 # Period grid resolution Nv = 1...
218f4f9f21a830c754d74535fc399a34b0ba1e7fe672b326f2b7639b77794552
Jupyter
2,352
62
# %% import os import numpy as np import matplotlib.pyplot as plt import pandas as pd import seaborn as sns # %% nrem_mean = np.load(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure4g_nremmean.npy') nrem_error = np.load(r'C:\Users\Lenovo\1代码 REM中beta升高\upload_data\figure4g_nremerror.npy') nrem_data = pd.read_exce...
44b19368ea136e5336c35fd110c1699682785099f0bc3357d782017812b69da9
Jupyter
2,355
84
# %% #!sudo pip3 install "foolbox==1.8.0" # %% import time import warnings import torch import torchvision import foolbox import numpy as np print(torch.__version__) print(torchvision.__version__) print(foolbox.__version__) print(np.__version__) # %% model = torchvision.models.resnet18(pretrained=True).eval() # %% p...
1b823f53116026f7cbcdbf80a2ab82d65b6f362759565c0467a0e8729b164777
Jupyter
2,363
89
# %% import os PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # set to your copy of the dataset # %% [markdown] # #### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content. # %% [markdown] # # Create a vector sample...
8604639cb04d0f2ef65b67a465fa1a490c684c94b21f1f5acd0aa494b47f6328
Jupyter
2,406
91
# %% [markdown] # ### Imports # %% %load_ext autoreload %autoreload 2 #%matplotlib notebook %matplotlib inline # %% # Computational packages import numpy as np import matplotlib.pyplot as plt import torch import tqdm # General packages import datetime import sys import os # custom packages import ratsimulator from ...
739ee6297a3f9c969d7f602dbc4fdd4bf5af9610ac1cd2547a42124aa85c9e73
Jupyter
2,419
70
# %% import numpy as np from matplotlib import pyplot as plt from hf_scores import isruc_age, isruc_sex # %% _, axes = plt.subplots(1, 2, figsize=(8, 4)) axes = axes.flatten() # panel ISRUC age prediction scores_to_plot = {} for i, (model_run, rmses_model) in enumerate(isruc_age.items()): for sr in rmses_model.k...
5aea174ddf2129b3708b24fd7b0948b944f3aebf546c062ca9c782bcaaee931a
Jupyter
2,433
78
# %% import pandas as pd import sys import numpy as np import matplotlib.pyplot as plt sys.path.insert(1, '../utils/') from import_data import load_suite2p_outputs # %% fishlabel = '201007_F02_chx10' plane = '70um' df_summary = pd.read_csv('/network/lustre/iss01/wyart/analyses/2pehaviour/MLR_analyses/data_summary_II...
b2be0cb412e11b70d825e31ced71929ecbe947a08f061c912d55da06a1f58ca4
Jupyter
2,434
90
# %% # import module import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # %% acc = pd.read_csv('/ritter/share/projects/Lab_Rotation_Milena/posthoc_analysis/accuracy.csv') # %% acc_kSVM_FU3 = acc.loc[(acc['Model'] == 'Kernel SVM') & (acc['TP'] == 'FU3')] # %% # sort datafram...
0164b155d89c881eea40fbb64cbbf49c70b5daf2290ff014ba80d683e805a225
Jupyter
2,484
77
# %% [markdown] # # Using SBI to infer parameter given observed data # # Once simulated data has been generated (see `1_simulation` notebook), applying SBI is straight forward using the `sbi` package: # # - select an SBI method, we use SNPE (see paper for details) # - add the simulated data and corresponding paramet...
de6f62592468aa3bd16b7976825c6f14238d37a9e2f1df3ad26f4df976ac2cee
Jupyter
2,484
74
# %% [markdown] # # How to visualize MCMC diagnostics with ArviZ # # [ArviZ](https://python.arviz.org/en/latest/) provides standard diagnostics and visual summaries (rank plots, # autocorrelation, ESS, and more) from an `InferenceData` container. # # ArviZ is available whenever `pymc` is installed (it is a PyMC depen...
fcbc7b608137c1fd087f5e79c19412ed9658364701e7ff0e98eb671161fdf5e1
Jupyter
2,507
70
# %% [markdown] # # **DeepSlice notebook** # this is an example notebook designed to teach you how to use DeepSlice # # %% import os # %% #first lets ensure we are in the DeepSlice parent directory # if we are in examples/example_notebooks, we need to go up two directories os.chdir('../../') # %% [markdown] # ## *...
24f80ef3f0d92357652cf79f5ae56d1cf77613496617308709c1d0b30da90d7a
Jupyter
2,529
67
# %% import pickle import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import sys sys.path.append('../') from jax.config import config import tensorflow as tf import os os.environ['XLA_PYTHON_CLIENT_PREALLOCATE'] = 'false' tf.config.set_visible_devices([], device_type='GPU') # %% an...
6369b73aa01428d3624566a39971f9ada2bbcdf14c5ed1c20062e4a06173feeb
Jupyter
2,549
83
# %% %load_ext autoreload %autoreload 2 from config import * # %% L = 128 fn = 'r2405_051216b_cell1816.mat' data = Dataset.from_file(datadir+fn).prepare(L) # Prepare hyperparameter grid Po = data.P # Initial guess for kernel period Vo = data.V # Initial guess for kernel height rp = 2 # Range (ratio) to search f...
1b3c4d53acfb4e48822233c8833e867af08ff2ff1f1a63b17910743a1d6a9014
Jupyter
2,554
75
# %% [markdown] # # How to use `PosteriorParameters` in sbi # # The `PosteriorParameters` classes in SBI are dataclasses used to initialize parameters for different types of posterior algorithms, when using the `build_posterior` method. This guide shows how to configure and use PosteriorParameters in your workflow. # ...