sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
b3757c5f2eed1653bf050bcdf8c3cbbb0fcd111b194533ad1fb563436f363e1b | Python | 13,535 | 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... |
44a675279b4182a8eaa538368d281a23ff329940ce5ad5e2f00b7dcd17cc2940 | Python | 13,594 | 322 | import os
#os.environ['CUDA_VISIBLE_DEVICES'] = '-1' #'-1' Disable GPU
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras import Model
from tensorflow.keras.layers import *
from utils import RelativeReduceLROnPlateau, RelativeEarlyStopping, ... |
1c4a6d6b6bd10ffe71e9c37595f1f908fabf99ee37c1da13dcc3214ef395f6c0 | Python | 13,599 | 328 | import copy
import datetime
import json
import os
import random
from functools import partial
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
from torch.utils.data import DataLoader
from tqdm import tqdm
from deep_phospho.model_dataset.dataset import IonDataset, collate_fn
from dee... |
b9e3ebd7227c551b88445d6bf09965bc005e31de367a46b56fda8473b8d184fb | Python | 13,604 | 411 | # -*- coding: utf-8 -*-
"""
Created on Wed Jul 21 13:58:17 2021
@author: yuyi6
"""
from CRNNTL.preprocessing import data_pre
from CRNNTL.train import CNN_CRNN_train
from sklearn.base import clone
from sklearn.model_selection import LeaveOneGroupOut
import numpy as np
from skorch import NeuralNetRegressor, NeuralNetC... |
b5a0634f6d195857095b80695a40b1d221ee3f7d97d437032e645a7e18b77543 | Python | 13,629 | 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... |
9f93d264a96ca61f24b2ff2d55cb7e2fae70b4636145ed7061f0fd58cc32e1a4 | Python | 13,674 | 322 | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '-1' #'-1' Disable GPU
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
import tensorflow_addons as tfa
from tensorflow.keras import Model
from tensorflow.keras.layers import *
from utils import RelativeReduceLROnPlateau, RelativeEarlyStopping, E... |
7e2e2fb8ce2f241843a3c80a1a3239a903d18a2c6d8b56c402c9cb5105240c4a | Python | 13,704 | 267 | import math
import os
import random
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from margrie_libs.utils.print_utils import dprint
from shuffle_anova_mateo import analyse_split, DIRECTION_NUMS
from signal_processing.mat_utils import linearise, get_uniques
class ExperimentResampler(obj... |
7dc959ee7165916b24998e456115a1b57bacffdf34180407485651c0e806ada7 | Python | 13,716 | 385 | # 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... |
24e83c8187da6158058ddb0d6518923313e13fc6823149c93cf5e65d88ded9de | Python | 13,720 | 330 | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from importlib import reload
import h5py as h5
from matplotlib import colors
import sys
import matplotlib.patches as patches
direc = sys.argv[0].split('scripts')[0]
where = sys.argv[1]
mode = sys.argv[2]
stim_idx = int(sys.argv[3])
sys.path.append(di... |
52821e4529fc6cd205d51b2562f062f6901139c0f2e6c8088edac0d6db00b9b6 | Python | 13,753 | 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... |
40fa8b24763ede2003226b1b9c37ec34390798516541965f7ad8fafbb2acb54e | Python | 13,832 | 378 | # 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... |
15a732da6aa9cbfafc907431b4476baafea158a512e2fd3cd87d3a1d83c174ef | Python | 13,837 | 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... |
3f26fb2218d7ab2ae70d7106b7da6ceec30a2c65dc66b338ad5772f62ded0886 | Python | 13,879 | 367 | from copy import copy
from typing import List, Optional, Tuple, Type
import numpy as np
import torch
from cellfinder.core.detect.filters.setup_filters import DetectionSettings
from cellfinder.core.detect.filters.volume.ball_filter import (
BallFilter,
InvalidVolume,
)
from cellfinder.core.detect.filters.volum... |
703783fe6985fedabf5784f7e7ff39d0c1d2dce3b042f34b5e75d964c0fccf96 | Python | 13,922 | 330 | import tensorflow as tf
from ..utils.bbox_overlap import bbox_overlap_tf
from ..utils.bbox_transform_tf import encode as encode_tf
def RPNTarget(all_anchors, num_anchors, gt_boxes, im_shape):
"""RPNTarget: Get RPN's classification and regression targets.
RPNTarget is responsible for:
* calculating the... |
1c4b71b2a3979d52072e5b9667177aeed861e03f821b215ee530ad768734895b | Python | 13,926 | 374 | import copy
import rdkit.Chem as Chem
import torch
import torch.nn as nn
from .chemutils import (
attach_mols,
copy_edit_mol,
decode_stereo,
enum_assemble,
set_atommap,
)
from .jtmpn import JTMPN
from .jtnn_dec import JTNNDecoder
from .jtnn_enc import JTNNEncoder
from .mol_tree import MolTree
from... |
3517c0fa9b2c8f42a246764e4c3dab16aff0ff0733a0b1211e5f3cdaf267495c | Python | 13,928 | 379 | # 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... |
c735d22e511c50c40e33694f28083ad12f93150181168d4497c960f24d493ff5 | Python | 13,939 | 462 | # 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... |
b45f1942676d34c144847fedb86eb6930aaa6f63afe06b3abfc7a9968db83361 | Python | 13,950 | 336 | from __future__ import print_function
import keras
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint
from keras import backend as K
from models import residualbind
from matplotlib import pyplot as plt
from sklearn.metrics import roc_auc_score
from sklearn.metrics import average_precision_sco... |
19333f2001b74ce8decc18904dca41e156413640879a2528147eb47abbfe6221 | Python | 13,951 | 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... |
77f1b6b92ac885999562d30b819d1979a9c82fc9fad5ff3db086cdeb140cd3e1 | Python | 13,984 | 309 | # --*-- coding: utf-8 --*--
import shutil
from argparse import ArgumentParser
from functools import partial
import deepchem as dc
import numpy as np
from deepchem.models.optimizers import LearningRateSchedule
from tensorboardX import SummaryWriter
import os
from sklearn.metrics import jaccard_score, r2_score, mean_sq... |
a695f655eddd767d12dc263992a2ca0db61a654c6bd87ae7c342db224e372a16 | Python | 13,984 | 368 | # 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... |
eec70cebb8a9143baa2628c94556dd8160f2c8f0c34abc7211f07d6f4182cb38 | Python | 13,986 | 436 | # 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... |
5f018555aa30d646aa2c78e4200fe3d7f0793209e4d7e3515c10826df01ad30b | Python | 13,998 | 441 | import numpy as np
import pytest
import torch
from brainglobe_utils.IO.image.load import read_with_dask
from cellfinder.core.detect.filters.plane import TileProcessor
from cellfinder.core.detect.filters.plane.classical_filter import PeakEnhancer
from cellfinder.core.detect.filters.plane.tile_walker import TileWalker
f... |
bf8f4f014110797c1138d4b711839fbb14847114197c7cb65c978a790a3b7190 | Python | 14,013 | 378 | from __future__ import print_function
import argparse
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data.distributed
import pandas as pd
import numpy as np
import random
# Horovod: import horovod
import horovod.torch as hvd
from horovod.torch.mpi_ops import Avera... |
042c478c689dcb3ff31c8c889ac5f698ef98c274a5f06de4ad574cfff25bf82f | Python | 14,031 | 368 | # 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... |
c09b68660a7441a1491a903ddb8a2b2c27a52192921bc0ff808bacb3b4543e4e | Python | 14,035 | 336 | """Test hypnogram upsampling: Hypnogram.upsample, Hypnogram.upsample_to_data and the helpers.
Hypnogram.upsample_to_data is tested on all combinations of:
- data type : NumPy array | MNE Raw without meas_date | MNE Raw with meas_date
- Hypnogram : no start | naive start | tz-aware start (via tz=) | tz-aware dateti... |
1888915893cf43eaf595a231c63cbe60f012324ab55c8145bd193af75d3b525a | Python | 14,112 | 325 | from image_registration.fft_tools import correlate2d, fast_ffts
from image_registration.fft_tools import dftups, upsample_image, shift
import warnings
import numpy as np
__all__ = ['register_images']
def register_images(im1, im2, usfac=1, return_registered=False,
return_error=False, zeromean=True... |
11dd30e41c6c7b17753b06c05f613768732e143b6628ac074fead6cd2a9122df | Python | 14,113 | 455 | # 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... |
89ba7e8ddaa28b059e60c4bcd148afb3e84ff020b55c23e5d3971fea5e761d4c | Python | 14,114 | 358 | #!/usr/bin/env python
__author__ = 'heroico'
import os
import io
import gzip
import logging
import numpy
from metax import WeightDBUtilities
from metax import PrediXcanFormatUtilities
from metax import ThousandGenomesUtilities
from metax import Logging
from metax import Utilities
from metax import Formats
from timeit ... |
8a35bd4db19d4bb42400e8ef1aa2267b126516b276fe379949f978c1c239d0ba | Python | 14,141 | 370 | # 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... |
428dd620095f5feb3b3d6add478a93ee98efe96f035ff65e5b4a49aa24f7126b | Python | 14,170 | 378 | import torch
import torch.nn as nn
import torch.nn.functional as F
from .chemutils import enum_assemble, set_atommap
from .mol_tree import MolTree, MolTreeNode
from .nnutils import GRU, create_var
MAX_NB = 15
MAX_DECODE_LEN = 100
class JTNNDecoder(nn.Module):
def __init__(self, vocab, hidden_size, latent_size, ... |
9ee34f2caac9df8380e4d8bf0a6e2df2401ccf35314496d9ddf2bd09d5b53119 | Python | 14,180 | 296 | # -*- coding: utf-8 -*-
"""
VGG-Net for CIFAR-10.
Introduction
----------------
VGG is a convolutional neural network model proposed by K. Simonyan and A. Zisserman
from the University of Oxford in the paper 鈥淰ery Deep Convolutional Networks for
Large-Scale Image Recognition鈥? .
Download Pre-trained Model
-----------... |
543732b12c989f697e18a711a13174c10394f645d4a8b8f461fbe5fdc1816684 | Python | 14,187 | 296 | # -*- coding: utf-8 -*-
"""
VGG-Net for CIFAR-100.
Introduction
----------------
VGG is a convolutional neural network model proposed by K. Simonyan and A. Zisserman
from the University of Oxford in the paper 鈥淰ery Deep Convolutional Networks for
Large-Scale Image Recognition鈥? .
Download Pre-trained Model
----------... |
61f17d6d1b1afa578a1780d1b59dc59c51171075c936ce271ae965cd55c9fee3 | Python | 14,222 | 378 | # 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... |
6a2a178702eca073fc7814471483b5726c78108a1810e4ae79aeba740223f2e2 | Python | 14,258 | 420 | import sys
import json
import logging
import argparse
import re
from pathlib import Path
import xml.etree.ElementTree as ET
from typing import Dict, List, Optional, Any
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
TEI_NS = ... |
6986e75525de677dd1878e90c023ef5e0fd29c4ecb0d6af9d841e30b9b0fd249 | Python | 14,282 | 380 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pre-process Data / features files and build vocabulary
"""
import argparse
import glob
import logging
import multiprocessing
# import torch.multiprocessing as multiprocessing
import sys
import gc
import os
import codecs
from functools import partial
import torch
f... |
cd8efadd384259eeebe98e28f6e61a30f93fc3833f4c69d5f983c37ccfd12e59 | Python | 14,332 | 383 | # 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... |
9a9bfeb619e0ba24c7496c4292910d78790fd30d95522dab40d4547876703300 | Python | 14,401 | 431 | # 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... |
cf30c682de858af739b449d4a90a0aa278cf108298bb1235007c6e0f027a7624 | Python | 14,405 | 454 | import os
from math import isclose
import brainglobe_utils.IO.cells as cell_io
import numpy as np
import pytest
import torch
from brainglobe_utils.cells.cells import Cell
from brainglobe_utils.general.system import get_num_processes
from brainglobe_utils.IO.image.load import read_with_dask
from cellfinder.core.detect... |
765b43d35682d14452967067a56c0f965d06993cb802b91bfa2e185d63ef7fe7 | Python | 14,411 | 463 | # 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... |
c174d7ff681e2ba078977ad1a9e90fbea3336c8123708b3ec5d3243c35188340 | Python | 14,416 | 397 | # 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... |
edc8d6eae1e68fa44ef65c7299d6aa9b83d8782fa93506ffa5cc3dbbfe31d077 | Python | 14,428 | 517 | import math
from queue import Queue
import numpy as np
def is_connected(A):
"""
:param A:np.array the adjacency matrix
:return:bool whether the graph is connected or not
"""
for _ in range(int(1 + math.ceil(math.log2(A.shape[0])))):
A = np.dot(A, A)
return np.min(A) > 0
def identity... |
7de9b5e69305fd04e575edc1dfd92e33e4e1ff1041eebd9b6926cd6b7a9892ef | Python | 14,450 | 220 | # cpde fpr storing motor system network classes
import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np
from muscularArmClass import muscular_arm
from torch.distributions import normal
use_cuda = 'false'
device = torch.device('cuda:0' if use_cuda else 'cpu')
device = 'cpu'
class feedback_co... |
5d4c831af378b563ba9f82dc653164a4c93b7f1c642cd3832e963f865e9eade6 | Python | 14,561 | 502 | #!/usr/bin/env python
# coding: utf-8
#
# Author: Kazuto Nakashima
# URL: https://kazuto1011.github.io
# Date: 07 January 2019
from __future__ import absolute_import, division, print_function
import json
import multiprocessing
import os
import click
import joblib
import numpy as np
import torch
import torch.nn ... |
c6681af4f2ca0625896c7fe19d8b14890b8f9c43fceec9d2396a190b3cc6ce26 | Python | 14,573 | 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... |
fb069bc118e4398f8387279e458adee4cda616a40fb4244d9cbe17d3dd5a2a7d | Python | 14,573 | 430 | import re
import numpy as np
import networkx as nx
import rdkit
import torchtext
from rdkit import Chem
from rdkit import RDConfig
from rdkit.Chem import ChemicalFeatures, AllChem
import os
import torch
import time
import dgl
import dgl.function as fn
import torch
import torch.nn as nn
import torch.nn.functional as F
i... |
8742374c9de710255d151802909281420db143b109ff9826dc431fe220d570e5 | Python | 14,598 | 254 | import numpy as np
import scipy
import itertools
import statsmodels
def suprathreshold_count_cell_summary_fn(t_vals_per_edge, t_threshold):
""" Returns the number of suprathreshold edges in t_vals_per_edge. This is the cell summary statistic used in Sripada (2021).
"""
return np.sum(np.abs(t_vals_per_edge... |
e58239f9acf68611fab59c14fdfc136ebf38c012f5be1a0d6c2690c6cc0c3984 | Python | 14,651 | 482 | import sys
import numpy as np
def V1(a,b,c):
return a*b*c
def V2(a,b,c):
return ((np.sqrt(3))/2)*(a**2)*c
def LPrange(prediction, crystal_system, bound=0.2):
"""
Function to get the bounds on the lattice parameters and volume for use in Lp-Search automated scripts.
Parameters
---... |
4de0d97f11c744bc4d6225335fc71382d3807523a6a1df24daa60c5f3cbfab69 | Python | 14,734 | 455 | # 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... |
585f3d3187bac31f26b4d65af5a77f5ea99de968683417f07db1088da304ae3d | Python | 14,754 | 396 | import logging
import operator
import os
import pickle
from tqdm import tqdm
import copy
import numpy as np
import pandas as pd
from deep_phospho.model_utils.utils_functions import match_frag, ion_types, get_index, get_pkl_path, intensity_load_check
PADDING_CHAR = '#'
ENDING_CHAR = '$'
MASK_CHAR = "-"
CLS_TOKEN = "&... |
4820d624dcadfabfd955191f30a2d92e1ee849ec91a7b85995054cf85a764f87 | Python | 14,774 | 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... |
fdf492487786c273907af0914bea7d60ea840b1997cae0c2b289ec1f73238c49 | Python | 14,777 | 310 | """
Class for 1D GPCSD model, fitting, and prediction.
"""
import autograd.numpy as np
np.seterr(all='ignore')
from autograd import grad
import scipy
from tqdm import tqdm
from gpcsd.priors import *
from gpcsd.covariances import *
from gpcsd.forward_models import *
from gpcsd.utility_functions import *
JITTER = 1e-... |
6ea2a95124e916effdf86dc71ce069e1ae3632fccfa0bae4ca1428c1e3b3b588 | Python | 14,803 | 310 | """
Class for 1D GPCSD model, fitting, and prediction.
"""
import autograd.numpy as np
np.seterr(all='ignore')
from autograd import grad
import scipy
from tqdm import tqdm
from gpcsd.priors import *
from gpcsd.covariances import *
from gpcsd.forward_models import *
from gpcsd.utility_functions import *
JITTER = 1e-... |
ab7481683f0525118fe86bbcd624fba100da15dfb5c607b3a1d76f7ed7310114 | Python | 14,807 | 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... |
d83d99bb67e5e45101595f1fe2c0ddb704a978088e915a72ec7d0c2de5fcde84 | Python | 14,834 | 419 | # 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... |
0206d6ee46af90914a23f7d57d4cd4496057c3bb7c348862591639d1647dc57a | Python | 14,846 | 335 | import numpy as np
import pdb
# import spiking function
from spiking_ulils import label_encoder
from spiking_ulils import Conv2d, BatchNorm2d, Relu
from spiking_ulils import Flatten
from spiking_ulils import Linear
import argparse
parser = argparse.ArgumentParser()
# quantization level
parser.add_argument('--k', type... |
1c9f91adca7dd85ed4c686d181bf5b0f6a124343655ab33c11d48e023b5cef92 | Python | 14,848 | 519 | # 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... |
e7c91c1862853d3ed34f4cf127d43806aae4425b78a3c320d626783483e796c7 | Python | 14,854 | 335 | import numpy as np
import pdb
# import spiking function
from spiking_ulils import label_encoder
from spiking_ulils import Conv2d, BatchNorm2d, Relu
from spiking_ulils import Flatten
from spiking_ulils import Linear
import argparse
parser = argparse.ArgumentParser()
# quantization level
parser.add_argument('--k', type... |
86fb11d85a0584ef1601c34ee41dfd7482a9c66c7e9fd4e14b4af345c21c697c | Python | 14,858 | 387 | # -*- coding: utf-8 -*-
"""
AudioDataset
"""
import codecs
import os
import sys
import io
from tqdm import tqdm
import torch
import torchtext
from onmt.inputters.dataset_base import DatasetBase, PAD_WORD, BOS_WORD, \
EOS_WORD
class AudioDataset(DatasetBase):
""" Dataset for data_type=='audio'
B... |
582deacafcbfc374cf600517fae90ff618d3578ba0fc5ca7d8a990298f0c6dcc | Python | 14,916 | 396 | # 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... |
6c98081063349ff499c5f04d09c4f45d5244fe23a122100be3d47144cda4d7f8 | Python | 14,938 | 304 | '''
Modest script to help selecting "interesting" error cases in a set of Grobid processed JATS/PDF pairs (e.g. PMC, bioRxiv, etc.).
For example:
- we can select "hard-failed" results without title, authors, affiliation, abstract, without full text and/or without bibliographical references,
- we can select results with... |
f8eba205cdb504c21807861bffa25aacac6feb72cd06b78eb68bcc78a3c3f043 | Python | 15,012 | 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... |
f0e639870c0cdd2ad2d28075aee29036e0a6fe26b903ef423e08f876c4908029 | Python | 15,092 | 429 | # 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... |
d66cf8219f6e61f5e64ffc55a260df20adcc7dd0151abf4df31415b30c05c99e | Python | 15,134 | 503 | # 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... |
404686f35969fbac1ed0788145901e684b6d900cdc430b5796985687467be1e7 | Python | 15,161 | 504 | # 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... |
dbf3026fda22c5ec0957ba9642c6f8cfa83377d1012f7b9ce894794109505a5d | Python | 15,216 | 427 | # 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... |
8b73e2087417c31f029bb48d2cd848e9dd8171f3ea92bc5360775b5b2ecd6485 | Python | 15,244 | 550 | # 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... |
0d81f6eba58baaafd71578310087255a9409269632924dfcaf02e9ee45ee046f | Python | 15,276 | 473 | # 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... |
cf3f9e0ef549f9059ecbadcaf21f196bd0853966e9153f7df180a498075eb1f3 | Python | 15,292 | 322 | # Created by woochanghwang at 16/07/2021
import pandas as pd
import numpy as np
import networkx as nx
def calc_F1_score(recall, precision):
f1_score = 2 * ((precision * recall) / (precision + recall))
return f1_score
def make_drug_patway():
virus = "SARS-CoV"
candidate_drug_df= pd.read_excel(f"../resu... |
f05cf16e82a7dba359b209470f5e161b348071d3fa4817a24b83fa13ee4befc8 | Python | 15,407 | 411 | # 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... |
a76d49ce2a25260173f4e33164e72d0e80c5cfc16798d006945705356c03154c | Python | 15,472 | 431 | # 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... |
4623d792e147ee03e7c35f1ab715ccd7639ed1a32d846a05ad6aa87200563e51 | Python | 15,475 | 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... |
9cc6706a775a95655593516eb0b9ec305f8713fd75c7b977e02dcdeae6901152 | Python | 15,481 | 425 | #===================================
# Global variables
#===================================
# 0. color code
color_list_35 = ['black','gray','silver', 'rosybrown', 'lightcoral','firebrick','maroon', 'red','coral','chocolate',
'saddlebrown','darkorange','orange','peachpuff','gold','olive'... |
81ad077f2c67514146b61f9417aff02a35d3a84fe9545905a1754b599659a695 | Python | 15,506 | 401 | # 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... |
b35e7ee7af0c0067af4e61ab8438ccba112e70c0beec6aab84e4e55e28342032 | Python | 15,531 | 461 | """
Given an input folder containing a list of tiff, it loads it using dask
and does full 2d and 3d filtering, cell detection and cluster splitting.
For each filtering step it outputs the filtered image so you can see what
the step produces and tune parameters.
It outputs the following folders in the provided output d... |
80962a823051c8c17f7f3578f8c52d48687042093000f651ef4ec93baf7ccd08 | Python | 15,541 | 320 | 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 = 0
def __call__(self, elapsed, complete, s... |
e1b14038cd957e9906da0853da580e011ad4d7c1a34a478ddb58e5ea620f1550 | Python | 15,548 | 416 | # 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... |
3a36a7889c69ecfc610f1a0a24e2bcd86342c0b5a72a6c28c68f345d94689e42 | Python | 15,605 | 426 | import copy
import rdkit.Chem as Chem
import torch
import torch.nn as nn
from rdkit import DataStructs
from rdkit.Chem import AllChem
from .chemutils import (
attach_mols,
copy_edit_mol,
decode_stereo,
enum_assemble,
set_atommap,
)
from .jtmpn import JTMPN
from .jtnn_dec import JTNNDecoder
from .j... |
48052213cdc107e76d8bf286a27248e579fa3dba194bbf787be9fd13f0bb540e | Python | 15,631 | 333 | from typing import Tuple, List
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from tensorflow.keras.layers import GlobalAveragePooling2D, Dropout, Dense, BatchNormalization
sys.path.append('.')
from src.common import get_dict_labels
img_size = 224 # W... |
a6dcf5c17f5325722895099a77495239edad6e0eac9f6105391ce73ba5e97307 | Python | 15,655 | 427 | # -*- coding: utf-8 -*-
"""Define word-based embedders."""
from collections import Counter
from itertools import chain
import io
import codecs
import sys
import torch
import torchtext
from onmt.inputters.dataset_base import (DatasetBase, UNK_WORD,
PAD_WORD, BOS_WORD, EOS_WORD... |
f474818c5543fd12690fd1873590d4bd7b0f9390ca74cc187280e0332af41a66 | Python | 15,675 | 417 | # 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... |
87e5e824f37c59e71d859d8dd07d70b228184ac7946dcf7116b1f0947dfa57cf | Python | 15,689 | 550 | # 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... |
7708eff7864f132524e1b4de2366e09784fcebfd0ed089858e7f873234c5b62c | Python | 15,743 | 417 | # 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... |
5210ec22015b1ae5953b8460c08c284f7208f7fb590a2dab5db5347e5a29fd5e | Python | 15,762 | 485 | # 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... |
f36890619c24917c97bca60c790f5fceae194c61e2d9d706465359207d55cdc3 | Python | 15,809 | 454 | #!/usr/bin/python3
import math, os, pickle
import pandas as pd
import numpy as np
import sys
sys.path.append("..")
import utilities
from style import style
from prediction.neural_network import prediction
def load_fit(clf, framework, direction, opt_epochs=500, train_epochs=1000, path=""):
if clf == "lr":
fit = ... |
d4dd0811168d032e94f8225ff1a785778ccb310c7ed28b4138880ea9f806b78a | Python | 15,816 | 434 | # 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... |
369cd7e07eb412713d448b104e8486f03b9b9ab1c69a81ca18ed61a3c812affb | Python | 15,829 | 389 | """
This is the loadable seq2seq trainer library that is
in charge of training details, loss compute, and statistics.
See train.py for a use case of this library.
Note: To make this a general library, we implement *only*
mechanism things here(i.e. what to do), and leave the strategy
... |
ad96791e0b7ebf24340cf646786676747f636c2ff46c685d18b98529478b0620 | Python | 15,832 | 335 | import os
import numpy as np
from matplotlib import gridspec
from matplotlib import pyplot as plt
from rpy2.robjects import pandas2ri
from rpy2.robjects.packages import importr
from margrie_libs.signal_processing import mat_utils
stats = importr('stats')
pandas2ri.activate()
N_BINS_PER_SECOND_PSTH = 4
class E... |
42a21c77e75dd2a29ae80728bb9e52f5b9c78b220a83fd215cdcbf75b15bacaf | Python | 15,894 | 421 | """
Provides classes that can run a function in another thread or process and
allow passing data to and from the threads/processes. It also passes on any
exceptions that occur in the secondary thread/sub-process in the main thread
or when it exits.
If using a sub-process and pytorch Tensors are sent from/to the main
p... |
03c25ce1b406d0ef6af970fe16dc928063e2655d4e56910cd19b39fcca42e0f9 | Python | 16,083 | 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... |
aa16d337885fb273b31fd409235d299da4b5a74a73df4e061d3a00ddebed5187 | Python | 16,105 | 428 | # 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... |
3bf0576e7ca4e2296e02bfe1bd93a59fb5a0e760e2c78fb9f17117b5bd20f447 | Python | 16,106 | 520 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on March 29 2018
@author: kushal, daniel
Chatzigeorgiou Group
Sars International Centre for Marine Molecular Biology
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Just a bunch of generalized classed for image acquisition, preview, and writing from Hama... |
f070c0837e1c2a7f53ce4499af8e8b2e799458c9d823ed970cb10208124364f5 | Python | 16,139 | 392 | # 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... |
06987965de90dc9f66f89cf448ff66ee9094daaa2e96006b503376c9c90f44ae | Python | 16,171 | 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... |
1be428bd1cdc23cd8eb442f651f990e94aa92d473f89447b6d3fc08f3e82b5dc | Python | 16,283 | 424 | # 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... |
2fc7242efd5f026573f95b5a960f744549dfe3c67d492d5d28b577f8ab374c53 | Python | 16,312 | 402 | import os
import warnings
import numpy as np
import pandas as pd
from margrie_libs.margrie_libs.stats.stats import paired_t_test, wilcoxon
from scipy import signal
from rotation_analysis.analysis.block_plotter import BlockPlotter
from rotation_analysis.analysis.event_detection.detection_params import Detec... |
daa4c66b55b5bcfd6d66821f6cdcad61b7b7784244e3d8e25ec3fcfac2fecc54 | Python | 16,312 | 386 |
import glob
import os
import sys
from PIL import Image, ImageFilter, ImageOps
import sa_library.datareader as daxspereader
import numpy
import subprocess
from scipy import misc, ndimage
import re
import sa_library.arraytoimage as arraytoimage
import sa_library.i3togrid as i3togrid
import math
import time
import yaml ... |
d8d427df0aa939ca0898307f0a90aa3a91a58d1c461d5b229a9d81eddf7a8439 | Python | 16,340 | 482 | # 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... |
006244c2a597b2b7aa4e52b972093f63038ac947a1a985a321defb52ed810fc3 | Python | 16,342 | 482 | # 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... |
8782a5fb255b0443702a814e3777ff01c8a25fc06c28b31096932a94e01ef4d2 | Python | 16,347 | 377 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 24 01:58:15 2019
@authors:
Luz Santamaría Granados (luzsantamariag@gmail.com)
Juan Francisco Mendoza Moreno (jfmendozam@gmail.com)
"""
from sklearn.metrics import confusion_matrix, accuracy_score, f1_score
from tensorflow.keras.callbacks ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.