sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
a97eb98c4f3dc9b1db7f7ece4802973d6cd3d5269baf469524d06decf1d07af2
Python
10,211
260
# 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...
e38b3c8dd98fda1a9ae60d15f23f35705b2f16ae9f6b4e19bc9672b27aee0db4
Python
10,247
320
# 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...
bd042702e7abb9756b10bf0f0bf7d575ffbe1f1eb20931842fa15c5ca32f83ee
Python
10,259
293
# 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...
d1e5e0ed7633c983272d2df07c635dd754db861f1a01576d3cfdbc81653bdbcf
Python
10,274
301
import numpy as np import pandas as pd import torch from torch.autograd import Variable from math import sqrt, sin, cos, pi, asin #import deepgravity def earth_distance(lat_lng1, lat_lng2): """ Compute the distance (in km) along earth between two lat/lon pairs :param lat_lng1: tuple the first lat...
caf37538b737df068c580b2c18931f24159b93f691280767ad7bbfe6bd1e6fa2
Python
10,276
258
# coding: utf-8 # In[3]: """ train.py This scripts trains a SegNet model using a predefined Caffe solver file. """ import matplotlib.pyplot as plt plt.rcParams['figure.figsize'] = (15,15) import numpy as np import sys import argparse from config import CAFFE_ROOT, MODEL_FOLDER, CAFFE_MODE, CAFFE_DEVICE,\ ...
e26955487897d697800e341489d787f27b4d5fd6c89fc4fca69bad8b5e991469
Python
10,294
291
# 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...
dc108210692e7ccb8e215027b304fa63fd7a83746a30c4732346300e80adab3f
Python
10,305
300
# 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...
0d5328edac5aaddaed58e80080007731b430ab96ef4af1866540c461e24e149a
Python
10,308
365
# 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...
beffe7dbd41532e74a34651567f8ebe64a48d9bb5166e5f5444ed8c08e486e78
Python
10,334
281
# 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...
7199ee6c4b7691b80d2b76a0028f96e86d9096c539a66735e13bd29a50840de6
Python
10,352
283
# 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...
ddd7265534a128d7b1cd107481701c7a7c0658a003759838b10fd9d93392a3f2
Python
10,352
205
#! /bin/env python # # Michael Gibson 17 July 2015 # Modified Adrian Foy Sep 2018 # Modified Alan Emanuel Dec 2018 import sys, struct, math, os, time import numpy as np from analyzeMEA.intanutil.read_header import read_header from analyzeMEA.intanutil.get_bytes_per_data_block import get_bytes_per_data_block from anal...
d6aa286bbfdb87d89381ba4e7b0d7f19d19844744a91859f4129ff338a43e3c4
Python
10,369
386
# 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...
18164869e2d321f9c523e71b3b83801e46697fd713e2d9ab19684ed734c2e642
Python
10,375
296
# 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...
03282102925bc131a1031f68ae379fe04ac9ce0f1374c360c38687547dc5e47d
Python
10,385
278
from __future__ import print_function import os import argparse from osgeo import gdal, osr import warnings from skimage import io from skimage.transform import resize from skimage.util import crop import numpy as np from copy_geoinfo import copy_geoinfo from tqdm import tqdm from labels import convert_to_color, conver...
b69597ed4b4edf632f1b3982c291d412239a78ec570c053a0dd05b6fadac7c23
Python
10,389
356
# factor modeling demo for the working memory task in HCP. This demo runs for subject 100307 using the brain kernel prior. You can change method to "se" or "ridge" to run the comparisons across all three prior methods. import os from sklearn.metrics import r2_score import numpy as np import torch import torch.optim i...
a6ee9f924ca375e328c588817570324322a3420a2fe3ca478403784f72d77477
Python
10,397
289
# 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...
ee9bd9347670a5d02d0919d8f13ccfd1da36a040bce15952731647b729786631
Python
10,426
234
import os import numpy as np import torch import torch.nn as nn from probabilistic_forecast.utils.torch_utils import get_device from probabilistic_forecast.utils.plot_utils import plot_training_curve, plot_regression, plot_classification from probabilistic_forecast.utils.swag_utils import SWAG_Model, bn_update, sched...
41994098f72c84640e2acb92610a51f43c3b7ad8cf870892cd51f3edadfcd6ea
Python
10,436
340
# 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...
7976dade534557d339908093796e2b1d5c406c0b3ebe70a4ac772f932ead585a
Python
10,436
299
""" Collection of generic numpy array functions """ import math import warnings import numpy as np from margrie_libs.margrie_libs.signal_processing.exceptions import BadRandomError, PeakDetectionError def _get_decimate_new_n_pnts(trace, window_width, end_method): methods = ("drop", "strict", "pad") ...
bf083dcdd9088f14961d831d4bf992e9fbac97b914e5d1d6f4e42fcc2aefdbe8
Python
10,447
239
# @license # Copyright 2016 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...
615357fe0e0793e0a734ad6176d48a62fff9572615e39284c32918ca05f234bd
Python
10,454
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...
c968f31ecbd5196f2c1fd761d4da923b12a767c12b352e054d3af2e9775e7900
Python
10,499
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...
d4dc07d61ea3ff076d500e2dc94e9d44321f98a428e50fa5827435258be83cff
Python
10,500
317
# 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...
e69c184d094ebb7edceffa95719f87eeb34d8d0d7af52e827e0e92bc1820dead
Python
10,500
233
from __future__ import division from __future__ import print_function import argparse import os import sys import time from types import SimpleNamespace import math import numpy as np import torch import torch.optim as optim from tqdm import tqdm from models.pytorch.gnn_framework import GNN from multitask_benchmark....
412accde67607959f1dd5852483377f9be8615c9f6f073e0dfa43e343825b8ee
Python
10,512
221
# -*- coding: utf-8 -*- """ Created on February 2021 @author: hariteja1992@gmail.com This code optimizes the neural networks for posture perturbation task. Dependecies: 1. biomechanical arm model from "MuscularArm.py" 2. Network class from "FeedbackController.py" 3. Scientific libraries such ...
f25e091c345e89469151bb2fdb34a7fbe77cbee0e544b539cbf0c652b38207c2
Python
10,513
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...
2f4303422e34ab15cc4f35d9f651c76e5faf4d37f9cc853bf05470e138f377eb
Python
10,539
272
# 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...
db42da38184c5c987bba462c9c6030f09b4ae996e12bb3ac4b6f86e7e6b6b39f
Python
10,587
293
# 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...
34a5559a367c2d09676c008ab9c4d89e9b7c7dec8e70e011070311502090cb1f
Python
10,603
274
# 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...
69cd70765d362be72316ccb30a9e57d45400754df27c1404713c06e8df33a7bb
Python
10,604
326
import logging import os.path import matplotlib.pyplot as plt import scipy.stats as stats import numpy as np from pathlib import Path from datetime import datetime from fancylog import fancylog import opendirection.run.run as run def main(): start_time = datetime.now() config_path = os.path.join(str(Path(__f...
a76bc60841c93078b47c906e38b01bf1b2f6831d12709e431f78d8e907bd14dd
Python
10,611
372
# 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...
17f5a67b09b850a262cd0d3e1b7bc0697c3ac8d3187233a628b764ea408fc8ca
Python
10,622
372
# 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...
90a7f2ae8ccd688e139b3df12549286f4c9087d005833e4491ff0288cc2a8b40
Python
10,643
269
# 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...
99280c876acda61488c821451f5056a42d58920e9e3edf3ce044e44df4164d44
Python
10,662
309
#!/usr/bin/env python """ Qt Widget Range slider widget. Hazen 06/13 """ from PyQt5 import QtCore, QtGui, QtWidgets class QRangeSlider(QtWidgets.QWidget): """ Range Slider super class. """ doubleClick = QtCore.pyqtSignal() rangeChanged = QtCore.pyqtSignal(float, float) def __init__(sel...
23e1dca3d8a0491aa2b0c8301e02e51764e1a1cdf8b1c8f23c808fdd60b021b2
Python
10,668
290
import pandas #likely to go away for a streaming approach import numpy import logging import gzip import scipy.stats as stats from . import GWASSpecialHandling from .. import Exceptions from ..Constants import SNP from ..Constants import EFFECT_ALLELE from ..Constants import NON_EFFECT_ALLELE from ..Constants impor...
5e37994ae47238ee3c00926829105829a5bd3a86702205abd3ffd5d29aeb5357
Python
10,693
352
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generates figures examining reproduced pipelines """ from pathlib import Path import matplotlib.pyplot as plt import nibabel as nib import numpy as np import pandas as pd import seaborn as sns from surfer import Brain import abagen from vibecheck.plotting import save...
66d18d93c6ac1be9e766378076d437c41e5410541e00e45fe7d1813d3bd4ebef
Python
10,706
273
"""Test the module-level functions of yasa/hypno.py (not the methods of the Hypnogram class).""" import matplotlib.pyplot as plt import numpy as np import pandas as pd import pytest from pandas.testing import assert_frame_equal import yasa from yasa.hypno import Hypnogram, simulate_hypnogram from yasa.hypno import _h...
a039b039a056d14e6f67f354a8c6c81f92b88f28745e4f36b2df25c49d741c9d
Python
10,745
270
from typing import Tuple import torch import torch.nn.functional as F from cellfinder.core.detect.filters.plane.classical_filter import PeakEnhancer from cellfinder.core.detect.filters.plane.tile_walker import TileWalker class TileProcessor: """ Processor that filters each plane to highlight the peaks and a...
35289222efc55615fc2700cad7b6783c978d665f799de6c0d756acc172b5cd8a
Python
10,749
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...
623453f8b64bdbcf6795e9266f0d0dde1f9c9016da90f7a1db9ea0cef26ffc52
Python
10,771
225
import logging import unittest from unittest.mock import MagicMock, patch from zoltpy.connection import Model from code.zoltar_scripts.upload_covid19_forecasts_to_zoltar import upload_covid_all_forecasts, has_changed, \ upload_covid_forecast_by_model logging.getLogger().setLevel(logging.DEBUG) class UploadCov...
557c26d7ca759e6845c12e9c07ab92178eaa0635ed84cc7b89db8a768642815b
Python
10,777
317
from matplotlib import pyplot as plt import numpy as np import pandas as pd from sklearn.preprocessing import StandardScaler from scipy.ndimage import gaussian_filter1d import tensorflow as tf import os from scipy import signal import scipy from skued import baseline_dt def make_prediction(X, model, crystal_system)...
e07de7f7179bfec6098e38ca51440c8695dc727fa46fb0bf69c50d8b8294d285
Python
10,805
272
import numpy import numpy.testing import pandas import unittest from metax import Exceptions from metax.gwas import GWAS from metax.gwas import Utilities as GWASUtilities from metax.Constants import SNP from metax.Constants import EFFECT_ALLELE from metax.Constants import NON_EFFECT_ALLELE from metax.Constants impo...
fcf067bec6b2cd612fa25947cca84d25ca1ef072ca494ebac45798e58d7b3839
Python
10,808
306
#!/usr/bin/python3 import collections, os import pandas as pd import numpy as np import sys sys.path.append("..") sys.path.append("../..") import utilities def sort_dists(domains, dom2docs, doc2dom, dists): sorted_pmids = [] for dom in range(len(domains)): sorted_pmids += [pmid for pmid, sys in doc2dom.items()...
f79a927fdaed92a20f2dd8f958356a411b6e5ed192b9dd68e835eeb210404610
Python
10,853
289
import torch import torch.nn as nn import torch.nn.functional as F SUPPORTED_ACTIVATION_MAP = {'ReLU', 'Sigmoid', 'Tanh', 'ELU', 'SELU', 'GLU', 'LeakyReLU', 'Softplus', 'None'} def get_activation(activation): """ returns the activation function represented by the input string """ if activation and callable(a...
594d9ba0d833b0b388907422aaa458b5c9704e694a173fa3d3cd4f053e02842d
Python
10,871
345
import numpy as np import pycircstat import scipy.stats as stats from imlib.array.misc import ( sanitise_array, mask_array_by_array_val, midpoints_of_series, ) from imlib.array.locate import peak_nd_array from spikey.descriptive.radial import radial_tuning_stability def get_firing_cells(df, cells, min_fi...
c42ac07eaf2ddcc9ead4c00dbd6e10170eb78a3b2788d44273a04831d6bd23d9
Python
10,897
256
# simulations dependencies from brian2 import * import numpy, scipy.io import sys defaultclock.dt = 0.05*ms prefs.codegen.target = 'numpy' from brian2hears import * class ProgressBar(object): def __init__(self, toolbar_width=40): self.toolbar_width = toolbar_width self.ticks ...
94353ec48e797de692204a9393211e29c93df35980660d051d2ad4b7017a003f
Python
10,899
329
# 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...
94dcf2c865e045da2c4ff6ffd23504430e494d0fb9583b9aa8e2e334f71f21de
Python
10,935
244
# 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...
71571824c73d51ee0913477492fd088d3e138189d831d5fd3207998ce4db5e9b
Python
10,959
277
# 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...
1acd4606b1a73a2d007da8bf90299e04bb5c22f4962c41e1b2b9c2db48c162e2
Python
10,961
303
# 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...
e03d117bf2b3ed96945a05f313ca96e5526e6d62b7fef8e1bdb72f5727d6d5fd
Python
10,982
250
import numpy as np import os import time import random import argparse, json import torch import torch.optim as optim from torch.utils.data import DataLoader from tqdm import tqdm from nets.HIV_graph_classification.pna_net import PNANet from data.HIV import HIVDataset # import dataset from train.train_HIV_graph_class...
7748fab0b0e8d1050eedb4416cbd6b3c2b184ce97b1bc3cbf7c3062cf42f28a4
Python
11,015
254
from typing import Optional, List, Dict from torch_geometric.typing import Adj, OptTensor import torch from torch import Tensor from torch.nn import ModuleList, Sequential, Linear, ReLU from torch_geometric.nn.conv import MessagePassing from torch_geometric.nn.inits import reset from torch_geometric.utils import degre...
8194c93d509edc51f6a034f9b11fb7c17c09d3cf658dad423de742479b0a40dc
Python
11,021
276
import numpy as np from importlib import reload import h5py as h5 import sys direc = sys.argv[0].split('scripts')[0] where = sys.argv[1] mode = sys.argv[2] master_seed = int(sys.argv[3])*100 stim_idx = int(sys.argv[4]) sys.path.append(direc+'support') import parameters reload(parameters) import parameters as par im...
3640d180f1dfe01f5c46aad88bed610f6bb0539a227ea662b9faed24dafb2252
Python
11,028
402
# 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...
e6064bc17051108c7500d799efb79a1410c0a0d87fe94567a20d83fdf71f8943
Python
11,038
213
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 1 20:33:32 2019 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) """ from Dataset import Dataset from DataPlot import DataPlot from Preprocessing import Preprocessing from E...
8a259e3224a280d66157f7c90839710dd3b011fae76dc7fc0e06a3f7457ed971
Python
11,082
261
import os import csv import numpy as np import matplotlib.pyplot as plt from cached_property import cached_property from probez.spike_handling import waveforms, cluster_exceptions, cluster from probez.util import generic_functions from probez.sorting_quality import load_quality_measures from bisect import bisect_left ...
595e441bcb360bde579c255ec8a1114fe862338f60e4e1d059f9338ae0bb0c78
Python
11,105
294
from Bio import SeqIO import os import torch import numpy as np import random import warnings warnings.simplefilter(action='ignore', category=FutureWarning) from prospr.sequence import Sequence from prospr.io import save from prospr.dataloader import get_tensors from prospr.nn import ProsprNetwork, load_model, CUDA, C...
8614f421dbf50c9655387b2a04793353f835ee8101f6463f87ced86a1fb80f22
Python
11,152
310
import copy import rdkit.Chem as Chem import torch import torch.nn as nn import torch.nn.functional as F from .chemutils import attach_mols, copy_edit_mol, enum_assemble, set_atommap from .datautils import tensorize from .jtmpn import JTMPN from .jtnn_dec import JTNNDecoder from .jtnn_enc import JTNNEncoder from .mol...
129ede9e2efd0ca7cfd44597905607402f0ba569096c030f35e7fa639292ee5e
Python
11,160
234
from ANNarchy import * setup(dt=1.0,seed=1001) import matplotlib.pyplot as plt import Gabor_sinus as gabor import os.path from net import * # Present sinus gratings in different orientations and contrast levels to measure the tuning curves # R. Larisch, Technische Universitaet Chemnitz # 2020-04-27 #-----------------...
9ba79134daf7d3971d634dad075298f1ed110669efb54ab739f1e655d1daa12e
Python
11,178
285
import tensorflow as tf import numpy as np from tensorflow.keras.callbacks import Callback from tensorflow.python.keras import backend as K # adapted from ReduceLROnPlateau class RelativeReduceLROnPlateau(Callback): def __init__(self, monitor='val_loss', factor=0.1, ...
b807db8e3bfa5ed29d8cd04176e81d8319944a0b9f71103b7975c7fe304a06fa
Python
11,179
319
""" This module contains a single function, firecracker, that produces a figure of multiple time series that are stacked horizontally. A color gradient is applied to each series so that one can use both the height of the y axis and color in order to visually compare the shape and relative magnitude of the different ser...
dac74efb1f7cedaad4c88315d7428cc13a91f6d3df7a181e2f514a81fb4160b5
Python
11,186
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...
a3d2dde08105cc0ae854c6ad48cdb56399af52f2ee7597e285504a98749e656a
Python
11,191
315
# 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...
42997840a3300fc553c294e13b418345c0f2857df692e66734fdc97c409deff4
Python
11,193
289
# module import import os import os.path import numpy as np # pyqt5 module import from PyQt5.QtGui import QIcon from PyQt5.QtCore import QRect, QSize, Qt from PyQt5.QtWidgets import QDialog, QAbstractItemView, QMessageBox # custom module import import analysis_guis.common_func as cf from analysis_guis.dia...
8dbe2b3d9216ff8c448c922ed872e1dc976fc5d0d819562c8be4aab56678ddc8
Python
11,206
380
# 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...
ee95c059c5bcf11b5c181b56bb652d02508f18a1d73c4919789aa6ccfe3dbed5
Python
11,223
293
""" Extracts visual area LFPs from Neuropixels nwb.lfp files, does some plotting, and saves out per-region LFPs as pickle files for further analysis. Creates Figure 6A from the paper. """ # %% imports import os import h5py as h5 import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches ...
736a3261298e1b2a8ccb7f2ac36f76b66d7c5f691bced174708db7f7c59b0ef7
Python
11,227
276
""" This file is for models creation, which consults options and creates each encoder and decoder accordingly. """ import torch import torch.nn as nn from torch.nn.init import xavier_uniform_ import onmt.inputters as inputters import onmt.modules from onmt.encoders.rnn_encoder import RNNEncoder from onmt.encoders.tra...
04c0d830e4dd337fbcad365e21218f0c53ac0eeb6805486e87a2dc1c23d11500
Python
11,243
295
""" Extracts visual area LFPs from Neuropixels nwb.lfp files, does some plotting, and saves out per-region LFPs as pickle files for further analysis. Creates Figure 6A from the paper. """ # %% imports import os import h5py as h5 import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches ...
a63c5c9bdd96ad33a09bf356a7ad6f0571ed38026fbc29cac6e9af8a209802b7
Python
11,295
311
#!/usr/bin/env python # For creating files for new model. Run as # modelGenerator.py {model short name} {model long name} {toolbox name} [CopyrightName YearOne YearTwo etc] # A detailed model description can be given in {model short name}.txt import os import sys import re import shutil import time import string ...
49194403b836a9a0031c076f2361ccf9ad81789a8fc28478f7ce2ec4889ad19b
Python
11,303
355
import logging import os.path import numpy as np import multiprocessing as mp from datetime import datetime from fancylog import fancylog from glob import glob from imlib.radial.temporal import angle_bin_occupancy from imlib.general.system import ( get_num_processes, ensure_directory_exists, ) from opendir...
7f33c7c8da3bbcf54e683f1f8b0ced705d73661099ee2042d998ad0a9338d76b
Python
11,313
281
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Dec 1 01:58:15 2020 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) Based on: Banerjee, Siddhartha. Collaborative Filtering for Movie Recommendations. 2020. https:...
7ca6b9bc22b2a6b210d76285d81063d899d7020f737f7db7e25825ce9454448b
Python
11,351
272
import copy import datetime import os import random from functools import partial import numpy as np import pandas as pd import termcolor import torch from matplotlib import pyplot as plt from torch.utils.data import DataLoader from tqdm import tqdm from deep_phospho import proteomics_utils from deep_phospho.model_da...
ed748f97584c7b4abe0496dd6dd9b5c2232a114b35645d932903244ddca0614a
Python
11,356
322
import argparse import copy import unittest import math import torch import onmt import onmt.inputters import onmt.opts from onmt.model_builder import build_embeddings, \ build_encoder, build_decoder from onmt.encoders.image_encoder import ImageEncoder from onmt.encoders.audio_encoder import AudioEncoder parser ...
d76434ecc5dedb0f40a36321dc7413db67fb3ae86f9e4fddccb342a3deacbf80
Python
11,360
367
# 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...
c5c1f08f26063d5c4ea5ed7d0e0b8886774ee4bb902d38686f13998cfb38f32f
Python
11,376
342
import numpy as np import os import string import re import tensorflow as tf from Bio import SeqIO from Bio.PDB.DSSP import DSSP from Bio.PDB import PDBParser tf.compat.v1.enable_eager_execution() mapping = np.array([0, 4.001, 6.001, 8.001, 10.001, 12.001, 14.001, 16.001, 18.001, 20.001]) def probability(n): try:...
5eaacb958303c68347a6dbb67b1c1fd454338441546c1f0f4dc25f89cfcaf6ae
Python
11,380
336
# -*- coding: utf-8 -*- """ Created on Sun Jun 6 10:56:38 2021 @author: yuyi6 """ from sklearn.base import clone from sklearn.model_selection import LeaveOneGroupOut import numpy as np from skorch import NeuralNetRegressor, NeuralNetClassifier from skorch.dataset import Dataset from skorch.helper import predefined_s...
1a551e2abf9a176cfaa6e4485fc978278654fe32a13bb22970d694ffb5134699
Python
11,389
437
# 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...
b2c47f873f7414b88ac524ac24f5b946fb98972fb4e1a6f6cbcae31defb612a4
Python
11,397
309
# -*- coding: utf-8 -*- import tensorflow as tf from .. import _logging as logging from .core import * __all__ = [ 'Quant_DenseLayer', 'Quant_Conv2d', 'Quant_Layer', ] def _quantize_median(x, k): G = tf.get_default_graph() n = float(2**k) with G.gradient_override_map({"Round": "Identity"}):...
aa105d218311d17f7c286ad87263904883d669fe7b32291a06443951916c2b10
Python
11,433
357
import os from pathlib import Path from typing import List, Tuple import numpy as np import pooch import pytest import torch.backends.mps from skimage.filters import gaussian from cellfinder.core.download.download import ( DEFAULT_DOWNLOAD_DIRECTORY, download_models, ) from cellfinder.core.tools.system import...
75e97a47aa90cdfaa1eddc95b2da0498ae3485b79ca56a3c115d00e307dac305
Python
11,444
305
# 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...
50466b2965730859577b32ad4875686b1962660216ae174b46c5b27b692046c3
Python
11,449
272
# 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...
42f2ea8239a83e399bc6001f73746b6030905a3c213b214cd7e1c05308cb7c3c
Python
11,458
442
# 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...
e936a0badbca4467d40d1e4f0b599d7c0c815c9d7cd8f2cc98fa4a66dd7cacc9
Python
11,459
259
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Feb 10 10:22:10 2020 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) """ from RecommenderData import RecommenderData from RecommenderContext import RecommenderContext from ...
812b8340cc9d91080e85f3c9ac5dc63221ab1b7242e784ecbd2b32c3b76906b6
Python
11,473
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...
cf71213647b11e46ab6bd50b5e146594ff150223a0b32269af83f7ff8c088faa
Python
11,490
389
from typing import Callable, Dict, List, Literal, Optional, Tuple, Union from keras import ( KerasTensor as Tensor, ) from keras import Model from keras import layers as keras_layers from keras.initializers import Initializer from keras.layers import ( Activation, Add, BatchNormalization, Dense, ...
845c85cabdb3f30d053310b19aa06aa6bdb71c01f7c936d81e09e8dfbf4c28ff
Python
11,516
246
# 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...
a76348172c2f6d24883969563d6c4bcb11d4c197f702e8515ace023b2fad5bfd
Python
11,520
380
# 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...
f7577edb56a7d3d8225fd1bf7521ed0b06e0b82a5b2ecc4b87bc1c4f87814358
Python
11,527
460
# 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...
424f5d4e22de3dbdeba667ebd8428a13ace6dca3755b8e7997feb764416561fa
Python
11,696
287
# -*- 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...
48cfd36feec905e4d177dca454420f7dd02f44bdc2060064d26be5b9d52152e1
Python
11,707
310
# 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...
bb8489282609a18070c6d5c5c5d15bc05bf5f7ab1dd36c5de3b7cdd0643d5793
Python
11,707
287
# -*- 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...
8516d11da8d2716a62619c764a10ad6bc772aaa78d44f413ff9bba2134c2cf7f
Python
11,730
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...
062d1e8f4b2fac940f99b7ed8ac97891d23c91bebe876d3f5d293f9e18327e77
Python
11,739
296
# 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...
bd67ea9d4bcc48024c2746ad832221b88560b442a84249e1c261f9ca2796629d
Python
11,745
301
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Oct 26 17:49:21 2019 @authors: Luz Santamaría Granados (luzsantamariag@gmail.com) Juan Francisco Mendoza Moreno (jfmendozam@gmail.com) """ from pymongo import MongoClient from datetime import date import pandas as pd import numpy a...
7afc3ebe83371b01d96b1b7ab76c1b24767eef2003bb37d52742624c14779565
Python
11,749
377
from functools import partial, wraps from random import getrandbits, uniform from typing import Any, Callable, Optional, Sequence, Type import numpy as np import torch from natsort import natsorted def inference_wrapper(func): """ Decorator that makes the decorated function/method run with `torch.inferen...
8bf51410a096bf31b620ac3074382645b0a857ed0a48600f33bf21cd05142033
Python
11,749
364
#!/usr/bin/env python """ ============================================= SNR estimation for Diffusion-Weighted Images ============================================= Computing the Signal-to-Noise-Ratio (SNR) of DW images is still an open question, as SNR depends on the white matter structure of interest as well as the ...
d25c4285d62dc9573b0e14c547521711824b2a8f0112bb0cd3ef5110fbc8e901
Python
11,756
310
# -*- coding: utf-8 -*- from configparser import RawConfigParser from .util.io import * from .util.extras import * from os.path import join import sys from shutil import copyfile def download_uniprot_files(sources_dp, srcs_cp): """ Download uniprot database files Parameters ---------- sources_dp : st...
23b733a0cc56fc3ba6678277b804c9ec803130e0aa099b899e3e695946cbf8c2
Python
11,778
435
# 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...
965fb7dd088dbaa45160b2ffec76555a0794001959937d3fe3cbfdc6ccac446f
Python
11,779
314
""" This file handles the details of the loss function during training. This includes: LossComputeBase and the standard NMTLossCompute, and sharded loss compute stuff. """ from __future__ import division import torch import torch.nn as nn import torch.nn.functional as F import onmt import onmt.inputter...
508a4b2a305ed605148be224b2c30a68a57fe13df5e843b04cce427f46ad426d
Python
11,796
299
import numpy as np # import pandas as pd import os import json import sys # import glob if sys.argv[1] == "EMT": folder = "/work/ritchieteam/EMT_irfinder/" shortnames = [["T5moins_rep1", "T5moins_rep2", "T5moins_rep3"], ["T1plus_rep1", "T1plus_rep2", "T1plus_rep3"], ["T5plus_rep1", "T5plus_r...