sha256
stringlengths
64
64
language
stringclasses
28 values
size
int32
1
491k
lines
int32
1
23.2k
content
stringlengths
1
200k
eb09f211ea9a4c97cee20bec5fc97085cbf11bad9ee11f9313635d88f7893f59
Python
6,934
211
# 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...
8c82de8df4b00eb694daa45f286cf9b58690f1afcc0007a2a32b700baa2c4b64
Python
6,935
220
# 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...
f12876abd28f86e61957bbb2330bdf1c55fd085b3da1cbc74c01402c7b23a173
Python
6,944
166
#!/usr/bin/env python3 """ Download one end-to-end evaluation corpus, or one shard of it, from the Hugging Face dataset. The dataset holds one directory per corpus and, under it, one directory per article (see doc/End-to-end-evaluation.md). Articles are sorted by name and dealt round-robin, so the shards of a corpus a...
d53f240ab3a795b1e93faa4ff3a55c616ba7a41f071c73c1b8813f9143e9570c
Python
6,948
182
# Software License Agreement (BSD License) # # Copyright (c) 2012, Robotiq, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyr...
2f92dabd2a0072300e778730dd3f965e40fa96132612864aced6204a603f08dd
Python
6,956
252
# 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...
c44cb703c57b57848c9724a4994d861a6cc730e8c6951d13b5e22906f7821049
Python
6,957
252
# 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...
4d9f20c46039c53ae2ba6703bb9a394ac79ef956035dbe1c2d054a6fd9ce8133
Python
6,967
183
""" Simulate some data from GP to test methods and evaluate errors. In this case, the fitted GPCSD model does not match the generating model form. Results are described in paper Supplement. """ # %% Imports import matplotlib.pyplot as plt import autograd.numpy as np import scipy.interpolate import scipy.stats from g...
d75eea7620cacbf2aa39dd5db1816099716a2c10643bf9b67b035dd7072b1c82
Python
6,974
215
import numpy as np import random import networkx as nx import math import matplotlib.pyplot as plt # only required to plot from enum import Enum """ Generates random graphs of different types of a given size. Some of the graph are created using the NetworkX library, for more info see https://networkx.gith...
0605031ec93d955a520142296a1fb980dd6e90cb4389c0f02c41ff6518260601
Python
6,977
184
# 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...
b08f248cca89749e878a5d019ecb2d4800c8514145cf944e1f547200ef82abec
Python
7,012
188
""" Simulate some data from GP to test methods and evaluate errors. In this case, the fitted GPCSD model does not match the generating model form. Results are described in paper Supplement. """ # %% Imports import matplotlib.pyplot as plt import autograd.numpy as np import scipy.interpolate import scipy.stats from g...
95067e12ce693d67d0e9e332d87e90942e1890a378514b98ac401e7be0aedfa5
Python
7,013
180
import math import os import h5py from Bio import SeqIO from tqdm import tqdm import seaborn as sns import pandas as pd import matplotlib.pyplot as plt import numpy as np sns.set_theme(style='whitegrid', rc={"xtick.bottom": True}, font_scale=0.9, font='Verdana') plt.rcParams["figure.figsize"] = (8, 4) plt.rcParams['...
b8214a4afe922e0f56bc22501b60d391708f5f819aafd33ca715b399ca7aa1ac
Python
7,016
180
import math import os import h5py from Bio import SeqIO from tqdm import tqdm import seaborn as sns import pandas as pd import matplotlib.pyplot as plt import numpy as np sns.set_theme(style='whitegrid', rc={"xtick.bottom": True}, font_scale=0.9, font='Verdana') plt.rcParams["figure.figsize"] = (8, 4) plt.rcParams['...
dd5ef0d77828cebc3812eac6db7b6e218a2ee3a78b38f6a9a3dbb23e7eafa7d4
Python
7,018
184
# -*- coding: utf-8 -*- """ ************************** The image_providers module ************************** This module provides subclasses of QQuickImageProvider to be used in the GUI module The classes of this module supply sequences of images to the QT interface :author: crousse """ import numpy as n...
678170a563ab6baab0b742fb83accef781a0005f5e2a461ec697ecd0dc18c019
Python
7,021
211
# 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...
4748a0fa8fb28f9aae6637ab37a1afc3b23245531cc090501f7c959348a2a6eb
Python
7,034
180
import numpy as np from spike_handling.cluster import Cluster import pandas as pd from rpy2.robjects import pandas2ri from rpy2.robjects.packages import importr pandas2ri.activate() rstats = importr('stats') class ClusterStats(object): def __init__(self, cid, stimuli_struct, rates=None, labels=None, s...
0eb32847ac05b1d908fba088752e4591d036beed44a63b05867c04bc2c63a785
Python
7,037
259
# module import import sys import time import numpy as np import functools from PyQt5.QtCore import Qt, QTimer from PyQt5.QtGui import QFont from PyQt5.QtWidgets import (QProgressBar, QApplication, QDialog, QVBoxLayout, QPushButton, QGridLayout, QGroupBox, QLabel, QStyleFactory) ...
22f7460d92aa7e013f49e22be88d2f8da9ff7a4720f0438d0bbf1dc13d6c4398
Python
7,055
230
# 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...
140333aa96c9f549f74df861cf6016d285e81f2284b09f1a882560a63e606a0b
Python
7,058
207
# 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...
466dd9d7d0e37ccea233058b03ed7d17dd43101adc02b94f7353d8a192e38579
Python
7,062
233
# -*- coding: utf-8 -*- # @Author: Weiyue Ji # @Date: 2018-10-19 00:59:49 # @Last Modified by: Weiyue Ji # @Last Modified time: 2020-10-04 07:00:28 import os import numpy as np import pandas as pd import settings as settings # ================= printing ================= def print_to_log(info): """ Function: P...
960adb2f3f484d2a46460afe268ad12c1a6b0b0ac8592f8681b117e0ddcabd37
Python
7,070
203
import plotly.graph_objs as go import plotly.offline as py import pandas as pd, numpy as np import networkx as nx import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import seaborn as sns from PIL import Image import dask.array as da from os.path import join import argparse from skimage.io import im...
b522e170d3622076840e67264654f08a8e4225b18ca72c37b5732d5763ee5758
Python
7,079
230
# 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...
b414da098972df5ca269c260f1fba0a74acf5b90ed54c61fd8bca00471b6f60d
Python
7,090
166
import copy import numpy as np import torch from torch.utils.data import Dataset from .preprocess_input_data import MASK_CHAR, PADDING_CHAR, CLS_TOKEN, ENDING_CHAR class RandomMaskingDataset(Dataset): def __init__(self, ion_data, de_mod=True, mask_modifier=True, mask_ratio=0.15): self.i...
b7a4e6fe08d08a0755d0d7ee64f1056e2018283a0c844f82789395ef0971b2c1
Python
7,127
215
import matplotlib matplotlib.use('qt5agg') matplotlib.interactive(False) import pandas as pd from PyQt5.QtCore import QObject, pyqtSlot from analysis.probe.probe_io import metadata_db_io from matplotlib import pyplot as plt class Logger(QObject): """ A qml object for logging the events In ...
43843d18e369a59bcc4dc99daadc8c9147af1a52f853e1f261a3471dc383e462
Python
7,152
194
# 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...
b10e1b8e5d27f7dfd221681b90ee6eaa26d45221a2b94ef1a074e2c133364dba
Python
7,157
189
import json import yaml import argparse from pathlib import Path from typing import Any, Dict, Optional from evaluation_utils import ( DocumentEvaluationResult, EvaluationMetrics, NormalizedCache, resolve_entity_category_key, resolve_entity_label, ) from data_adapter import adapt_legacy_format from...
1d3a78657ba4f1d35f8e2ff2a2056fc88bb325648c97945b5124c12fedac03ba
Python
7,166
199
import argparse import numpy as np from sklearn.metrics import mean_squared_error import deepchem as dc import matplotlib import joblib matplotlib.use('Agg') import matplotlib.pyplot as plt parser = argparse.ArgumentParser("Evaluate Machine Learning Approaches for Modeling Elution Times") parser.add_argument("mod...
a1e8da0d0d908ce0163032f75aae52fb4b0500badfe1ddf4a001ad1080c09158
Python
7,167
256
# 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...
9844b8b31b39d36a798e154a9da94cd5b9858b12639cfe40bfa40024019c5a0a
Python
7,169
204
# 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...
f6daa1ba0578794bd86bc001f1a6f58b0a1909fda23ad44fb92d90445d2dcefa
Python
7,175
218
# coding: utf-8 # In[1]: """ inference_patches.py This scripts tests a SegNet model . Args: the weights (.caffemodel file) to use and a list of paths to images """ import matplotlib.pyplot as plt import numpy as np import sys from skimage import img_as_float, io import itertools import argparse from config ...
e486ca838d8bcf8dc853e9fb4bb6e38fda87c43679f586e2c65f8c30ccf221c3
Python
7,195
262
#!/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 click import cv2 import matplotlib import matplotlib.cm as cm import matplotlib.pyplot as plt import numpy as np i...
0e19acf1fecf76d8312db314e76c3e2a2642c12317470713b6d88d936a350833
Python
7,199
220
# 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...
2926b3c0afdfef95c96f94eca29f80536e1483867e71962493cee7e08ac67414
Python
7,201
292
# 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...
6997886ad8a60cca211dab22e039f2431e369e6a53d1e387c3460caa58d6fe91
Python
7,208
209
#!/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 click import cv2 import matplotlib import matplotlib.cm as cm import matplotlib.pyplot as plt import...
afd8a0458a443cf9f94dbf9f26af76dcf33b77a180b8c91f320771645b4671e3
Python
7,210
268
# 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...
d6cea34d0a7f3105ef2b7384eb140e1fea6655825ba2df122eaa49ef57e7e041
Python
7,214
255
# 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...
84a1b1191a2f21a4a35e4ae1a5d2f9481f7009fa60207eff2b3e6edfa896d8f8
Python
7,234
189
import tensorflow as tf from ..utils.bbox_transform_tf import decode, clip_boxes, change_order def RPNProposal(rpn_cls_prob, rpn_bbox_pred, all_anchors, im_shape, nms_threshold): """Transforms anchors and RPN predictions into object proposals. Using the fixed anchors and the RPN predictions for both classif...
934e51288c54426060597efcb693b801f285a159f53a2755c96d3d26bbbda227
Python
7,268
218
import numpy as np import math from imlib.general.numerical import get_decimal_places, round_updown_to_x from imlib.general.parsing import check_none def get_bins( nums, bin_size, deal_with_decimals=True, min_val=None, max_val=None ): """ :param nums: Array of numbers to create bins from :param bin_s...
1ee124ca948e7a56cd2fa84a0bb4a21374337d95b4a8edf1b08d7b50f9a11626
Python
7,301
108
import argparse import yaml from models import * # For loading classes specified in config from torch.optim import * # For loading optimizer specified in config from torch.utils.data import DataLoader from torchvision.transforms import transforms from datasets.embeddings_localization_dataset import EmbeddingsLocaliza...
b10bc6445e729ae734624b14f892a09dc50b8809df76c440869208fc402fe74e
Python
7,301
173
# -*- coding: utf-8 -*- """ Created on *** @author: *** This model has 153400 paramters and "Median Quantization" strategy(weight:ternary {-1,0,+1}, active: quantization level = 1, upper bound = 2), training epoch is 200 epochs, you can restore from corresponding checkpoint by setting flag "resume = True", the final...
371376f99e15df4233d6ff8249f68f4a7df4a0629d188558318b25d47ebb33dd
Python
7,305
234
# 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...
04f3ae9d6bf0d1747ddc0af8dae33b129827dc31a4b81f132d3c61899a423d6f
Python
7,309
193
# 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...
42a4fee79cc0cb21c1a53abbb70aadec5e05772e9fb20e16841e87c7ee4e335f
Python
7,313
226
'''This code fit an HMM model to choice sequences (2-armed restless bandit) for a single session. The HMM model is 1. parameter-tied 2. reseeded (random initial T matrix) 3. fixed emission matrix, 5. fixed initial distribution. 6. optimization based by observed log likelihood and side criteria is Tmatrix[0,0] and [1,1]...
4f03e579a39006b897a8635896b8ae69f407a2530cbc602197e2532dc499acab
Python
7,315
188
# 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...
add39a130a245be32ac2b16a4f4bf8dc118be513dab096b0e75438c392b8ce42
Python
7,318
195
import numpy as np from scipy.optimize import leastsq, curve_fit from tqdm import trange from matplotlib import pyplot as plt from margrie_libs.margrie_libs.signal_processing.mat_utils import find_sine_peaks def crossing_idx(trace, a, b): _crossing_idx = np.where(np.logical_or(np.logical_and(a <= trace,...
c71306ca0de42bd631c97b8334ba5adbbfed5ae60263d6287a6bbf4aac15a905
Python
7,320
255
# 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...
292d95cbeaf1dddd9cf2430dfa83f31339b1b8983c8f1c9acd903a4cf31f0a7d
Python
7,323
168
import os from argparse import ArgumentParser import numpy as np import pandas as pd import shutil from matplotlib import gridspec from matplotlib import pyplot as plt import sys try: from src.utils.utils import shell_hilite except ImportError: from utils.utils import shell_hilite sys.path.append(os.path.jo...
72c7c35676f6d820ef09e1978057766273ecebba673713e97c6f43c437517b6f
Python
7,335
245
# 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...
b24d29614818bf87bb10087e1d81c00f1d4e1de2db37975bb5851fbfd080cc59
Python
7,337
166
import threading import time from Queue import Queue import cv2 # Import OpenCV2 #from opto import Opto # Import modules provided by optotune import hamamatsu_camera as hc import os import numpy as np import multiprocessing #TRY TO REPLACE THREADING WITH PROCESS: http://stackoverflow.com/questions/323972/i...
f260d228608d8fbff80ee5baf7d73c1013a70f3e50a7b3ba0a928d1d9f5ca24b
Python
7,352
165
"""Private helpers to validate the data and hypnogram passed to YASA functions.""" import logging import mne import numpy as np from .hypno import Hypnogram from .others import trimbothstd logger = logging.getLogger("yasa") # Units used when extracting data from a MNE Raw object (MNE stores data in Volts) UNITS_UV...
c312c8fdd97fddd96312712510c245bb85a913888a00ad2aadfe0cea7e58f3d7
Python
7,355
187
# 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...
3f9a0d41ab4b41d2b0aad2c3611746dca4f57833adbb9bd71154ca73d2f5f66d
Python
7,357
141
import matplotlib from rotation_analysis.analysis.probe.ctxt_manager_decorator import temp_setattr matplotlib.use('QT5Agg') import os import matplotlib.pyplot as plt from dateutil import parser from tqdm import tqdm from rotation_analysis.analysis.probe.probe_io.probe_io import TriggerTraceIo, Bonsai...
bca11c534ef32ec852a3ce1f43c14ee16dd13a1d4a1693bd5e269181034ea996
Python
7,369
191
"""Reproduce all outputs and figures of the "Evaluating a Sleep Tracker" tutorial (evaluation.rst). Usage (from the repository root, requires scipy >= 1.15 for the seeded bootstrap): python docs/tutorials/evaluation.py [--local] [--outdir DIR] By default, the SRI sample data is downloaded from GitHub, as in the ...
920b3bb1529b7179dd99c1106dcaba1c639c8985b4c7ded575a4c7a184acc31b
Python
7,378
256
# 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...
497c611f03240e2977c72d18ea96dbee013316aaaa29c8201df6f6c53e009fbb
Python
7,383
201
from typing import Callable, Tuple, TypeVar import jax.numpy as jnp from jax import jit, lax, random from jax_md import dataclasses, quantity, util, space Array = util.Array f32 = util.f32 T = TypeVar('T') ShiftFn = space.ShiftFn InitFn = Callable[..., T] ApplyFn = Callable[[T], T] Simulator = Tuple[InitFn, ApplyFn] ...
475d5bcb098a3e97d1e06b19afd31b7142dc599948dfa9164fbeac07a7d53af6
Python
7,386
231
# 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...
a635d8c6dbd849d1c40cbdd177987dc2a3458e1491fb02422297f1e81e6539fc
Python
7,395
250
import logging from fancylog import fancylog import pandas as pd import numpy as np import os.path import sys from imlib.general.system import ( get_num_processes, ensure_directory_exists, filename_from_path, ) from imlib.pandas.misc import move_column_first from imlib.general.parsing import convert_string...
4f6aa470189f2486fe366db55fad446680f6f5e9519bba38312b0cc46a32e3a1
Python
7,442
229
# 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...
e44ddb4df52f9c8429e3336f5ebeccb042ee9ef281c6a36b56adbbf95620836b
Python
7,444
229
# 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...
dd4de485008beb37683e057cc9ce128a5575a1061276f945b2b5a44963741121
Python
7,445
201
import threading import multiprocessing import time # from Queue import Queue import cv2 # Import OpenCV2 import tifffile #from opto import Opto # Import modules provided by optotune import hamamatsu_camera as hc import os import numpy as np import sys import json import datetime import pyqtgraph as pg ...
ef6b16e716ef26bd6304c1f379ba685b7a54f705367a74a17ca7f2c32b9f4775
Python
7,463
258
import numpy as np import tensorflow as tf class SquashHinton(tf.keras.layers.Layer): """ Squash activation function presented in 'Dynamic routinig between capsules'. ... Attributes ---------- eps: int fuzz factor used in numeric expression Methods ------- call(s) ...
3844b383f6c8c343d1a6e7e4aa13803997eb0e0ce9a24e4a574e9f5ea393452d
Python
7,482
257
# 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...
f7e76299c1c40c17bd01f749e252f29222e96153ada67d15cf84105c4ec08ada
Python
7,506
203
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generates figures depicting pipeline distributions + parameter impact """ from pathlib import Path import matplotlib.colors as mcolors import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.utils.extmath import random...
424a1f2493d863a460b4131b1fe56409092a441c11d3309a9bd893115074a866
Python
7,511
230
# 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...
c790ec0a1a2ab24db0dcfdd18172a8fccd14a30e69822f3a18816d345ba96a30
Python
7,534
245
# 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...
23b73e38f7861300cf2611bd8033d3615aecee9c132b7278581cffac678bdff6
Python
7,549
225
# 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...
f59f901710efb2b144c87a9c3688d54d9c60d5e4d9aa120053ddf1a288d0fb64
Python
7,556
160
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'frame_range_dialog.ui' # # Created by: PyQt5 UI code generator 5.10.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_Dialog(object): def setupUi(self, Dialog): Dialo...
f1f8f7bad091a83bba6123c2f947ac8fcc4718beaecfae5a8c3a12a9f4c66c25
Python
7,563
187
# 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...
645935b9f6a349c729977d91537229ea5f0b5901178e1e41d83739e6f6b85c9f
Python
7,590
232
# 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...
0f47713b105bb52893158eb853df8ab7f26f622e7e60843ccd7581fdad9291d3
Python
7,596
224
# 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...
1735bc7fbf67aaa6c0209b32f72e474c03d7652861edae445f9cb801924752eb
Python
7,624
242
# 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...
3c6b9bdd072ee94841918ac079e371c25512389afb18853c0e85fc43ff14035a
Python
7,628
179
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)...
8198a79a28c8b87b9a4b8ed9c12042d8e605c504bbe7cfa23538813fd6b784de
Python
7,645
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...
48d2c73d3df103ee591071287f41ab8b4002cd1bc5182d2c577fad85f7dbd414
Python
7,649
229
# 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...
bf7d2ef814f8f8f136b0d2d799baca970b830d96fed264689a548fd3ca3be903
Python
7,660
207
""" Embeddings module """ import math import torch import torch.nn as nn from onmt.modules.util_class import Elementwise class PositionalEncoding(nn.Module): """ Implements the sinusoidal positional encoding for non-recurrent neural networks. Implementation based on "Attention Is All You Need" ...
337acc93b9e5cdf285b7d23af1a7dae6576ea755925313ff91256e7c51cff947
Python
7,670
218
# 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...
435ce143c91c7070de4d1860176f9648a71f02b3fc2aa13dba3ca92652ea5077
Python
7,671
147
import matplotlib from analysis.probe.ctxt_manager_decorator import temp_setattr matplotlib.use('QT5Agg') import os import matplotlib.pyplot as plt from tqdm import tqdm from analysis.probe.probe_io.probe_io import TriggerTraceIo, BonsaiIo, IgorIo from analysis.probe.probe_field_of_view import ProbeF...
2d0fba71cea29de5d696ad28d14cd318fee8271c80a0e2b1cebde98b30649d7c
Python
7,674
182
# -*- coding: utf-8 -*- """ Created on *** @author: *** This model has 153400 paramters and "Median Quantization" strategy(weight:ternary {-1,0,+1}, active: quantization level = 1, upper bound = 2), training epoch is 200 epochs, you can restore from corresponding checkpoint by setting flag "resume = True", the final...
8925a99f9dd959dd01a1b85dd39eee2f8954c0feef079a5e67d482e139a21859
Python
7,680
181
import re from typing import Union from deep_phospho.proteomics_utils.constants.enzyme import Enzyme from deep_phospho.proteomics_utils import rapid_kit as rk class TED(object): def __init__(self, miss_cleavage=(0, 1, 2), min_len=7, max_len=33, enzyme='Trypsin', return_type='seq', extend_n=False): """ ...
1385acc72bddaf1e9a7da6255019a349ae1819ec812dbfa46129a13262d04199
Python
7,688
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...
41d24990e17a233f885a4b1e37dbb2af46f6f1e2fbc76d34194601a70d838387
Python
7,691
90
#!/usr/bin/env python # coding: utf-8 import glob import os import json debug = False selected_neuron = 1 # switch to neuron 0 if required adaptive_relevance_scaling = False # fixed relevance score adjustment to range: abs(relevance)~=[0,1] if set to false, otherwise scale depending on min/max scale_factor = 2.5 #...
963112237921109926b2b99c8028a1fefa5877e06b052d5ce5358ff2dcad8d79
Python
7,702
227
""" Global attention modules (Luong / Bahdanau) """ import torch import torch.nn as nn import torch.nn.functional as F from onmt.modules.sparse_activations import sparsemax from onmt.utils.misc import aeq, sequence_mask # This class is mainly used by decoder.py for RNNs but also # by the CNN / transformer decoder whe...
657b1cd9a8a3db1ded27f0580c227a6231c3e61b6eb2f5f8c858395e6ed10382
Python
7,707
290
# 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...
fd69a181413c07f05b4c11822cbf0b9d66ca1f678553b7be5e920f7e4f5ec7bf
Python
7,713
180
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...
2ad57adc646b48b7387f80d752bf10078d287009d8a24a39644007509595e299
Python
7,732
195
import numpy as np import pandas as pd from matplotlib import pyplot as plt from rotation_analysis.analysis.probe.event_plotting_functions import plot_raster, plot_histogram from rotation_analysis.analysis.probe.probe_block_plotter import ProbeBlockPlotter from rotation_analysis.analysis.probe.probe_events_colle...
d8dfee2fe044a28c96a5d5a8e36ea25aae56381f7e1226d6be1eb6c6646fc73f
Python
7,737
167
#!/usr/bin/python # Preprocesses tokens describing mental functions from the following ontologies: # (1) Cognitive Atlas (Behaviors, Concepts, Personality Traits, Tasks): http://www.cognitiveatlas.org/ # (2) BrainMap (Behavioral Domains, Paradigm Class): http://brainmap.org/taxonomy/ # (3) Cognitive Paradigm Ontology,...
e849d0f264a4d72c878b23838fcb209c33a2e383ac4da8db3260ad1b20c4ebb3
Python
7,743
251
from .normalization import whole_image_norm, foreground_norm from tqdm import tqdm from os import listdir from PIL import Image import numpy as np from scipy.ndimage.measurements import label from scipy import ndimage import copy def list_files(directory, extension): return [f for f in listdir(directory) if f.ends...
9fee02e48357c426d47dc5036e7b76c0d5fdcdd3b773a45b936b6462eac83438
Python
7,752
215
# 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...
c7ea0bd9d3db3447a01167eadfc42bc1fadac70e1890d95f96ea01beaef60ba2
Python
7,761
191
# 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...
ab522e954bd91aae0b98a143ea5155124be431226554fe51c78490a80014b70e
Python
7,849
185
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F 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, plot_regression, plot_classificatio...
6c2b48bbbd998c2af94bc4c9758aca99d574218d3538ad599136f88dc6409a08
Python
7,869
198
import Tkinter import LivePreview import ImageStack #USE PROCESS QUEUE AND IF QUEUE IS EMPTY DIPSLAY PREVIEW, ELSE QUEUE.get() AND APPLY THOSE VARS! #SliderVal = Queue(maxsize=0) #class PreviewWindow(threading.Thread): # def __init_(self): class guiMain(): def __init__(self): self.master = Tkint...
2b09129fceeb4965308600fb7e45c3ed41afbc61477caea73882e5b540c64914
Python
7,876
221
# 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...
d3f15913970d6f9682f40bd1d48e583459238cf7521b325c1ab484c9afc7f6e2
Python
7,892
214
# 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...
58332c299d12d9c468a957bfdacc529ffc83810e48b3c65ed398f9541d5bf355
Python
7,896
229
# 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...
34bd74f021ededc3cbc516875eead4747872fcefab34d599ec31cb5f24c6e6b5
Python
7,897
219
# 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...
fd2e0713096940e84a07b9c0a0fe19f31eda27b2dcdaa6469682facd1108908d
Python
7,907
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...
c98b3739595dd0952f40bdc14ff2779e28c63f9a7486d7b24bc3658d39ded4f5
Python
7,913
214
import numpy as np import logging from imlib.radial.distributions import vonmises_kde from imlib.array.misc import sanitise_array, weight_array from spikey.histogram.radial import radial_spike_histogram_multiple import opendirection.spikes.tools as spike_tools from opendirection.combine.clean import clean_df class...
99558977fbed20f3d4899df6ec241fb035d9e06428ebbae4e40d8ebd2c3c2728
Python
7,922
223
# 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...
0689a9f600854d19fe51bdbf1ab236b3dfea53e3e25bb7b5835e8a9dbec1398d
Python
7,923
188
import os import sys import pickle from argparse import ArgumentParser from collections import OrderedDict from zipfile import ZipFile if sys.platform == "win32": sys.path.append(os.path.abspath(os.path.normpath('c:\\Users\\Administrator\\Desktop\\sepi_rotation_analysis_steve\\'))) from analysis.cell im...
59aec51ebb7e0c445cf82456b130ffd3c738f3f82a90f5c3fdf034c7a6e3c1aa
Python
7,928
229
# 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...
8d1da8587d66d778431b9feb8a91fdb608a9b77521e5c1c45f0ff79195ad9c57
Python
7,937
257
# 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...