sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
d5dd448e909e0cd7bec73aae6431aabb0d43b5d732abee9a98c7fcbfa05db852 | Python | 15,820 | 500 | #!/usr/bin/env python
"""
quot.filters -- background subtraction and related filters
to clean up dirty data for detection and localization
"""
# Numeric
import numpy as np
# Gaussian filtering
from scipy.ndimage import gaussian_filter
# File reader
from .read import ImageReader
class ChunkFilter(ImageReader):
... |
188bbedcbb5dacc19cf69cca3ae7a8a0e75ff4fa7207484d108d85cf316d96eb | Python | 15,825 | 357 | """
Copyright 2018 - by Jerome Tubiana (jertubiana@@gmail.com)
All rights reserved
Permission is granted for anyone to copy, use, or modify this
software for any uncommercial purposes, provided this copyright
notice is retained, and note is made of any changes that have
been made. This softwa... |
b186f2c6c5454a42f7c33667067b07e3a80c281b24c30fe20e2b36deef5a5da5 | Python | 15,831 | 423 | import allel
import numpy as np
import pandas as pd
import os
from collections import defaultdict
from pybedtools import BedTool
from pysam import VariantFile
# original code written by Dennis Kao: https://github.com/ccmbioinfo/crg/blob/master/SVRecords/SVGrouper.py
class SVGrouper:
def __init__(self, vcfs, repor... |
cc56c24329a4cdcc17fe8dc64e2262a1903c33969bea5133f7585fd80dd55ea0 | Python | 15,832 | 515 | #%% Load data
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from mpl_toolkits.axes_grid1 import make_axes_locatable
from graspy.plot import gridplot, heatmap
from src.data import load_networkx
from src.utils import meta_to_array, savefig
from src.vis... |
f40558f504cd3094d9f5f2c1d203f558ccf7124c4faaed42afcb2b0c205dcaf9 | Python | 15,837 | 267 | #!/usr/bin/env python3
"""
File: merge_decon_eqtl_results.py
Created: 2022/02/10
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwa... |
a5b77223861ffd2de7adec1a70d639cc06e34411dce0df096f09ca8519e65a40 | Python | 15,848 | 617 | # %% [markdown]
# ## Imports
import os
import time
from itertools import chain
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import rankdata
from src.data import load_metagraph
from src.graph import preprocess
from src.io import sav... |
c525e9f7bc273040e9c7208f6aba51f3722638afe1e9eae773b71753b02929c1 | Python | 15,857 | 418 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
87ce553ddff41df163d5fb14e6eb3dae5b5403c9981b0bc9f753a1ec173a72ce | Python | 15,874 | 532 | # %% [markdown]
# ##
import os
import time
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy
import seaborn as sns
from joblib import Parallel, delayed
from scipy.optimize import curve_fit
from graspy.match import GraphMatch
from graspy.plot import heatmap
fr... |
a9e93151268739d928bca67a7dc3d2a3dc96b02364170b727181dec581852c55 | Python | 15,885 | 440 | #!/usr/bin/python
####################################################################################################
# Copyright (c) 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
... |
566060cca0705fe52a73fc87d89c8eea391bc7967fb2bd4df7d57ca2e39d8e91 | Python | 15,887 | 376 | #!/usr/bin/env python3
'''
Attenuation experiment using genetic algorithms as optimizer.
'''
from typing import Callable, Dict, Sequence, Tuple, Union, Optional
from pathlib import Path
import random
import numpy as np
import pandas as pd
from deap import base, creator
from model_hw_mc_attenuation import Observation... |
f17c2943cb114fca6538fe9bb1670460db6e5b11ac2233398cbc009f60f527b5 | Python | 15,887 | 409 | """
Copyright (c) 2019, National Institute of Informatics
All rights reserved.
Author: Huy H. Nguyen
-----------------------------------------------------
Script for training ClassNSeg (the proposed method)
"""
import os
import random
import torch
import torch.backends.cudnn as cudnn
import numpy as np
fr... |
c1767e14634758c19ee263e7cfc888bc7c146f85a35258ee6229303b6e97bd12 | Python | 15,898 | 347 | # Copyright 2015-2023 MathWorks, Inc.
""" Package for executing deployed MATLAB functions """
import atexit
import glob
import importlib
import os
import os.path
import pdb
import platform
import re
import sys
import weakref
class _PathInitializer(object):
PLATFORM_DICT = {'Windows': ['PATH','dll',''], 'Linux':... |
fb75c213ed21904e21e69297c8d59c88831e5a03788ea02a0aa9ac1aa912fa7f | Python | 15,901 | 385 | import sys
sys.path.insert(0, '.')
import loadData as ld
import os
import os.path as osp
import torch
import numpy as np
import torch.backends.cudnn as cudnn
import transforms as myTransforms
import dataset as myDataLoader
import time
from argparse import ArgumentParser
from IOUEval import iouEval
import torch.optim.lr... |
69d54bbdad42520564fa9597d4da0e271d695f3594320b1f20a693dd72ea55c7 | Python | 15,924 | 586 | """Miscellaneous utility classes and functions."""
import os
import inspect
import logging
import pickle
import sys
import warnings
from copy import copy
from pathlib import Path
from shutil import rmtree
from typing import Any, Callable, List, Optional, Tuple, Union
import numpy as np
import yaml
from yaml.construct... |
cfd6043fdb6c6e2aea4188013cf11b787c28a2b89d31502769615b116aded3ad | Python | 15,932 | 459 | import os.path as osp
import mmcv
import numpy as np
import pycocotools.mask as maskUtils
from mmdet.core import BitmapMasks, PolygonMasks
from ..builder import PIPELINES
@PIPELINES.register_module()
class LoadImageFromFile(object):
"""Load an image from file.
Required keys are "img_prefix" and "img_info" ... |
6fe83ddb1d33789930321e40f5fdc1a9183fee98ebdf9258f39ca26c039cbb46 | Python | 15,952 | 435 | import gzip
import io
import logging
import os
from pathlib import Path
from typing import List, Optional, Type, TypeVar, Union
import requests
from deprecation import deprecated
from linkml_runtime.loaders import yaml_loader
from oaklib import BasicOntologyInterface
from oaklib import datamodels as datamodels_packag... |
541a26191e86a91a575579506aca1f09d0b97a1243a148ecbbaedbacc3c4a275 | Python | 15,962 | 450 | import sys
import os
import torch
import numpy as np
from torch_geometric.data.dataset import Dataset
from torch_geometric.data.data import Data
from tqdm import tqdm
import h5py
import copy
from .community_pooling import community_detection, community_pooling
def DivideDataSet(dataset, percent=[0.8, 0.2], shuffle=T... |
1bdb9f98cde1a06fc9ae4b924d79ed1be7ac045924c2b31c3f7483e511833862 | Python | 15,986 | 400 | import sys
from PySide2 import QtCore, QtGui
from PySide2.QtWidgets import QApplication, QMainWindow, QGridLayout, QWidget, QCheckBox, QLayout, QDialog, QLabel, QPushButton, QVBoxLayout
import numpy as np
import pyqtgraph as pg
import pandas as pd
import utils
class extractPeaksDialog(QDialog):
def __init__(self,... |
262750de06ac0d72756ed74e826d43499e076936c15b4fdfb66018e225d55cd6 | Python | 15,989 | 375 | import copy
import os
import os.path as osp
import time
import torch
import torch.distributed as dist
import mmcv
from mmcv.runner.checkpoint import load_checkpoint
from mmcv.runner import Runner, hooks
from mmcv.runner.hooks import (CheckpointHook, Hook, IterTimerHook,
LrUpdaterHook, O... |
e2c1651105b24c2f3f3c95f41689cacb10896ac2eb5e2dd75180fc02ffded4dc | Python | 15,990 | 408 | # Copyright 2021 DeepMind Technologies Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
a1ecf82c0245baec266e61738d2ae55bb853b10bf41738be6c085dba04c969a2 | Python | 15,993 | 432 | #! /usr/bin/python
# -*- coding: utf8 -*-
import numpy as np
from six.moves import xrange
def minibatches(inputs=None, targets=None, batch_size=None, shuffle=False):
"""Generate a generator that input a group of example in numpy.array and
their labels, return the examples and labels by the given batchsize.
... |
f61ec02ece6e8e5cd2343ab3b8f625ecb75e3030d715f40de8499656a2dbbf0a | Python | 15,996 | 447 | # Copyright (c) Open-MMLab. All rights reserved.
import ast
import os.path as osp
import platform
import re
import shutil
import sys
import tempfile
from argparse import Action, ArgumentParser
from collections import abc
from importlib import import_module
from addict import Dict
from yapf.yapflib.yapf_api import Form... |
467e889e6496a97e84fd08370b1e552b58bed0faa46924745bee27fb6ad2a69e | Python | 16,004 | 371 | import torch.nn as nn
import torch.nn.functional as F
import torch
# Set warning filter to show each warning only once
import warnings
warnings.filterwarnings("once", category=UserWarning)
from ..layers.channel_mlp import ChannelMLP
from ..layers.spectral_convolution import SpectralConv
from ..layers.skip_connection... |
cf2ba3b3758cbc1aabde3827d024b8dd40a183f1f984d9fce5215cee1fe9f46f | Python | 16,007 | 548 | #%%
import datetime
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from giskard.plot import merge_axes
from graspologic.align import OrthogonalProcrustes
from graspologic.embed import AdjacencySpectralEmbed, MultipleASE, sele... |
56f88cc2433450316a7437b3c71c18f2999a571c85790de43e42fb909ebdac4d | Python | 16,011 | 349 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
a00278a094440fe3ed7ef6086e728f2defe8ab7601441032b3235a62a2285e82 | Python | 16,015 | 382 | import sys
sys.path.insert(0, '.')
import loadData as ld
import os
import os.path as osp
import torch
import pickle
from models import MiniSeg as net
import numpy as np
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import transforms as myTransforms
import dataset as myDataLoader
import time
f... |
96004c1a419f1c47cb1e7cfd8e2c3eafaa3d9f654b59e2177f43a530f46fbe82 | Python | 16,023 | 555 | """
Parallelizable functions interface for RACCOON
F. Comitani @2020-2022
"""
class Interface:
""" Interface for parallelizable functions. """
def __init__(self):
self.gpu = False
self.num = None
self.df = None
self.tSVD = None
self.UM... |
0d529eafa91b25f50e175a61771302eec4795a9cd9a4999dc35177492e9afd23 | Python | 16,030 | 311 | #!/usr/bin/env python3
"""
File: decon_eqtl_permutation_jobs.py
Created: 2021/07/23
Last Changed: 2022/01/25
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
t... |
c58bb79c55d09bb799b2e00ad3ada42300da5a9575655b4a45505e6e7cd469bb | Python | 16,042 | 436 | """
Support functions for BIDS MRI fieldmap handling
MIT License
Copyright (c) 2017-2022 Mike Tyszka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitati... |
93feb4f0a8d80f7a4a95461d09d6cb639989479a4e882205725a0794d2d725af | Python | 16,052 | 490 | import time
import os
from torch.utils.tensorboard import SummaryWriter
import numpy as np
import torch
from Losses import get_dist_and_masks
from datetime import datetime
class AverageMeter(object):
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
... |
868024b88e6f7e8a5a9253a5899ddec94547a17b095410cb8fc195fa41aceab4 | Python | 16,060 | 414 | """
Mitochondrial density analysis
For each compartment branch, we count the number of synapses associated
with each branch and compute its total mitochondrial volume. We then
compute synapse and mitochondrial density metrics, and write out
two dataframes as a result - one describing a branch per row, and
another desc... |
dbbd4c16428a09425ce6d0b4f289e694c70842b4d5ceb756dcc811897bb30775 | Python | 16,061 | 419 | from abc import ABCMeta, abstractmethod
import torch
import torch.nn as nn
import torch.nn.functional as F
from fvcore.common.registry import Registry
from M2TR.utils.registries import LOSS_REGISTRY
from .build_helper import LOSS_REGISTRY
class BaseWeightedLoss(nn.Module, metaclass=ABCMeta):
"""Base class for ... |
fa3999a8302b35ceb5f6eefbda74eba1899d65daba354d616679a6463c0cdc7f | Python | 16,063 | 376 |
import random, sys
from typing import Union, List
from networkx.classes.function import to_undirected
import networkx as nx
import ipdb
import torch
import numpy as np
import matplotlib.pyplot as plt
import torch.nn.functional as F
from numpy import ndarray
from torch_geometric.utils import to_networkx
from graphxai... |
24029551e5f5c7422c23a9d5f6c334f5f9186adaef74e36ceb8915a162896f16 | Python | 16,065 | 457 | from platform import node
from torch.functional import cdist
import torch.nn as nn
from torch_geometric.data import Batch, Data
from torch_geometric.utils.subgraph import subgraph
from torch_scatter import scatter
import torch
def get_graph_indices(X: Data):
# source, target, _ = X.adj_t.t().coo()
target, sou... |
886e086340ab7357f7d2fd3575729b04ad6933c108eebb54bfbd0ee75df792df | Python | 16,079 | 397 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
b6afacac6a17d683b7e3b34ececb80bd91a2a2e632b0cb6aa49d1d50914b5c52 | Python | 16,079 | 386 | import os
import math
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from lmfit import Model
import helper_functions as hfn
import plotting_functions as plotfn
from scipy import stats
from lmfit.models import PowerLawModel
from lmfit.models import LinearModel
def expfunc(x, a, b):
return a... |
b9f1a02f756b14b569179ef1bda45c93f0ac6819fb93674cfda3c2dfa68debe9 | Python | 16,084 | 367 | #!/usr/bin/env python3
"""Drive a vehicle directly: control input, Ackermann, lights, doors, physics.
Targets one vehicle (default the ego, role_name 'hero'):
--id N | --role hero | --filter '*prius*'
Commands:
control [--throttle 0.5 --steer 0 --brake 0 --reverse --hand-brake]
[--hold 3] ... |
1decf2dd914224fe2885d1e905a0aeb5e487c59a4729aa66d2654825f66067d5 | Python | 16,089 | 425 | import tensorflow as tf
from deepsleep.nn import *
class DeepFeatureNet(object):
def __init__(
self,
batch_size,
input_dims,
n_classes,
is_train,
reuse_params,
use_dropout,
name="deepfeaturenet"
):
self.batch_size ... |
d5acf6ed7d951a98db0059ddc883c0a6c15b4ed5ede28a8773a5ffce692a6c1d | Python | 16,093 | 490 | # -*- coding: utf-8 -*-
import copy
import tensorflow as tf
from .. import _logging as logging
from .core import *
__all__ = [
'PoolLayer',
'MaxPool1d',
'MeanPool1d',
'MaxPool2d',
'MeanPool2d',
'MaxPool3d',
'MeanPool3d',
'GlobalMaxPool1d',
'GlobalMeanPool1d',
'GlobalMaxPool2d',... |
483db376962c73e8867bf359d0c89a81a6790dcc9368cc89fe933c6f4bc564c5 | Python | 16,117 | 479 | import time
import math
from sklearn import metrics
import numpy as np
import sys
import os
from IPython.core.debugger import set_trace
from sklearn.metrics import accuracy_score, roc_auc_score
# Features and theta are flipped for the binder in construct_batch (except for hydrophobicity).
def construct_batch(
bind... |
e730a57f5c53618a61c20055ad430be3c7062e84d3a4bc3ff087f714679fbfe0 | Python | 16,122 | 422 | import torch
import torch.multiprocessing as multiprocessing
from torch._C import _set_worker_signal_handlers, _set_worker_pids, \
_remove_worker_pids, _error_if_any_worker_fails
from .sampler import SequentialSampler, RandomSampler, BatchSampler
import signal
import functools
import collections
import re
import sy... |
49b4127e84eb104c4f63e416740454dd77f0fc5e54ddf644e1017da30de58ffe | Python | 16,127 | 367 | """
CommandLine:
pytest tests/test_anchor.py
xdoctest tests/test_anchor.py zero
"""
import torch
def test_standard_anchor_generator():
from mmdet.core.anchor import build_anchor_generator
anchor_generator_cfg = dict(
type='AnchorGenerator',
scales=[8],
ratios=[0.5, 1.0, 2.0],
... |
a2428c3c354138a7a0aaa664560e10adaad81f121eb5957d4644ba78c7b0b6c8 | Python | 16,141 | 439 | #!/usr/bin/env python3
"""
File: plot_decon_results_per_dataset.py
Created: 2022/01/17
Last Changed: 2022/02/10
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published b... |
d26d331bc770871ae6c13f44ac3718151a05ffd6726c2d92cbee3bf18fc354a3 | Python | 16,158 | 523 | """
ORCA wrapper functions
"""
import functools
import logging
from collections import ChainMap
from collections.abc import Callable
from pathlib import Path
from typing import Any
import numpy as np
from tqdm import tqdm # type: ignore[import-untyped]
from ppqm import chembridge, constants
from ppqm.calculator imp... |
107bb8cdbb77458f7a865fc451c6645de4398219a8d4a70920e973a53b5989f8 | Python | 16,206 | 429 | """Sign flipping.
Source reconstruction leaves the sign of each channel (parcel) arbitrary, so the
same parcel can have opposite polarity across sessions. Before pooling sessions
we align these signs: for each session we search for the ``+1``/``-1`` per-channel
vector whose (time-delay embedded, standardized) covarian... |
8d3df838fb8fe4b6b10b70eb47d04944fc41aa5c11ca2abbb10f3f434570913b | Python | 16,208 | 398 | #!/usr/bin/env python3
"""Import FBX meshes into CARLA as spawnable props.
Two input shapes, one positional argument:
# a directory: each subdirectory names the semantic tag for what is inside
python3 import_prop.py ~/meshes/props
# a single file: state its tag
python3 import_prop.py ~/meshes/Windmil... |
e0827316a924f05e26e11dff0104035a3ac1fbba90200cf8d6b80fb33ba9a953 | Python | 16,214 | 399 | import numpy as np
from typing import Dict
import xarray
from .typing import Tuple, Optional, List
try:
HOLOVIEWS_IMPORTED = True
import holoviews as hv
from holoviews.streams import Pipe
from holoviews import opts
import panel as pn
from bokeh.models import Range1d, LinearAxis
from bokeh.... |
aefbccc323a4395b0aabe7c220da2dfe09126269b9d70b2f086a53b3821c9dd6 | Python | 16,219 | 517 | import os
import sys
import time
import torch
import random
import itertools
import numpy as np
import pandas as pd
from torch_geometric.loader import DataListLoader
from torch_geometric.data import Data, DataLoader, Batch
def splitTrainTestMeshes(Nx, Ny, shape, Ndata, minDisorder, maxDisorder, test_size, seed=0):
""... |
4a6883aa17c4c6f6d9d235f8dddcef1ca7afedc582c22edacb063cb06af913c2 | Python | 16,224 | 441 | # %%
# from functions import make_m_rate_c
import logging
import pymc3 as pm
from pathlib import Path
import pandas as pd
import arviz as az
import xarray as xr
# %%
class MixtureModelInference():
def __init__(self, data, priors, sample_params):
self.set_priors(priors)
rename_dict={a:i for i,a i... |
7becdde6603a042c34f130ccfe62977573b2b8f7c05e374e2cd83afd253e7d8c | Python | 16,226 | 349 | import os
from shutil import copyfile
from random import random, randrange, sample
import datetime
INPUT_DIR = os.path.join(os.getcwd(), "inputs")
OUTPUT_DIR = os.path.join(os.getcwd(), "outputs")
def copy_ships(scenario_path='./MiamiPortScenario_copy/', num_ships=20, loc_mutation_factor=0.00000001,
... |
7f8ded0c450e63dd7d9c2210cde3c4d899c071579ba3ff8e0188c475d3e2c340 | Python | 16,235 | 518 | import math
import numbers
import random
import numpy as np
import torchvision.transforms.functional as tf
import PIL
from PIL import Image, ImageOps
class Compose(object):
def __init__(self, augmentations):
self.augmentations = augmentations
self.PIL2Numpy = False
def __call__(self, img, mask... |
f23bd0c81dab4e7318db2e3397017e86781c844f45b8e798e3b86ed8824c5f54 | Python | 16,240 | 401 | ####################################################################################################
# Copyright (c) 2019, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free softwar... |
a3b89501b90a35736fa6417732327d8609f66f50cf14baf7a855c415795bffd4 | Python | 16,243 | 485 | """
Classes/functions for building machine learning pipelines,
performing hyperparameter tuning, and evaluating model performance.
"""
from typing import Dict, List, Optional, Union
import numpy as np
from sklearn.base import clone
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScale... |
2cf475c8f683e9160c8476910d5a2b21e661d56791ba2e25733fc2226db9ad35 | Python | 16,265 | 421 | """
PyTorch implementation for meta-learning plasticity rules (v1.0)
Author: Navid Shervani-Tabar
Date : March 5, 2023, 18:44:17
"""
import os
import torch
import warnings
import argparse
import datetime
from torch import nn, optim
from random import randrange
from torch.nn.utils import _stateless
from torch.utils.d... |
2fdec8e9b395a44f8e16dd87c032dafa8a81d0a30b7ab40b7a8118f9d698cbea | Python | 16,266 | 368 | import json
import os
import re
import ftfy
import nltk
import numpy as np
import spacy
import sparse
import torch
from tensorly.contrib.sparse.decomposition import tucker
from transformer.model_pytorch import DEFAULT_CONFIG, TransformerModel, load_openai_pretrained_model
from utils import get_fullpath, load_glove_mo... |
164652784297411bafc774cb618caacd85ac06ae4380201fbd309304f030b235 | Python | 16,267 | 418 | """
.. _fourier_continuation :
Fourier Continuation
====================
This tutorial demonstrates Fourier continuation methods for extending non-periodic
functions to periodic ones, enabling efficient spectral analysis and neural operator
applications. Fourier continuation is crucial for:
- Converting non-periodic... |
6704ff6022c0e18f5dc6c8b2f6d5779c5204e0648df1337daffe681e5c1743fe | Python | 16,268 | 306 | import json
import sys
from pathlib import Path
import torch
import yaml
from tqdm import tqdm
sys.path.append(str(Path(__file__).parent.parent.parent)) # add utils/ to path
from utils.datasets import LoadImagesAndLabels
from utils.datasets import img2label_paths
from utils.general import colorstr, xywh2xyxy, check_... |
4b2565a36f23fccf7032751b642ea86eaa0c0b8b2f20f6adb8ae609e2974f5af | Python | 16,270 | 386 | # YOLOv5 common modules
import math
from copy import copy
from pathlib import Path
import numpy as np
import pandas as pd
import requests
import torch
import torch.nn as nn
from PIL import Image
from torch.cuda import amp
from utils.datasets import letterbox
from utils.general import non_max_suppression, make_divisi... |
f758a3f172a5e4e2a098109a8e0f8ed719e188d06b0109b228c0c45590109733 | Python | 16,270 | 393 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
536422fda7a1cc49afeec32920a31d9d9a4d318945fff20491c744829aeea2e9 | Python | 16,282 | 395 | """
File: dataset.py
Created: 2020/03/16
Last Changed: 2020/06/19
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version... |
7b5865e70ac4156edaefb2a372fee27dc55eb5661568b337cb4168e8936384a8 | Python | 16,287 | 384 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
08b340fcdb14d8ab16e1e054913700d3804088b483f43d645b7e78dc4bb3519e | Python | 16,290 | 426 | # -*- coding: utf-8 -*-
"""This is the utils library for the ET_biomarker project maintained by Qing Wang (Vincent)."
Functions:
"""
import pandas as pd
import numpy as np
def add_pd_lr(data, var_list, sufix_str):
"""Create the left, right, and sum of the give var_list for a dataframe.
Parameters
--... |
df9c065e201826c8ef9c3339f91803c405dff07be448cab42272caaba03e355b | Python | 16,293 | 510 | #!/usr/bin/env python
# coding: utf-8
import pymesh
from IPython.core.debugger import set_trace
import time
import os
from default_config.masif_opts import masif_opts
import numpy as np
import os
import matplotlib.pyplot as plt
import glob
from Bio.PDB import *
import copy
import scipy.sparse as spio
import sys
start_... |
c56d5f0c2049cbcfc80faadba0aa53ba4f4bb722f78e10d9237865c146bfa668 | Python | 16,295 | 383 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import datetime
from functools import partial
import json
import traceback
import imlib as im
import numpy as np
import pylib
import tensorflow as tf
import tflib as tl
import data
import mod... |
88353107c9452f6191c3f6c2a74a9d6c8bfa44beb5441aabe59c1ec9c444d523 | Python | 16,312 | 410 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
35cc707efea59c7d4dbf661c55a8c1f36ff6899e95549f8d66ad33dfa39cdc71 | Python | 16,321 | 555 | """
Created on Tue Jan 30 12:27:39 2018
@author: Emerson
`Cell` class to hold ABF recordings associated with a single neuron, along with
support `Recording` class to hold recs as a np.array with built-in methods for
plotting and test-pulse extraction.
Compatible with python 2 and 3 as of Feb. 5, 2018.
"""
# IMPORT ... |
d8edda245c1ae913eeb0b62b347e7e7719691067cac443c741f61ff49fb0fd02 | Python | 16,322 | 593 | #%% Imports and file loading
import pprint
import sys
from pathlib import Path
import networkx as nx
import numpy as np
import pandas as pd
import pymaid
from src.data import load_networkx
from src.io import savecsv
from src.pymaid import start_instance
output_name = "2020-05-08"
output_path = Path(f"maggot_models/d... |
f35587a19d4654d524337bef973763412d0144c863c139f8f8a4a41686dc54c6 | Python | 16,344 | 442 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This library is free... |
5a0a217f00d59982a0f4a757d68880ca19a67d4fbace3a765c0266750b4e5cbc | Python | 16,357 | 432 | ####################################################################################################
# Copyright (c) 2019 - 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
f0eefcd388679663e61ff0bc25163dbf7d6a29fb3544c1953e0ad07fedb5f8e2 | Python | 16,361 | 338 | """Shared ``torchrun`` rank model for the Transfer 2.5 workers (general and auto/multiview).
NVIDIA's ``Control2WorldInference`` / ``MultiviewInference`` run context-parallel: every
rank builds the pipeline under ``torch.distributed`` and every rank takes part in each
``generate`` (collectives). The socket worker the... |
9f527c184be2a36faaaaa28321010b68430e7224a22dad14647fc1b360dfb625 | Python | 16,372 | 477 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 3 13:23:59 2021
@author: th
"""
import torch
from torch.nn import ReLU, Linear, Softmax, SmoothL1Loss, Tanh, LeakyReLU
from torch_geometric.nn import GCNConv, global_max_pool, global_mean_pool, SGConv, GNNExplainer, SAGEConv, GATConv, FastRGCNCon... |
6a877912df6eb5e5fbf86708df0a3133fd6e70cc27b520e5ac0faa40c597b8a0 | Python | 16,378 | 435 | #%%
import os
import sys
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
print(os.getcwd())
except:
pass
# %%
import sys
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/maggot_models/')
sys.path.append('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
fr... |
640d78c4d2fc45b7c53530e779f8764491e445fbca31c57e395443720306d4d4 | Python | 16,379 | 408 | import numpy as np
import pandas as pd
import seaborn as sns
import researchpy as rp
import pingouin as pg
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from matplotlib.text import Annotation
from matplotlib.transforms import Affine2D
from sklearn.metrics import precision_score, recall_score, cla... |
7f5eaf143be9e3ebbbb7ad726d083b0d096ea9aaee08f87ef55f186e2fef206d | Python | 16,383 | 600 | # %% [markdown]
# #
import itertools
import os
import time
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOrderGroupIter, Node, RenderTree
from joblib ... |
0246005c615d411bdcf797508ea802e5abfd656c77b48b5bd57bf6e0074c5203 | Python | 16,393 | 421 |
# This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 o... |
3cbfd66f92835dd45cee2879ee0dfea7ad9d71c87d3d2223e25d9e42b74e6268 | Python | 16,396 | 434 | import logging
import numpy as np
import tensorflow as tf
from tensorflow.keras.utils import Sequence
from functools import wraps
from multiprocessing import current_process
from utime import Defaults
from psg_utils.errors import NotLoadedError
from psg_utils.preprocessing.scaling import apply_scaling, assert_scaler
fr... |
f98378ca6e54bbbff08b0e82c82b58450b8d01f29e5f76ca820527273aa9933a | Python | 16,402 | 450 | #!/usr/bin/env python
# coding: utf-8
# # Common
# In[ ]:
import math
import numpy as np
import matplotlib.pyplot as plt
r_left = 57./255.;
g_left = 87./255.;
b_left = 225./225.;
rgb_left = (r_left, g_left, b_left);
r_right = 255./255.;
g_right = 138./255.;
b_right = 0./255.;
rgb_right = (r_right, g_right, b_righ... |
10c16d43f5771b94ba8cd525699ee7d38eb0a7a423e0708ff7cac750c040ffb3 | Python | 16,410 | 624 | import numpy as np
import os
import pickle
from itertools import groupby
import sys
import h5py
import pandas as pd
import nrrd
from skimage import io
import utils.sync_utils as sync_utils
##main##
def get_root_dir():
root=os.path.abspath("../../")+'/'
print(root)
return root
#old name: Ascendi... |
d8d474cd836c7fff5a56d2f130c2de374f9863125bd768fc0a31f7fa8f4f35a3 | Python | 16,410 | 405 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
e30595a1257d50ff40ac4c87a97c08c1458ca00b512641b23484217168219c5f | Python | 16,433 | 496 | import itk
import numpy as np
import torch
import re
def clip_with_mask(img, mask):
img_arr = itk.GetArrayFromImage(img)
mask_arr = itk.GetArrayFromImage(mask)
new_arr = img_arr * mask_arr
new_im = itk.GetImageFromArray(new_arr)
new_im.CopyInformation(img)
return new_im
class SkullStripd(obj... |
2b546a2dc836163ecda5535480950ab78af86bc0918c2867bf8df380d184f473 | Python | 16,438 | 352 | #!/usr/bin/env python3
"""
File: interaction_eqtls.py
Created: 2020/05/01
Last Changed: 2020/05/22
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free S... |
b169b68b895b4e54f18212ac3d8600f2f98a1d9b05e123caa2da218f7e220b0d | Python | 16,481 | 469 | """
StyleMapGAN
Copyright (c) 2021-present NAVER Corp.
This work is licensed under the Creative Commons Attribution-NonCommercial
4.0 International License. To view a copy of this license, visit
http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
Creative Commons, PO Box 1866, Mountain View, CA 94042, U... |
14ee92e3609e547c068db01289fe391583f42bb93115e124981254c49d6fa338 | Python | 16,487 | 451 | """
File: main.py
Created: 2020/11/09
Last Changed: 2020/11/12
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 ... |
d7cdb855eb0b780b79f414e037bb8c171a8e4c6e7f1df6b8fcec135620e51e7b | Python | 16,497 | 317 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
e749812b6480b8ffc793da751f69207e34c78a264c675f53fabcc1c6d0d9a527 | Python | 16,511 | 497 | # This script is part of navis (http://www.github.com/schlegelp/navis).
# Copyright (C) 2018 Philipp Schlegel
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
49d31b54e84493aa26a1aa0ddf62223a6190d8fdc13a9e2d24a5fc8e251dbf5d | Python | 16,514 | 490 | import numpy as np
import matplotlib.pyplot as plt
import os, torch, medpy, sys, torch, random
from medpy.metric.binary import hd, dc, asd, assd, precision,\
sensitivity, specificity
def str_to_bool(value):
"""
Turns a string into boolean value.
"""
t = ['true', 't', '1', 'y', 'yes', 'ja', 'j']
... |
49f42f5aa53504a80dd5ab7876fe8920102fc44b90c7994b9b9435dc7e85cbea | Python | 16,518 | 344 | ##########################################################
## ccAF: actinn.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ ... |
97ddc69243b1ec64847ece417adab6dbe24b86da7f82d7794e28ec87b7ed5e65 | Python | 16,522 | 471 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import cv2
import torch
from torchvision import transforms as T
from torchvision.transforms import functional as F
from maskrcnn_benchmark.modeling.detector import build_detection_model
from maskrcnn_benchmark.utils.checkpoint import DetectronCheck... |
a1c993450845c8179c2020e0f0848b3ad0dbfcec6088a6fc9f56498fd9f8f907 | Python | 16,532 | 414 | from torch.nn.modules.module import Module
import torch
from torch.autograd import Variable
import numpy as np
from ..functions.gridgen import AffineGridGenFunction
import pyximport
pyximport.install(setup_args={"include_dirs":np.get_include()},
reload_support=True)
class _AffineGridGen(Module):
... |
2e958ce60b2b0ee50d7b775bc5f9063b3433321f7ae98833b60d926575ac2d05 | Python | 16,553 | 588 | # %% [markdown]
# #
import itertools
import os
import time
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from anytree import LevelOrderGroupIter, Node, RenderTree
from joblib ... |
a4408e0fe513a5fab754179884dfca22416006243ff8fbb010b56b2c3b927dc2 | Python | 16,589 | 373 | #!/usr/bin/env python3
"""
File: add_ie_results_to_mr_table.py
Created: 2021/02/026
Last Changed: 2022/03/14
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
t... |
dd3f439f868da66862560a0d273470b98422856dd3db7237e6c22a56bdce227a | Python | 16,603 | 429 | import math
import torch
from torch import nn
import numpy as np
import torch.nn.functional as func
import lanczos
class ShiftNet(nn.Module):
''' ShiftNet, a neural network for sub-pixel registration and interpolation with lanczos kernel. '''
def __init__(self, in_channel=1):
'''
Args:
... |
61413ac92537f066edca450091d10e42123ad815b3388590a6a352f775f2f4e4 | Python | 16,605 | 395 | import sys
sys.path.insert(0, '.')
import loadData as ld
import os
import os.path as osp
import torch
import numpy as np
from torch.autograd import Variable
import torch.backends.cudnn as cudnn
import transforms as myTransforms
import dataset as myDataLoader
import time
from argparse import ArgumentParser
from IOUEval ... |
82a339104656f38b04c3da6e6648f2fb737a69d191306aaacef65fc1889f0983 | Python | 16,615 | 429 | import math
import torch
from torch import nn
import numpy as np
import torch.nn.functional as func
from .lanczos import lanczos_shift
class ShiftNet(nn.Module):
''' ShiftNet, a neural network for sub-pixel registration and interpolation with lanczos kernel. '''
def __init__(self, in_channel=1):
... |
523ad94c1fdefdc144df1d6ea4067d2351050c2a4d134b1e7b10a32632fe8813 | Python | 16,617 | 543 | # %% [markdown]
# ##
import os
import warnings
import matplotlib as mpl
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import poisson
from sklearn.exceptions import ConvergenceWarning
from sklearn.manifold import MDS,... |
cce6157af97c15eed220acfcc400cdd91f6ee90ea38e1e760d455dedd00b62aa | Python | 16,620 | 402 | """
MODULE VERSION:
Create peptide atomistic PDB with PeptideBuilder (or Modeller in the future) from an amino acid sequence and use martinize2 to generate coarse-grained GRO and ITP using an ssdump secondary structure.
"""
import subprocess
import shutil
import os
import PeptideBuilder
#from Bio import PDB
import ... |
0cae19e7dab9415fe6df457a15ab81ded17ed4beed47cf268a39b31d8c02ad43 | Python | 16,623 | 477 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
2b976a6c84daf8a28945c65dfb28de4884639a58d064b9e0a3bcbbf6bafa7052 | Python | 16,624 | 400 | import torch
from torch import nn
from torch.nn import functional as F
from Code.model_lung_infection import init_weights
class _GridAttentionBlockND(nn.Module):
def __init__(self, in_channels, gating_channels, inter_channels=None, dimension=3, mode='concatenation',
sub_sample_factor=(2, 2, 2)):
... |
c65010c150e50155fdb6dc2df65c044a6887bda105afb5b1780b9a44db22ba51 | Python | 16,624 | 477 | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# NVIDIA CORPORATION and its licensors retain all intellectual property
# and proprietary rights in and to this software, related documentation
# and any modifications thereto. Any use, reproduction, disclosure or
# distribution of this software and rel... |
28d8afa6301c793a423405a7fb9d33232f9b9ff794f470ede8a5bfecfd7c19a5 | Python | 16,625 | 386 | """Frequency cropping, decimation, and band reduction of labeled results."""
from collections.abc import Mapping
from typing import Any, Literal
import numpy as np
import xarray as xr
from numpy.typing import NDArray
from spectral_connectivity._provenance import _canonical_json
from spectral_connectivity.utils impor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.