sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
68cb283053a0fe44e16d91fe6b08ef5b9ab1c27003a020f551f5bf5e85cd05ef | Python | 5,063 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/crowdpose.py'
]
evaluation = dict(interval=10, metric='mAP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='linear',
... |
95f57b22053ec49011ed3cc352540ac9c2d1f1cfcc10771cab7fb80d93b3a26d | Python | 5,063 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/crowdpose.py'
]
evaluation = dict(interval=10, metric='mAP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='linear',
... |
99b926c04104372c0d4ac5a3ae02ab5ab85d8730142c7280055f715549cb77d8 | Python | 5,063 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco_wholebody.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
... |
9a30d90586369577a08271a865eea799a48dca281b50e1a23995f83d77c6a08c | Python | 5,065 | 172 | """
Simulate pydentate with grid cell inputs on linear trajectories.
This is one of the most computationally intensive steps as it generates
all the raw data that is used for the perceptron, tempotron as well as
CA3 analysis. It allows for reproducibility through a variety of seeding
steps.
"""
import shelve
import c... |
d8b8a0e76caddfe1a08ce25c61ae51bdb33ddae4b1665ad5af323e7b29658ece | Python | 5,065 | 141 | import numpy as np
import h5py
import importlib
import stringcase
import scipy.ndimage as ndimage
import cv2
from skimage.transform import resize
from fedml_api.data_preprocessing.my_transforms.compose import Compose
def init_transform(transforms, transforms_args):
transform_instances = []
for module_name in ... |
84ffd91e00b8529898d8e37fb9d65a03e7fc4596f752a175cd4beefdff73f334 | Python | 5,066 | 139 | from copy import copy, deepcopy
from transformers import TrainingArguments, IntervalStrategy, EarlyStoppingCallback
import os
from os.path import join, splitext
from model.torch_models.bert_cnn import CNN_Over_BERT
from model.torch_models.bert_linear import Linear_Over_BERT
from model.torch_models.bert_rnn import RNN_... |
f435fe7ea51bd2116e9c445383e6fc841e9722ec74a71f31e7a8e9ddf815c5c3 | Python | 5,067 | 106 | ############################################
# imports
############################################
from joblib import Parallel, delayed
from joblib_progress import joblib_progress
from oligo_designer_toolsuite.database import OligoDatabase
from oligo_designer_toolsuite.oligo_property_filter import BasePropertyFilte... |
01bf1d9a9a96279898f4dfcd65164306e22c0b26ef40dc93e9aea522323105fe | Python | 5,069 | 173 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/deepfashion_upper.py'
]
evaluation = dict(interval=10, metric='PCK', save_best='PCK')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',... |
9f439eda920be324b250ad270cb6296f2a7006066ef8799645b90c22a9a050e3 | Python | 5,069 | 173 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/deepfashion_upper.py'
]
evaluation = dict(interval=10, metric='PCK', save_best='PCK')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',... |
1c69a6b9b54565d8cb7dbbe52670a64c36b97cc28f87c8bccab70eb16e029eda | Python | 5,070 | 135 | from semquery import SemEHRES
import utils
import json
def get_doc_by_id(p, doc_id):
for d in p['articles']:
if d['erpid'] == doc_id:
return d['fulltext']
return None
def retrieve_doc_by_id(doc_id, es, index_name='epr_documents', full_text_field='body_analysed'):
d = es.get_doc_detai... |
f32e8e1282d84fb0ad7fd0622e0ce5f410fc09c3a75c9f1ed7f59bc07f19efb4 | Python | 5,070 | 164 | """
The main training script for training on synthetic data
"""
import argparse
import multiprocessing
import os, time, glob
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from .dataset import Dataset
from .network import Network, normalize_input, unn... |
b4a69d4cac0f50449a2f5a661e96955e54a12c3d70fbc32daf8fa083fa1ca519 | Python | 5,072 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/halpe.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_384x288_dark-741844ba_20200812.pth' # noqa: E501
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type... |
024900ef4aab0c24b1a9c0b750b85cbba0d0d09215ee3505e84eb942e38c3455 | Python | 5,073 | 139 | from copy import copy, deepcopy
from transformers import TrainingArguments, IntervalStrategy, EarlyStoppingCallback
import os
from os.path import join, splitext
from model.torch_models.bert_cnn import CNN_Over_BERT
from model.torch_models.bert_linear import Linear_Over_BERT
from model.torch_models.bert_rnn import RNN_... |
1bb63cf2f00b94e8cc2b62000ad9afedc1f9d58dd4a036c10f55704af9d78914 | Python | 5,073 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/onehand10k.py'
]
evaluation = dict(interval=10, metric=['PCK', 'AUC', 'EPE'], save_best='AUC')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
polic... |
1517ca6ce879738f15f1660968de8f5c066d7e37b15068a5a33c978efb25a4f5 | Python | 5,074 | 173 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/deepfashion_full.py'
]
evaluation = dict(interval=10, metric='PCK', save_best='PCK')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
... |
f90ab04afa659bd9609e335ec57dc400bc87f15d350bb758a61901619b95e8a5 | Python | 5,074 | 173 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/deepfashion_full.py'
]
evaluation = dict(interval=10, metric='PCK', save_best='PCK')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
... |
9792fad6df88cb9919c7805fc6ccbd04c97c8687936c62e8edd7ee185147eee7 | Python | 5,075 | 139 | from copy import copy, deepcopy
from transformers import TrainingArguments, IntervalStrategy, EarlyStoppingCallback
import os
from os.path import join, splitext
from model.torch_models.bert_cnn import CNN_Over_BERT
from model.torch_models.bert_linear import Linear_Over_BERT
from model.torch_models.bert_rnn import RNN_... |
4f662d5e325a9b6cf8bbbd60412028ae24b9c16df31cb89d01917dafba6637b3 | Python | 5,079 | 84 | from keras.layers import * #For adding convolutional layer
from keras.layers import Dense, ZeroPadding2D, BatchNormalization, Activation #For adding layers to NN
from keras.models import * #for loading the model
from keras.backend import stack, squeeze, expand_dims
from utils import ... |
e97699deb2dfb00349a925e0ef37f57552cdee5687ecab5a988653af367d01fd | Python | 5,079 | 150 | # Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import ConvModule, DepthwiseSeparableConvModule
from mmcv.runner import BaseModule
class DarknetBottleneck(BaseModule):
"""The basic bottleneck block used in Darknet.
Each ResBlock consists of two ConvModules and... |
3d7100b6ac7c74b1d174fbd3453b6421586aad5f19a6c312213b27cb43f97ab2 | Python | 5,087 | 137 | import platform
from time import time
import flystim.framework
from flystim.screen import Screen
from flystim.util import listify
from flyrpc.transceiver import MySocketServer
from flyrpc.launch import launch_server
from flyrpc.util import get_kwargs
def launch_screen(screen):
"""
This function launches a s... |
1bca353ac7c929e22cc1c17ea57d73491f67d5c8dab90647d2724aa10f06baca | Python | 5,088 | 173 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/atrw.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
ca6593e13230b2e1ec87084126d0f05910e3f5b5d169b679fc30b06eccdf9116 | Python | 5,088 | 173 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/atrw.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
b2c3d09b187035ed0f578754741d87a644bf87e23e8d381a65ef8f285135ca2d | Python | 5,092 | 114 | import sys
sys.path.append('vdvae')
import torch
import numpy as np
#from mpi4py import MPI
import socket
import argparse
import os
import json
import subprocess
from hps import Hyperparams, parse_args_and_update_hparams, add_vae_arguments
from utils import (logger,
local_mpi_rank,
... |
af62dbd2d61dbdd0ff6db6f0419f4cf5af4a6802cc1342403f823095349e43b4 | Python | 5,095 | 145 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 26 14:24:44 2023
@author: Anandita
"""
import numpy as np
import matplotlib.pyplot as plt
import pickle
import datetime, sys, os, time
from collections import defaultdict
gen_fn_dir = os.path.abspath('..') + '/shared_scripts/'
sys.path.append(gen_fn_dir)
... |
051836d7b97587fc2c54821a40c888d852533238912e2079590d2539e3bb112c | Python | 5,098 | 179 | import copy
import torch
from daart.models import Segmenter
from daart.models.rnn import RNN
def test_lstm(hparams, data_generator, check_batch):
hp = copy.deepcopy(hparams)
hp['backbone'] = 'lstm'
hp['variational'] = False
model = Segmenter(hp)
model.to(hp['device'])
# load the correct ba... |
b1577fe45af7f6d25c9188eccb9c74993ad1afc74b6ae67b08c4d6b389e9db2f | Python | 5,098 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/onehand10k.py'
]
evaluation = dict(interval=10, metric=['PCK', 'AUC', 'EPE'], save_best='AUC')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
polic... |
1f7111c3f2d03a91a983a3ffcd59edde5ebf31811a9e1fb229cb1a847641968c | Python | 5,100 | 145 | #!/usr/bin/env ipython
from pathlib import Path
import datetime
import pandas as pd
from sklearn.metrics import make_scorer, roc_auc_score, precision_score, recall_score
from skopt import dump
from eegml import model as mod
from eegml import toolkit as tk
config = tk.parse_config("config.yaml")
models = mod.parse_mo... |
a55e893df52d5cafd72bab12794667a9c7810c907fa03f584c1887c23179cad1 | Python | 5,100 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
b2384c56499b6dddc1ced9ae9ad599964cd7daf59b1db211bb9975f302871855 | Python | 5,100 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
fae2a3ad8dea09107b3d2853c6ce962f02e3e424d03ddbbc2260f18c7649aba0 | Python | 5,100 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
47d1380c739afb9125a3caf6423b2d6477213283c91f0d22b6268850430b1106 | Python | 5,106 | 139 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
import pytest
import torch
from torch.distributions import Beta, Binomial, Gamma, MultivariateNormal, Normal
from sbi.utils import RestrictedPrior
from s... |
bb515c87a9839f72e2a2b6f2201830280c7e21457e59f201fa464be9b74a37c5 | Python | 5,106 | 146 | import numpy as np
import torch
def get_optim(params, optim_id, lr, amort_lr=None, batch_scale=True, grad_clip=None, weight_decay=None):
if optim_id == "Adam":
return Adam(
params,
lr=lr,
amort_lr=amort_lr,
batch_scale=batch_scale,
grad_clip=grad... |
6eb79fa9f1342749cdac245f1826421ece52ab2454de22bed9dc72e7534df2ca | Python | 5,113 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco_wholebody.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_384x288_dark-741844ba_20200812.pth' # noqa: E501
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(... |
66bc983ba55ec3a0449a68462b54efe25072e22ded37c8fb9d3d5d354988203b | Python | 5,115 | 151 | """test_recurrent_layers.py
This file is part of the test suite for keras2c
Implements tests for recurrent layers
"""
#!/usr/bin/env python3
import unittest
from tensorflow.keras.layers import Input, SimpleRNN, LSTM, GRU
from tensorflow.keras.models import Model
from keras2c import keras2c_main
import time
from test_... |
933612042cf296280cabb0e3ba2ca16a9f7762ff24760f70927b127689f8f29e | Python | 5,115 | 127 | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import torch
from torch.nn.modules.utils import _pair
def mask_target(pos_proposals_list, pos_assigned_gt_inds_list, gt_masks_list,
cfg):
"""Compute mask target for positive proposals in multiple images.
Args:
pos_prop... |
396a8e07cf67595c097ac0e69b8b9cd1ed37e70e82396cba39e723742226addc | Python | 5,116 | 133 | ############################################
# imports
############################################
from abc import ABC, abstractmethod
import pandas as pd
############################################
# Set Scoring Classes
############################################
class SetScoringBase(ABC):
"""
Abstract... |
4512177b491d0460e0cee5053ff4f59ee43422dd7412fd85a347ccbe6f70e284 | Python | 5,118 | 175 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ap10k.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='... |
be328717d1d3af9204682b5a9479bc51b2478b7de71aaaa89824f36c4dee035f | Python | 5,118 | 175 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ap10k.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='... |
40d3229ca4e1260a45e33de3e9f3b093ac81adeb1b2d1202352ad5ce677c19ff | Python | 5,120 | 179 | import torch
from torch import nn
from itertools import starmap
import yaml
from yaml.loader import SafeLoader
import torchvision
dims = '../config/models_dims.yaml'
params = '../config/params.yaml'
with open(dims) as f:
config = yaml.load(f, Loader=SafeLoader)
# batch norm and dropout parameter... |
14a985a4cedf9c91538362be8c09045d1094d79024b93bbd0f1cf0d33f9b4ed4 | Python | 5,122 | 175 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/macaque.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... |
97b57b7489b15cdc985aad8bbcdd42c60ecabc841f464c188a2748215c1961e9 | Python | 5,122 | 175 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/macaque.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... |
09784537e2b5da2adec9884e01c74943934351da25a47d4c57a3c471b5abd808 | Python | 5,124 | 109 | import argparse
from my_tools import *
from create_patient_instance import *
import matplotlib.animation as animation
import matplotlib.pyplot as plt
from matplotlib import rcParams, cycler
rcParams.update({'font.size': 17})
#also saves the percentage improvements needed for RMaps computations
def plot_assessment... |
0229492abc3f39f8ae36dfa730e42232d728b628788a9c28896ab45c936e45cc | Python | 5,125 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
417175bbc71bcae611107336de44b08dd7a3c543c6164cc7f500047005bdf9fc | Python | 5,125 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
54dc35cb4213e2c6aadd1ad28569359d7d508c995f93509a7514d5efe677c5e1 | Python | 5,125 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
a69671612fbdbc8d8c2d10e3d6ea22e63bfcc97239b85c5b11cac9a90c0a7058 | Python | 5,125 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
ae4aa301f9fa1dc8668b1ce6e00debaef92c566e374cd2c7e8e50ad2a618c279 | Python | 5,125 | 132 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 10 13:39:17 2020
@author: nihao
"""
import os
import numpy as np
import codecs
import json
import glob
import cv2
import shutil
#from sklearn.model_selection import train_test_splitimport os
import numpy as np
import codecs
import json
import glob
import... |
812453fee6a86258395eb9cabb915f31e4804d46096024a401d89ea92949c277 | Python | 5,128 | 175 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/animalpose.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
war... |
9980150f9bfe6d3b3c36feae1cf6cf10bae22e586f770880ff77932a7a146826 | Python | 5,128 | 175 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/animalpose.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
war... |
c5c7f3c1798f7188ade36c01bfea1be13755287b79865f43580d5664bfa1189a | Python | 5,128 | 115 | import pandas as pd
from os.path import join
import numpy as np
from config_path import DATA_PATH
def read_file_gc(filename, fs):
print(filename)
with fs.open(filename) as f:
label_analysis = pd.read_csv(f)
return label_analysis
processed_dir = join(DATA_PATH, 'updated_labels')
class UpdatedLabe... |
fe0846891c8c1bd304822cd5c7f1e08133b15db758e51173e7d07358f12f451c | Python | 5,128 | 123 | import argparse
import json
import os
import shutil
import sys
import numpy as np
sys.path.insert(0, os.path.abspath(os.path.join(os.getcwd(), "../../../")))
def add_args(parser):
parser.add_argument('--client_num_per_round', type=int, default=3, metavar='NN',
help='number of workers')
... |
27055102f5d15342949872034139bf7b01de391777a01549539080bd58620699 | Python | 5,132 | 165 | import copy
import numpy as np
import pytest
import torch
from daart.data import split_trials, compute_sequences
from daart.utils import build_data_generator
def test_split_trials():
# return correct number of trials 1
splits = split_trials(100, 0, 8, 1, 1, 0)
assert len(splits['train']) == 80
asser... |
ba041b105f633d9596de1a6719a243a3645a63f9e0687293edb05e8c9f4141b5 | Python | 5,132 | 169 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/posetrack18.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_384x288-314c8528_20200708.pth' # noqa: E501
cudnn_benchmark = True
checkpoint_config = dict(interval=1)
evaluation = dict(interval=... |
6bdc1ff014bc5456cd206a8ba780148be9e2586df2380a434d96a8871ff60c3e | Python | 5,133 | 175 | # Copyright (C) 2024-2025 ETH Zurich, Marc Lehner and other DASH contributors.
from serenityff.charge.tree.atom_features import (
AtomFeatures,
get_connection_info_bond_type,
)
from typing import Any, Tuple
import numpy as np
from rdkit import Chem
from serenityff.charge.utils import Molecule
class AtomFeatu... |
223a042bf216a763d2042d8c32b4e25b6a9a96104bf078bc87907139f2a968b4 | Python | 5,136 | 101 |
import itertools
import numpy as np
def vote_classification(n_path,
n_class,
n_super,
pred_class,
pred_super,
path_from_class,
path_from_superclass, isglycoside, ontol... |
d9910bd724cc5db1b4fe91bd5687bc6852f672e1322ab6ed7627b920c2a5b12e | Python | 5,140 | 132 | import os
import sys
import time
import json
import pickle
import shutil
import logging
import numpy as np
def save_predictions(x, y, cv_split, test_x, test_y, smiles, test_smiles, model, saving_dir):
timestamp = time.strftime('%Y-%m-%d-%H-%M')
def _save_to_file(smiles, true_label, predicted_label, predicted... |
2928da494c39b4e88e6c2f2ee4ad5e467ae628fc622ce53e7e48d9cbbbaf5361 | Python | 5,148 | 106 | ############################################
# imports
############################################
from typing import Any
from joblib import Parallel, delayed
from joblib_progress import joblib_progress
from oligo_designer_toolsuite.database import OligoDatabase
from oligo_designer_toolsuite.oligo_property_calculat... |
e242c33fea2fd00ce50795abac3f4d59c9969ac9825c4e329724b9a3fe64669e | Python | 5,148 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco_wholebody_hand.py'
]
evaluation = dict(interval=10, metric=['PCK', 'AUC', 'EPE'], save_best='AUC')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
... |
255d0d63865735bd2fe661cc1c4f375c68e7834aee0446e27eaaa861c7106663 | Python | 5,150 | 130 | # Copyright (c) OpenMMLab. All rights reserved.
import math
from mmcv.parallel import is_module_wrapper
from mmcv.runner.hooks import HOOKS, Hook
class BaseEMAHook(Hook):
"""Exponential Moving Average Hook.
Use Exponential Moving Average on all parameters of model in training
process. All parameters hav... |
00bbbc5b3d0dbd7b2b068a84c4b83b5b7aa372cd03de563854bfd46dad93d115 | Python | 5,154 | 146 | """
Variance partition for:
1) Semantics vs Speech
2) Semantics vs (Speech + SSS), per SSS layer
"""
#### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content.
import os
PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcas... |
12a70bcde54f4d4cedb8ae93ff9bdfdb2959623e89515c52405a4539183b54a7 | Python | 5,156 | 171 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ochuman.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... |
81a7ed9ae16d7da1719362fc98551449edd0bcdf718e3c2b624860dbda653082 | Python | 5,156 | 171 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ochuman.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... |
97aade19144ce4adb520880666d771842e081706e96c176cdc7fe09f1562afd2 | Python | 5,156 | 171 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ochuman.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... |
b85aa866826a9a9d1f1f47fa95ed6d91c00b304c263383feb9bab16c93ac3636 | Python | 5,156 | 117 |
import subprocess
def run(cmd, max_minutes = 6000):
import time
sys.stderr.write("Running cmd: %s\n"%cmd)
p = subprocess.Popen(cmd ,
shell=True,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subproc... |
bae77fb16b54395d7c72b7abc0625eec9375c998ff50da2966bfb48140eb5037 | Python | 5,156 | 171 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/ochuman.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup... |
3cf3d84b42f441a4230a82dd4fbdfe2678ae2d9fa265b9e9c41442af509fb160 | Python | 5,158 | 108 | import pandas as pd
from pathlib import Path
import matplotlib.pyplot as plt
import os.path
import mysrc.constants as cst
def plot_accuracy_vs_time(df, my_colors_, x_labels, filename=''):
fig, axs = plt.subplots(df_.Crop.unique().shape[0], figsize=(8, 20))
for i in range(df_.Crop.unique().shape[0]):
... |
746f2758a5744e330834c3e68dbe1dcc395b999b12fe9fc1d66c2951a8223d53 | Python | 5,160 | 159 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 25 16:00:50 2020
@author: bariskuru
"""
import torch
from torch.autograd import Variable
import torch.nn as nn
from torch import optim
import seaborn as sns, numpy as np
import matplotlib.pyplot as plt
from grid_short_traj import grid_maker, grid_... |
e3b014e638c419ff58a9a693cb41673743db0b79daddd3f9f0cab96ab563c575 | Python | 5,161 | 170 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco.py'
]
evaluation = dict(interval=10, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='step',
warmup='l... |
2d0931e31e9b4c60a0aa19f200ba4ad0b8a9d530deacfaa56206a4fb577af5ae | Python | 5,166 | 150 | # Copyright Universitat Pompeu Fabra 2020-2023 https://www.compscience.org
# Distributed under the MIT License.
# (See accompanying file README.md file or copy at http://opensource.org/licenses/MIT)
"""Shared utilities for neighbor list computation (backward, cell list building)."""
import torch
from torch import Te... |
8d9dd48d22ccad164fdae1f5c11742eb6b8aa42db12b3c2f25a3b5d319613864 | Python | 5,167 | 153 | '''
Broad data-handling utilities, including get_files(f), which defines the folder naming structure.
'''
from pathlib import Path
from glob import glob
def get_files(f):
'''
Give a file path representing a single subject return all possible pipeline paths.
Use this exclusively for calculating file paths... |
bfcfcc720229267335f15d8ffc86358d9c3c80b012be9a81f6288575267ff9a0 | Python | 5,168 | 155 | import pathlib
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from tensorflow.keras import backend
from functions import *
#make a simple model
#rejected
def build_modelA():
model = ker... |
0f0215312a838d5ca28806883024bfd3aa16db542bf228adbb1e505acb67342f | Python | 5,170 | 166 | # Copyright (c) OpenMMLab. All rights reserved.
import os
import warnings
from argparse import ArgumentParser
import cv2
import mmcv
from mmpose.apis import (inference_top_down_pose_model, init_pose_model,
vis_pose_result)
from mmpose.datasets import DatasetInfo
try:
import face_recognit... |
d15d7fca25bbe401d029a4985d7e9c7871d294288a0b072e56dbe41d229d3980 | Python | 5,171 | 129 | import random
import numpy as np
import torch
class ClientPushsum(object):
def __init__(self, model, model_cache, client_id, streaming_data, topology_manager, iteration_number,
learning_rate, batch_size, weight_decay, latency, b_symmetric, time_varying):
# logging.info("streaming_data = ... |
383ae7302d52567595aa75603d4397bf8ebd458f957163a561c093162d9a1bd7 | Python | 5,172 | 152 | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import glob
import os.path as osp
import cityscapesscripts.helpers.labels as CSLabels
import mmcv
import numpy as np
import pycocotools.mask as maskUtils
def collect_files(img_dir, gt_dir):
suffix = 'leftImg8bit.png'
files = []
for img_file ... |
d36cfde66c68d65a5868afa58d26d35e2caf652efce6f7e67dd26ad02cbc539b | Python | 5,173 | 167 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/coco_wholebody_hand.py'
]
evaluation = dict(interval=10, metric=['PCK', 'AUC', 'EPE'], save_best='AUC')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
... |
e50edefe7cad202a2899c1312e4f507a23bbc7d01d2b09c9a8e0c6df5dd6056a | Python | 5,175 | 135 | import os
import torch
import torch.nn as nn
from utils.constants import TOTAL_NUM_ITER, NUM_ITER_PER_EPOCH, OPTIMIZER_PARAMETERS, DEVICE
from utils.utils import pixel_acc
from tqdm import tqdm
def train_one_epoch(segmentation_module, iterator, optimizers, epoch, crit, writer):
"""
Function for training m... |
1022dc93a762eb96612d1b29dc12094154b8678950cd787a12bc5e00ddeb4d31 | Python | 5,176 | 172 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/posetrack18.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_384x288-314c8528_20200708.pth' # noqa: E501
checkpoint_config = dict(interval=1)
evaluation = dict(interval=1, metric='mAP', save_b... |
6aa53e3155db9299693a1291fc0b62454a2e7b280e7ff37a44b650c048221a95 | Python | 5,176 | 172 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/posetrack18.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_256x192-c78dce93_20200708.pth' # noqa: E501
checkpoint_config = dict(interval=1)
evaluation = dict(interval=1, metric='mAP', save_b... |
9750db6bf474388a637f1368bab1cddda45a58dcbb7ea52812e2c686ccf9ecaa | Python | 5,176 | 172 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/posetrack18.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w32_coco_384x288-d9f0d786_20200708.pth' # noqa: E501
checkpoint_config = dict(interval=1)
evaluation = dict(interval=1, metric='mAP', save_b... |
cb88d5db98e6f2859eed2e4403a572ecb51a0e15b257a2e2a20786fd9af723e7 | Python | 5,176 | 172 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/posetrack18.py'
]
load_from = 'https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth' # noqa: E501
checkpoint_config = dict(interval=1)
evaluation = dict(interval=1, metric='mAP', save_b... |
e7c7d547015050b846ee31fa84d9d7c1b4df377819ef81b18ce51ae48ca8337d | Python | 5,178 | 137 | # Copyright (c) OpenMMLab. All rights reserved.
import logging
from collections import defaultdict
from contextlib import contextmanager
from threading import Event
from typing import Optional
logger = logging.getLogger('Event')
class EventManager():
"""A helper class to manage events.
:class:`EventManager`... |
84a1d1ed7df9d515d0b9d7bccaaaefa2ab7a36e165aa6a289438b5ed991b7b1f | Python | 5,180 | 157 | import torch
import torch.nn.functional as F
from torch import nn
from base.config import Config
class USleepEncoderBlock(nn.Module):
"""
Encoder block that extracts features while downsampling.
Each block performs:
1. Conv1d → ELU → BatchNorm (feature extraction)
2. MaxPool with stride 2 (downs... |
9cbad0c574181fe710022c9282146df49eadbf3f499c5809f9445f8882046e40 | Python | 5,180 | 145 | # -*- coding: utf-8 -*-
"""
Created on Wed Oct 12 13:38:23 2022
@author: Daniel
"""
from phase_to_rate.neural_coding import load_spikes, rate_n_phase, load_spikes_DMK
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import os
import sys
import matplotlib as mpl
import pdb
... |
27f3d9780e3933d0c005d45c8abefafd1aea7db6d153baf3edf26090cebd3238 | Python | 5,181 | 126 | import pickle
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from absl import app, flags, logging
import sys
sys.path.append('../')
from jax.config import config
import tensorflow as tf
import os
os.environ['XLA_PYTHON_CLIENT_PREALLOCATE'] = 'false'
tf.config.set_visible_devices... |
49546ea0d77278d3ca3e464f5e9d1a4fc47e7eaee01c2259b2dc4867538353a9 | Python | 5,182 | 147 | import sys
import os
import shutil
import subprocess
def test(cmd):
print('Testing: %s' % cmd)
return subprocess.call(cmd, shell = True)
def testOutput(cmd):
print('Testing: %s' % cmd)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell = True)
assert p.wait() == 0
out, err = p.communicate()
return out
if... |
3e0b360aa075d8ca2eca3f830c0dea6171407d6d88cb814fa50f7a15fa891a67 | Python | 5,183 | 117 | import sqldbutils as db
import utils
import logging
from os.path import join
import sys
from subprocess import Popen, STDOUT
class CohortHelper(object):
def __init__(self, conf_file):
self._cohort_conf = conf_file
self._conf = None
self._patient_ids = []
self._dest = 'file'
... |
b2aa3b0e3d873a8c1058aa78f87a8ab95156a59c1595553773318daa98af1f96 | Python | 5,183 | 168 | import os
import torch
from torchmd.systems import System
from moleculekit.molecule import Molecule
from torchmd.forcefields.forcefield import ForceField
from torchmd.parameters import Parameters
from torchmd.forces import Forces
from torchmd.integrator import Integrator
from torchmd.wrapper import Wrapper
import numpy... |
01ba1b5ded700e9504b56395fd6de4c97f58bed0d64f877c6a6eccbd65702d25 | Python | 5,189 | 101 | import torch
from torch.utils.data import DataLoader
from torchvision import transforms
from torchvision.transforms.functional import InterpolationMode
from data.coco_karpathy_dataset import coco_karpathy_train, coco_karpathy_caption_eval, coco_karpathy_retrieval_eval
from data.nocaps_dataset import nocaps_eval
from d... |
8e44790d330a12ab348abe2fc60dfd14e4ef24bfa507d2ca84b5e0ffe4322f7e | Python | 5,192 | 155 | import os
import sys
import numpy as np
import h5py
import scipy.io as spio
import nibabel as nib
import argparse
parser = argparse.ArgumentParser(description='Argument Parser')
parser.add_argument("-sub", "--sub",help="Subject Number",default=1)
args = parser.parse_args()
sub=int(args.sub)
assert sub in [1,2,5,7]
de... |
23f42001071331069235a5ef799589d9b11eb5af03092d6e98122440977d3527 | Python | 5,196 | 129 | # cox.py
# Train a model that fuses the output of 3 FCNs for AD status prediction
import torch
torch.set_deterministic(True)
import torch.nn as nn
import sys
import math
import pandas as pd
import numpy as np
sys.path.insert(1, './plot/')
from plot import report_table, roc_plot_perfrom_table
from networks import MLP_... |
a0adaad87c17a1408841c267fbc65ba46eaaab68a7261c113f3e2c2e16e22ff5 | Python | 5,196 | 145 | #setup.py
from distutils.core import setup, Extension
from distutils.sysconfig import get_python_version
import sys
import os
# NRNPYTHON_DEFINES which were enabled at configure time
extern_defines = ""
nrnpython_exec = "/usr/bin/python3"
nrnpython_pyver = "3.6"
nrn_srcdir = "."
build_rx3d = 1
ivlibdir = ""
if ivlibd... |
9b46e92869f4d2966e9bb6b271a9360b7b2f5a2b9a3697ee41806d2b9febd400 | Python | 5,197 | 125 | import argparse
import h5py
import os
import PIL.Image
from shutil import rmtree
import numpy as np
import sys
from pytorch_fid import fid_score
def adjust_dynamic_range(data, drange_in, drange_out):
if drange_in != drange_out:
scale = (np.float32(drange_out[1]) - np.float32(drange_out[0])) / (np.float3... |
093f4c8a5145e54c68638e9102dc812886fd32e24096246be5cc6b2cc77e6479 | Python | 5,201 | 137 | import numpy as np
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from tqdm import tqdm
import json
from collections import defaultdict
import pandas as pd
from argparse import ArgumentParser
import os.path as osp
def generate_scaffold(smiles, include_chirality=False):
mol = Chem.MolFromSm... |
a4330470a2f412405b93ea9bc465ba90661037ac3c00d2a81b7b7cfd3d3445a7 | Python | 5,201 | 153 | # Copyright (c) OpenMMLab. All rights reserved.
import functools
import pickle
import warnings
from collections import OrderedDict
import torch
import torch.distributed as dist
from mmcv.runner import OptimizerHook, get_dist_info
from torch._utils import (_flatten_dense_tensors, _take_tensors,
... |
67af535b93f7bb79faa8c1a1148ad8c809c999ff6b5048fa254712eed924e930 | Python | 5,203 | 159 | """
Check how much adding SSS reduces unique neural variance explained
by semantic features.
"""
#### ChatGPT was used to assist writing code. The authors reviewed, edited, and take full responsibility for the content.
import os
PODCAST_ROOT = os.environ.get("PODCAST_ROOT", "/engram/naplab/users/rs4613/Podcast") # s... |
35e474683e459124739930d3b7fa2050eda090c6e4f1d4b1db24d0b41ae16110 | Python | 5,207 | 140 | import os
import cv2
import torch
from tifffile import imread, imsave
import numpy as np
import ET_model
from torchvision import transforms
def interpolate_image(frames, imindex, factor, flow, interp, back_warp, file_out, orsize, device): # frames是要处理的图像, factor缩放因子似乎是要插图的数目+1
frame0 = torch.stack(frames[:-1]) ... |
65564ba3e118bd539b3ea1882fac91623e954f96ddc225f2a05802b583c54f0c | Python | 5,208 | 173 | """
Simulate pydentate with grid cell inputs on linear trajectories.
This is one of the most computationally intensive steps as it generates
all the raw data that is used for the perceptron, tempotron as well as
CA3 analysis. It allows for reproducibility through a variety of seeding
steps.
"""
import shelve
import c... |
49db01610753067efd828dbbedd77851f971eb3d18f5ac0b5ef1a2309bb5c6e3 | Python | 5,211 | 131 | # Copyright (c) OpenMMLab. All rights reserved.
import random
import torch
import torch.distributed as dist
import torch.nn.functional as F
from mmcv.runner import get_dist_info
from ..builder import DETECTORS
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class YOLOX(SingleStageDetector... |
ce0d4ac0a411b38be81165446f483c6a7bdaf21641548da6cb97cba3ed953d43 | Python | 5,213 | 194 | # mimic III data access functions
# - postgres library is needed
# Honghan 2016
import psycopg2
import datetime
import json
# db connection string
db_cnn_str = "dbname='mimic' user='mimic' password='123321!a' host='10.200.100.216'"
# query templates
# patient cohort by diagnosis template
qt_patient_cohort = """
sel... |
e009d5ad810b4212cac2e2f134cc922e06228ce8011d8cea3e401ffe1e257900 | Python | 5,215 | 174 | _base_ = [
'../../../../_base_/default_runtime.py',
'../../../../_base_/datasets/rhd2d.py'
]
evaluation = dict(interval=10, metric=['PCK', 'AUC', 'EPE'], save_best='AUC')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config = dict(grad_clip=None)
# learning policy
lr_config = dict(
policy='st... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.