sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
0f8a2541ab502c3cf511267a1994a06a612f382a0faadc9f3b031057375bb6b5
Python
11,822
286
# -*- coding: utf-8 -*- """ Created on *** @author: *** """ #! /usr/bin/python # -*- coding: utf-8 -*- """ - 1. This model has 5079272 paramters and "Median Quantization" strategy(weight:ternary {-1,0,+1}, active: quantization level = 1, upper bound = 2), you can manually decay the learning rate from original 0.01 by...
06ad19d8bd85fd2ed17818136edf1399057225a10736944457e972b6dcc38f12
Python
11,833
286
# -*- coding: utf-8 -*- """ Created on *** @author: *** """ #! /usr/bin/python # -*- coding: utf-8 -*- """ - 1. This model has 5079272 paramters and "Median Quantization" strategy(weight:ternary {-1,0,+1}, active: quantization level = 1, upper bound = 2), you can manually decay the learning rate from original 0.01 by...
ff03a732c5e231d6db5ce70c6ae4a320769bfda1cd98feb5f217f7f28bdfc3b2
Python
11,847
283
""" Detection is run in three steps: 1. 2D filtering 2. 3D filtering 3. Structure detection In steps 1. and 2. filters are applied, and any bright points detected post-filter are marked. To avoid using a separate mask array to mark the bright points, the input data is clipped to [0, (max_val - 2)] (max_val is the max...
594bd176477d06b8567a286d45c31c29b3c5bc4cada8f665b6e68a9eafc5b6e0
Python
11,855
314
# MIT License # Copyright (c) 2020 Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, Xavier Bresson import os import pickle from scipy.spatial.distance import cdist import numpy as np import itertools import dgl import torch import torch.utils.data import time import csv from sklearn.model_...
4ec61b0207b3beceab570a4b4f3307d59a49a9ae7f6b0b27e78823f13204b691
Python
11,880
318
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ba6dfe5750e68cd3d400900a6baaf78f5827cea755084d9f8885b4a1490497ca
Python
11,936
345
import warnings import numpy as np import pandas as pd from datetime import datetime from cached_property import cached_property import analysis_guis.common_func as cf from rotation_analysis.analysis.probe.probe_io.io_exceptions import IgorFileKeyError, BonsaiQueryError from rotation_analysis.analysis.stim...
ca3cfd0510fb85e0ebcf765d22800bb359b48d2e35d81e71e85d5732e85c1105
Python
11,945
393
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
783e95fe0c103d3a185d5e872190176698dc35b6ad0fe1c7561f09625770a629
Python
11,981
333
# @license # Copyright 2017 Google Inc. # 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 applicable law or agreed to in...
601fcc0c6fdc191d1771c495baa17e7bf9397d97fbbc10bcac8c0282be5e2937
Python
11,983
319
""" This file contains several helper functions to calculate sleep statistics from a one-dimensional sleep staging vector (hypnogram). """ import warnings import numpy as np from .hypno import Hypnogram, _transition_matrix __all__ = ["transition_matrix", "sleep_statistics"] #######################################...
5cfc61e071881653a259f47d2afbbf23839cc6083fb713811372294e4e8eb7ea
Python
11,987
330
""" Implementation of "Attention is All You Need" """ import torch import torch.nn as nn import numpy as np import onmt from onmt.decoders.decoder import DecoderState from onmt.modules.position_ffn import PositionwiseFeedForward from onmt.modules.util_class import make_condtion MAX_SIZE = 5000 class TransformerDec...
b6131b27af6ab9cf436e137df6de402e54b7884debf071e3bd6a0c7e6223ee8e
Python
11,992
369
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
276f53a7de4bc1018e540803fa4f8568194a5af5166bd57b5dbff673ab668ca1
Python
12,007
360
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
d8fecc36210dba8057c4c4ceeef2e4a46947bb7742a93f4a1030093ec4be1368
Python
12,054
352
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
076f68753f12f5255b9ee376ef2ee6e5f319844c7a5179cc0f0976d631f22c25
Python
12,067
318
import numpy as np import random import re import pickle from rdkit import Chem import sys import time import torch from torch.utils.data import Dataset from utils import Variable class Vocabulary(object): """A class for handling encoding/decoding from SMILES to an array of indices""" def __init__(self, init_...
bf21703e062c1ed689eb555167fd86142eb16d0a8e4453424634040ae7c46af6
Python
12,072
347
import logging import pandas import os import numpy from scipy import stats from .. import Constants from .. import Utilities from .. import MatrixManager from ..PredictionModel import WDBQF, WDBEQF, load_model, dataframe_from_weight_data from ..misc import DataFrameStreamer from . import AssociationCalculation class...
a13d725718917beb3a8b7b9a5d32c7f9c34d71f823ca00c106837f8cd1ea685f
Python
12,075
290
from __future__ import division import math import random import logging from .utils import RandomShuffler from .batch import Batch from .dataset import Dataset logger = logging.getLogger(__name__) class Iterator(object): """Defines an iterator that loads batches of data from a Dataset. Attributes: ...
c4a72dec50b51b18fd7e5de3e6623bfab9f5a39119b1da88d0e9d83b47636bc2
Python
12,077
353
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ee2436e31a10dce183d5a94dce7867a970a19380a793c800642f93d97229d8b1
Python
12,088
374
import json import pandas as pd # import geopandas as gpd import shapely import area import numpy as np import random import torch from zipfile import ZipFile from math import sqrt, sin, cos, pi, asin from ast import literal_eval try: import od_models as od except ModuleNotFoundError: import deepgravity.od_mod...
bace2fe51be847a7e4cb80132bcec5c59d711338a81f9d83f5f817cef6f1169d
Python
12,091
355
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
1bce9532034f0b3001d464609a8d5c1c1c25443e0cda1c22ad01978650245953
Python
12,103
337
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
275010b4144c4c37727220a21536123a290123d2bc79bde7b350bb2e8cf4ff67
Python
12,104
353
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
a119aea5ab60d3179aaf195c5917b31f30e86ead05f7fd0ed45fb5817b3d97c9
Python
12,118
274
import os import numpy as np import pandas as pd from matplotlib import pyplot as plt from tqdm import trange, tqdm from margrie_libs.margrie_libs.stats.stats import wilcoxon from margrie_libs.margrie_libs.signal_processing.cross_correlation import normalised_periodic_cross_cor from rotation_analysis.ana...
c027e6698a19b0ca4923764377002f92ebee52f7becfa8ffd8dea4cb8bf75dfe
Python
12,160
310
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 20 01:58:15 2020 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) """ from tensorflow.keras.models import Model from tensorflow.keras.layers import Conv1D, MaxPooling1D from...
637d1f3c16a0cb505b0f085d648d082d56ad22dd11a3fbb84d1c62170a29cd5b
Python
12,176
296
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import LayerNorm, Linear, Dropout from torch.nn import Module from torch.nn import MultiheadAttention from .general_transformer import _get_activation_fn from .ion_model import PositionalEncoding from deep_phospho.mode...
52a1cbfde4dd34c3c6b430d1948fae6bd8307cf5956d4d2c0ce80a1228afae46
Python
12,177
359
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
3d2609231a6612e4339c99d504e55bfa90e4ed7cc4d5ebd3948322d5c7431cae
Python
12,178
256
# --*-- coding: utf-8 --*-- import argparse import multiprocessing from sklearn.utils import shuffle import data_loader import pandas as pd import os import numpy as np from calc_scaffold_smilarity import process_one_protein, calc_scaffold_similarity TASKS = ['CHEMBL1075104', 'CHEMBL1075126', 'CHEMBL1075167', 'CHEM...
1cacf1beb34bd2e6c79ef2b7d79846332d0863fffc253a548037757d0470eb1e
Python
12,186
277
#!/usr/bin/python # # Batch multifit analysis. # # Colenso 05_30_18 import glob import os, time, datetime import multiprocessing import signal import subprocess import sys import threading import numpy import math from subprocess import * import datareader import re import arraytoimage import i3togrid from PIL impor...
931d545873a4a77902fdc539b4244b5f877329341ea337d9519fd41f692ff28e
Python
12,191
284
import os from argparse import Namespace import numpy as np from probabilistic_forecast.nn_mc import NN_MC from probabilistic_forecast.ensemble import Deep_Ensemble from probabilistic_forecast.swag import SWAG from probabilistic_forecast.lstm_mc import LSTM_MC from probabilistic_forecast.bnn import BNN from probabilis...
9a7257132e935c2b6593bb25930ac37f23bec9e1e79797bb235a83e848935af5
Python
12,221
375
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
c16a2423ebd175dd74f3f36b71428aaa80f37b4d54f319db7322a16db7a33372
Python
12,255
321
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ae1ab5eb6a4e7b02e7cd5b72b1e0c5e163dfb6fe15d2bd9cb0a5af295b3f5450
Python
12,277
343
import numpy as np def label_encoder(label, num_class): """ function: on-hot encoding label: 0,1,2, ..., num_class-1 num_class: number of class return: one-hot vector of m samples, shape=(m, num_class) """ tmp = np.eye(num_class) return tmp[label] class Conv2d(): count = 0 ...
6c41711ca0076b9616c4ffd31608dbaa88d8e20b89fed966a2be7eb792966ea7
Python
12,300
307
from deep_phospho.proteomics_utils import rapid_kit import os from tqdm import tqdm import pandas as pd import numpy as np def processing_progress_logger(progress_type=None, print_progress=True, save_log=False): pass class SpectronautResults(object): """ This will store multi results as a dict """...
1fa762651b0f0f5f040e74e2247c3b7e6fe94965bdc1c438e801fb9555ac4990
Python
12,319
264
import matplotlib.pyplot as plt import numpy as np def plotStimRasters(stimulus, samples, spikes, unit, ltime, rtime, save=False, saveString = '', baseline=0, sample_rate=20000, fig_size=(10,4), heightRatio=[1,4], markerSize=3,stimLabel='Force (mN)'): """ Generate plot...
71724b3b4945e53ac5d0b4845d2604ff30bd2889c502905bc6878afb2f38ea5f
Python
12,375
409
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
016ac066cc578e799c8176fd067447aa5752011d17585d31d621b9472c4b2ba6
Python
12,391
334
import numpy as np import os import time import json os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from tensorflow.keras.preprocessing.image import array_to_img, img_to_array, load_img os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' from pysam import AlignmentFile from pybedtools import BedTool, Interval from progress.bar import...
efe0272ac3d334194fc2f08f8111f42cdf80df9f45cd3ed1e53971d875758a98
Python
12,394
415
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
00c5a5fd09c15780abdcdf777ac1253c38f9a8ca4c161c78bca256e82013b300
Python
12,395
358
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
43606f66b858799fc31d89deb2048bf1e60a12888c6ea468194e807fbdbad84c
Python
12,446
374
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
245c276da8ce24bdf6fc328dfbfe409ee583e3f449418aeab3544987ebe6047b
Python
12,553
296
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Apr 1 13:20:13 2020 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) """ import pandas as pd import numpy as np import ast import gender_guesser.detector as gender from scipy imp...
93afa539b8e48e9335eb6ea48939cc7af2f79080dd75b16b09c3f1d6b7747db3
Python
12,566
345
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
bdd8a4a378e468a382e41a24494e2810e43215e6aed39ebe3e03eb4ee0228957
Python
12,567
268
import tensorflow as tf import numpy as np from networks.select import select_G from dataset import train_dataset_sim, test_dataset_sim from loss import G_loss from args import parse_args import metasurface.solver as solver import metasurface.conv as conv import scipy.optimize as scp_opt import os import time ## Log...
32f4100eb44bfb8f0da20655a9df0d87d07696227e6a2bde46f0f3c6c526573e
Python
12,574
406
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
ccaae0b2c59d1e77c2d6b94f7200329e72c2054ef06637617bb46a09255b21c2
Python
12,606
418
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
4bda38d3638104a9b50c0d8f988b5426655d9709692948394c1b7c31fc1aef33
Python
12,666
420
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
065d6ea64c066300b043468e4c90ec9d4677be3d3ecfd50544bd066a96c2a8c7
Python
12,670
339
import torch import torch.nn as nn from .chemutils import enum_assemble from .mol_tree import MolTreeNode from .nnutils import GRU, create_var MAX_NB = 8 MAX_DECODE_LEN = 100 class JTNNDecoder(nn.Module): def __init__(self, vocab, hidden_size, latent_size, embedding=None): super(JTNNDecoder, self).__ini...
3c12d0a2b8c66941abda9ad1d94201949db6edc23695e8b3897b9dd7a5f7d74d
Python
12,676
302
import os import random from typing import List, Tuple import numpy as np import torch from sklearn.metrics import confusion_matrix from sklearn.neighbors import KNeighborsClassifier from torch.nn.utils.rnn import pad_sequence from torch.utils.data import DataLoader, Dataset from torch.utils.tensorboard import Summary...
d73b499666dd47b63816248992b3236178f003a4aa217d2ef770ec7e13651836
Python
12,691
370
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
3088304a225b64abb3a3635ccded4e859789c74319516f0908d21e00fb18b624
Python
12,697
354
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
aeeaee000206f76b5160d251d843308e6894a8014e0b71630abe4f3f4274433c
Python
12,721
360
# coding: utf-8 # In[1]: """ inference.py This scripts tests a SegNet model using a predefined Caffe solver file. Args: the weights (.caffemodel file) to use and the ids of the tiles to process """ import matplotlib.pyplot as plt import numpy as np import sys from skimage import img_as_float, io from skl...
bb828aae5839eac42920b4b8a7f76928d2a571359cd6fc0a205f1f162064dba5
Python
12,733
327
#!/usr/bin/env python # For creating files for new kernels. Run as # kernelGenerator.py {kernel short name} {kernel long name} [CopyrightName YearOne YearTwo etc] # A detailed kernel description can be given in {kernel short name}.txt import os import sys import re import shutil import time import string if len(s...
a2acf89d0994717b2f0aaa76f38f15f556a3e010f6c1878dec9fe799603106b9
Python
12,742
384
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
87937ca21d009ca49e4bff8bba05b139b3117b5c6f6156560dd853a60e6a3119
Python
12,748
282
import os import numpy as np from matplotlib import pyplot as plt from scipy import signal from margrie_libs.margrie_libs.signal_processing.filters import box_smooth, diff from margrie_libs.margrie_libs.utils.utils import colors from rotation_analysis.analysis.event_detection.event_plot import _plot_trace ...
09d888287e5a65aaf3d009c34a9fa5947be11cc86e33f718b3a3888c8078b070
Python
12,765
420
from os import listdir from os.path import isfile, join from collections import defaultdict import pandas as pd from tabulate import tabulate def summarize_folder(data_dp, data_name): print('##################################################################') print(f'# {data_name} ...
dbee83e9219e68f64e88fb6f55fd2e9f3e0caa346c2851cd1f6d861c987ad878
Python
12,765
379
__author__ = 'heroico' import os import logging import weakref import tkFileDialog import tkMessageBox import Tkinter from subprocess import call from threading import Thread import metax.MainScreenView as MainScreenView import metax.MetaXcanUITask as MetaXcanUITask import metax.Exceptions as Exceptions import MetaXca...
e75414398df7ded3a9ad50b7aee1ede9825799d27978c522ea03a8953817ca26
Python
12,787
352
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
62e29921ab1c4a8fdc209e919d997428a913439e38347c1054ab3ee3b01a3d3f
Python
12,815
348
import os import shutil from collections import OrderedDict from copy import deepcopy from datetime import datetime as dt from configobj import ConfigObj from analysis.event_detection.calcium_trace_handling import load_fluo_profiles class Recording(object): """ exampleOriginalPath = "...\(20160...
70adc355018a606cb5b54fdd3616fb18839c31719622c88b601237f796569e3f
Python
12,822
303
import calendar import time from zoltpy.covid19 import validate_quantile_csv_file import glob import sys import os import pandas as pd import numpy as np from datetime import datetime import collections from github import Github from pathlib import Path from validation_functions.metadata import check_for_metadata, ge...
9af7d68e99f8d17feb9eeb717514d6d03c04e23161108abe7bc60bc8a86365a0
Python
12,827
243
# Created by woochanghwang at 10/06/2020 ''' circos make subcellular for generated file from "circos_make_input_files_key_genes" MoA based SOM result #Modified 07/21/2020 #Modified 07/19/2021 Hidden , Sorted by enriched pathways Centrality ''' import pandas as pd import numpy as np def make_circos_subcellular(subce...
a4392dc75f580c11be5bc231aba77d6325f90ba7e1f6242c73bae0e2b84c7ad1
Python
12,854
291
# --*-- coding: utf-8 --*-- from __future__ import division, unicode_literals import argparse import numpy as np import subprocess from rdkit import Chem import pandas as pd import data_loader import onmt.opts from make_pair import calc_2D_similarity, calc_3d_similarity, parallel_run from split_data import TASKS d...
dbdffe398609579d41a134757b46855e051b1e2a148edf14fc169c84292258b3
Python
12,879
283
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.nn as nn from torch.autograd import Variable from torch.optim.lr_scheduler import ExponentialLR from probabilistic_forecast.utils.torch_utils import get_device from probabilistic_forecast.utils.plot_utils impor...
715da7c145b71f7c644829ca242491f43e24b34c888b4e1088cd88394da0da09
Python
12,881
320
# coding=utf-8 # Copyright 2026 The Edward2 Authors. # # 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 applicable law o...
11bd23492ce79b737a10edeb7bb894cf40d4146035ebc81e7e87477292c3f126
Python
12,883
294
# -*- coding: utf-8 -*- from os.path import join, isdir, exists from os import mkdir, environ from configparser import RawConfigParser import sys from biokg.loader import * from biokg.util.extras import program_header from biokg.processing.parsers import * from biokg.util.io import export_file_md5, file_has_valid_md5 ...
1440a5be10be099aad2bd14c094a69959ccb8b75d8bf6aa60117ca5d3e858795
Python
12,890
344
import os from typing import Tuple, List import h5py from Bio import SeqIO import pandas as pd from tqdm import tqdm import numpy as np def reduce_embeddings(input_paths: List[str], output_dir: str, output_filenames: List[str]): """ Pools along the length dimension of embeddings and saves them as h5 Args...
e7e96f102487a21dfd49f9986d6a76c18fa3c83d127900fa95644a5d3de8dbe2
Python
12,907
355
""" implementation of a swag model and other utils adopted from https://github.com/wjmaddox/swa_gaussian """ import torch import numpy as np import itertools from torch.distributions.normal import Normal import copy import torch.nn as nn import tqdm import gpytorch from gpytorch.lazy import RootLazyTensor, Dia...
f63c428b3315468911b5c36e7299428f1f981c0c19a9aede586f0feb9a056664
Python
12,935
355
import logging import pandas import numpy from patsy import dmatrices import statsmodels.api as sm from .MultiPrediXcanAssociation import Context as _MTPContext, MTPMode from .PrediXcanAssociation import Context as _PContext, PMode from metax import Exceptions, Utilities from .. expression import Expression, PlainTe...
890aac10e9a6d5c960600d51e7370d9ad76512dfdb2ea6a1c3587db45ea5bb0d
Python
12,945
338
""" Fit zero-mean GPCSD to baseline period of auditory LFP recordings. Investigate power and extract phases for coupling analysis in Matlab. Creates Figure 2 in the paper. """ # %% Imports import autograd.numpy as np from scipy import signal import matplotlib.pyplot as plt import scipy.io import pickle import os.path...
4767b283facc3a217fd54ff0a8230a5040d465e838279dfa70eb92c6659be677
Python
12,949
441
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
152a1367c37ab44746c368422166486f16e08ad3d7e88b206fa2dcb7a5ed738b
Python
12,960
358
import os from copy import deepcopy from datetime import datetime from pathlib import Path from typing import Callable, List, Optional, Tuple import numpy as np import tqdm from brainglobe_utils.cells.cells import Cell from brainglobe_utils.general.system import get_num_processes from torch.utils.data import DataLoade...
afb648367f4486b75a1aea976230f8865cae9aabd1c69bfd11bea963c304ab75
Python
12,974
475
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
5a0486314af94fb25ce816388ec16a95004096a184be09003e492150d236722b
Python
13,000
355
""" Transfer learning for ion mobility Will use weights of peptide embedding, charge embedding, lstm layers, Transformer layers, from pretrained ion intensity model A FC layer will be newly generated and initialized Can choose to fix layers except the last FC or tune all parameters """ _SEED = 0 HyperParams = { '...
2dbd8101e3334fe383ae6dfc8f345b61c58069ea9846d00f6a151f0e73e94e99
Python
13,006
391
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
dc76572190861c3eb34f973c83482d051bb274abd189ce8b7cb74271f6f39871
Python
13,016
242
import pandas as pd import subprocess import os import numpy as np from collections import Counter def get_blocksize_length(lst): """Uses bed file blockSize and returns overall length """ return_lst = [] for i in lst: # print(i,type(i)) if len(str(i).split(',')) >1: ints = s...
06f00efe736c27c4dbdaf3290d453bcd40724174590ed845159da925a9278ebd
Python
13,026
315
import torch import torch.nn as nn import numpy as np import random import torch.optim as optim import os import torch.utils.data import time from prospr.io import save, load from prospr.nn import ProsprNetwork from prospr.dataloader import get_tensors from prospr.sequence import Sequence import warnings from Bio imp...
d64993dd1e05f2b1e7326aea2f36280c1dc25b96f701d94346b3e7b49ac3daaf
Python
13,039
347
""" Fit zero-mean GPCSD to baseline period of auditory LFP recordings. Investigate power and extract phases for coupling analysis in Matlab. Creates Figure 2 in the paper. """ # %% Imports import autograd.numpy as np from scipy import signal import matplotlib.pyplot as plt import scipy.io import pickle import os.path...
69d97ad27497909e626a5f138e2726a724947413c7f42072bac1cbc42896f7b8
Python
13,065
354
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
9869a692c68438ea747fbe1bdd94f615189ea4fa5b43ac7f69dd3e31cd7ec753
Python
13,074
321
import logging import os import queue import subprocess import threading import traceback import wx from deep_phospho import proteomics_utils as prot_utils from deep_phospho.proteomics_utils import rapid_kit as rk from deep_phospho.train_pred_utils.runner import DeepPhosphoRunner def search_pretrain_params(ui_confi...
2d2af84b2c4459fd1401978bb0dfd73dcb8838b3f3494b02fa374493c94ef9d0
Python
13,076
371
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
6ff2db2300ee871ab800078769e97eacff9d8449d593c46cfe9cccf03ffd019b
Python
13,089
361
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
66a5503e781242a9813c2b00f471ceb389f24cc36d80f7665d10ac08e0dc5080
Python
13,120
314
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from torch.optim.lr_scheduler import ExponentialLR from probabilistic_forecast.utils.torch_utils import get_device from probabilistic_forecast.utils.plot_utils import plot_training_curve_...
b77e2252ba10af3c642c030e297e974e73ae0fd7d76837f3af3329140ceb5657
Python
13,122
394
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
0fbb8f9dca285378e03d4c26ad71d74958833d10b10db17236b6891078670fb9
Python
13,138
305
""" Spatial and temporal covariance functions for GPCSD. """ import autograd.numpy as np from gpcsd.priors import * from gpcsd.forward_models import * from gpcsd.utility_functions import expand_grid, reduce_grid class GPCSD1DSpatialCov: def __init__(self, x, a, b, ngl): self.x = x if a is None: ...
c89718b57bc49b024dc515de5a55176e0fc8a6680577d68c983a0838ac993475
Python
13,160
355
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
127573bdff53ea82064ba2ad6e3494b0778c7782ae28325b1cd477644198fbb2
Python
13,179
374
from builtins import print import numpy as np import pandas as pd import matplotlib import random matplotlib.use('agg') import matplotlib.pyplot as plt matplotlib.rcParams['font.family'] = 'sans-serif' matplotlib.rcParams['font.sans-serif'] = 'Arial' import os import operator import utils from utils.constants impor...
541d1b810f5209b16e10d1fc1e0935563b246e3bcbfbcce45960122943c9dc98
Python
13,204
310
import hashlib import json import logging import os import pprint import sys from datetime import date import yaml from dateutil.parser import parse from zoltpy import util from zoltpy.cdc_io import YYYY_MM_DD_DATE_FORMAT from zoltpy.connection import ZoltarConnection from zoltpy.covid19 import COVID_TARGETS, covid19_...
c40fa7761e4730bdc40b19107d6fcf0d64608c32b2af1aec6698a04614d7bd39
Python
13,205
378
from pathlib import Path from unittest.mock import patch import napari import numpy as np import pytest import yaml from napari.layers import Image, Points from cellfinder.core.train.train_yaml import ( get_tiff_files, make_tiff_lists, parse_yaml, ) from cellfinder.napari import sample_data from cellfinde...
e880ec31b11b8acf43e5bdae75bc40a9285fc12897b8d0ee5627185f61df0e3c
Python
13,220
302
# --*-- coding: utf-8 --*-- import collections import logging import time from collections import Sequence import tensorflow as tf from deepchem.models import KerasModel from deepchem.models.layers import SwitchedDropout from tensorflow.keras.layers import Input, Dense, Reshape, Activation, Lambda import deepchem as ...
19fb2c088e1678b7bd6ddc0e529f85957de082dca81577ea1c6cd1060a85ad5a
Python
13,224
250
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Reproduces (or attempts to reproduce) processing pipelines for nine previously published articles using the AHBA """ from pathlib import Path import numpy as np import pandas as pd import abagen from vibecheck import abautils, analysis RAW_DIR = Path('./data/raw').r...
ef1a3a69c80dc3f2d661c0b4161d3c7f3fee24f3ac9ba250211c6ba47eeb4465
Python
13,232
471
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
5f9936ebab5b97d107455639765b39dc1e4866598fed4d1407d06c6757b2fe97
Python
13,250
347
import numpy as np import torch import torch.nn.functional as F from scipy.ndimage import gaussian_filter, laplace from scipy.signal import medfilt2d @torch.jit.script def normalize( filtered_planes: torch.Tensor, flip: bool, max_value: float = 1.0, ) -> None: """ Normalizes the 3d tensor so each ...
35077db5ed91b06e9dfabc87b27938b61b1567db7f1fe243d8e1a4432bf86c46
Python
13,327
316
import csv import warnings from math import floor, ceil warnings.filterwarnings('error') import numpy as np from src.plotting.polar_graphs import PolarPlot, ScatterPlot from src.signal_processing import mat_utils class ResampledMatrix(object): """ A class to represent a matrix of resampled data from igor v...
0b749bf20ff436455ff48279507fc395efc18abf7f7671bab2e36f98329db206
Python
13,357
395
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
cfb58f573385a4938ad860e543da88ede7a1f035ba29b8e83e5d4cc54849b7dd
Python
13,364
290
import os from pathlib import Path from typing import Callable, List, Optional, Tuple from brainglobe_utils.cells.cells import Cell from cellfinder.core import logger, types from cellfinder.core.download.download import model_type from cellfinder.core.tools.tools import deprecate_positional_args from cellfinder.core....
02551e24228ad1f75d5a53d4b408da8c29b1408257d45a51bd6915d9d5fc9dd8
Python
13,403
277
#! /usr/bin/env python import logging import os from timeit import default_timer as timer import numpy import pandas import gzip import pyliftover import metax from metax import Utilities from metax import Logging from metax import Exceptions from metax import PredictionModel from metax.genotype import Genotype from ...
c4de215a74525074999f1d42c6119d1621a1dffb3dc89407959bd1de68ec7850
Python
13,411
453
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
bfd97ea30dffb1e71210e868b6f039e538be54e7a99cd6f7f4303de37fced746
Python
13,422
428
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
0a1717dd472dd639c031b9a986dcc0023152c6f71dfe9fa866c2fb0263886f3f
Python
13,436
276
# -*- coding: utf-8 -*- """ Created on February 2021 @author: hariteja1992@gmail.com This code optimizes the neural networks for center-out upper-limb reaching task. Dependecies: 1. biomechanical arm model from "MuscularArm.py" 2. Network class from "FeedbackController.py" 3. Scientific libra...
8637469ffee675846489159c8a0b386f2adc03690cb4cd87ad74e098bda75c86
Python
13,469
423
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
e0bbf66faa9d84ba9ee2659e26677a569f3bdf7eeff43d2bf95157f9313592e5
Python
13,471
423
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
9bfce95f2d4fb6f60f00df99e24328b977789261d4fe67da6cced768dd59e1a6
Python
13,494
439
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
a7ad225b2603c945b510333bd5a5ce76d4ff5ea4e38e19694cc7623f3e94d1aa
Python
13,514
439
# Copyright 2018 Amazon.com, Inc. or its affiliates. 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. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...