sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
6be833091355bfd71bf4b8902e5a50f54bb9b06e95f1fa90e258a58bc398590f | Python | 10,162 | 214 | # Copyright 2021 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... |
8638700b4348076475595b3e405bf5eda615c645555ccc0fe4551ff74ca5ac76 | Python | 10,162 | 261 | # Copyright 2018 SciNet (https://github.com/eth-nn-physics/nn_physical_concepts)
#
# 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
#... |
cd05f482af2d36b669ede9573e1f4d07284e1d299257494b7cda45127e776e58 | Python | 10,168 | 245 | # -*- coding: utf-8 -*-
"""
@author: Satoshi Hara
(Class)
> EnumLasso(modeltype='regression', maxitr=1000, tol=1e-4, rho=0.1, enumtype=k, r=1.1, k=10, delta=0, verbose=0, save=''):
modeltype : 'regression' or 'classification'
maxitr : maximum number of iterations for Lasso
tol : tolerance pa... |
df0933bbac97df5b745155217b80ec7484dc3367a1252d369256a314d86ae219 | Python | 10,169 | 229 | # Copyright 2020-2021 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... |
e178c563b66ce49301da8375de2810780274b2fadbd338fc59313a7693fa02bd | Python | 10,171 | 312 | """Modified from https://github.com/pytorch/pytorch."""
import warnings
from functools import wraps
from sys import maxsize
import torch
import torch.onnx
# This import monkey-patches graph manipulation methods on Graph, used for the
# ONNX symbolics
import torch.onnx.utils
from torch._C import ListType
# -----------... |
3dd15a4825873d68553d616959fc106af241cc03f3d9cd0f28a3c0288216d102 | Python | 10,172 | 212 | """
MODULE VERSION:
Combining peptide and membrane structures into a single system.
"""
import os
import numpy as np
import core.settings as CoreSettings
import core.system as System
import core.gromacs as Gromacs
import core.gromacs_commands
import user.usersettings as UserSettings
def module_insert_peptide_2mem(s... |
21dd525c9be8471c78bf82c69e858292678211535adfba57069a91cd451847c8 | Python | 10,173 | 276 | # 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... |
c65b40833df26afc53264a69f4b0e13316782cd2886aa502342d0209b0853308 | Python | 10,175 | 250 | # object for analysing hit_histograms from cascades run using TraverseDispatcher
import numpy as np
import pandas as pd
from contools.process_matrix import Promat
from contools.traverse import Cascade, to_transmission_matrix, TraverseDispatcher
from joblib import Parallel, delayed
from tqdm import tqdm
class Cascade_... |
72d01911b26388227aec82655ffbbb0f41e9f11ec69c0360d592d82064676f09 | Python | 10,177 | 234 | #!/usr/bin/env python3
"""Install / verify Scenic for the CARLA in use.
Subcommands
detect what Scenic, what CARLA client and what interpreter are present (read-only)
plan print the exact commands for this machine, and why (read-only)
install pip install Scenic into the interpreter that has `carla`
... |
c0adc2616d33b45dcdc7d652c1fee0e719204e306bcb862c2bdad59d15cae49a | Python | 10,177 | 241 | import tqdm
import ipdb
import argparse, sys; sys.path.append('../../..')
import random as rand
import torch
from metrics import *
from graphxai.explainers import *
from graphxai.datasets import load_ShapeGGen
from graphxai.datasets.shape_graph import ShapeGGen
from graphxai.utils.performance.load_exp import exp_exist... |
8de6f29fbd72ddfce140b9cbd51f1c1e8e95871bfd4cf155b5c3bbc2203d8368 | Python | 10,182 | 204 | #!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 25 10:03:59 2021
@author: paulmueller
Takes a configuration file as first argument and datafiles as the others to calculate autocorrelation functions and
crosscorrelation functions from the data. Then calculates lrtc and lrsc measures from these.
"... |
d793fa03a593a845fbd9e00f10890de673bc5c7b77271505b1784ed9a62c0211 | Python | 10,185 | 236 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
ce6bbf06ae7b0c94999dda5b5e3ae24f423c6458368f336226c31e6c1dcd964c | Python | 10,189 | 233 | """Coordinate-conversion tests, pinned against the installed carla wheel."""
import math
import numpy as np
import pytest
from scipy.spatial.transform import Rotation
import carla
from carla_cosmos import coords
def _random_transforms(n: int, seed: int = 42):
rng = np.random.default_rng(seed)
for _ in rang... |
7f03066784226d409f958e5b8575e43ab7fbec955a21a9ca4f1c003e87b7f62f | Python | 10,196 | 221 | ####################################################################################################
# Copyright (c) 2016 - 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 ... |
b737ddf916142fa02477bd13f11edac1ac8eddb2dec5cf5c304831b2bf0d9377 | Python | 10,196 | 204 | # 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... |
239f15c7f025cf8c38f41a3b0e024b148134c21191ed1abc710e0de821b2ed4d | Python | 10,198 | 288 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import torch
# transpose
FLIP_LEFT_RIGHT = 0
FLIP_TOP_BOTTOM = 1
class BoxList(object):
"""
This class represents a set of bounding boxes.
The bounding boxes are represented as a Nx4 Tensor.
In order to uniquely determine the bou... |
f24a8c8d9c645321d6536eb35ff8580283a413484eb38fa84f528158fcf5c8c0 | Python | 10,198 | 264 | # 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... |
2150b469e818e72bef7dd8328672634c8301eaccf792c998ca9dd050836a0146 | Python | 10,204 | 411 | # %% [markdown]
# # THE MIND OF A MAGGOT
# %% [markdown]
# ## Imports
import os
import time
import warnings
from itertools import chain
import colorcet as cc
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.transforms as transforms
import numpy as np
import pandas as pd
import seaborn as sns... |
c67709834717610c86cbf7c49c0cd075f1b0838c0ef36906e4c9acb7e1e458a2 | Python | 10,206 | 252 | ##########################################################
## ccAF: classifiersV3.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ ... |
5d0979d1b5b4b327ba93af2ac968ecfc42bf132f1403f8fcabe2e88a3a27302c | Python | 10,212 | 244 | # Copyright 2021 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... |
2ac2368c7e237d04c2e743721f2578991a49ca735fba8ecaa38cced347835286 | Python | 10,214 | 265 | #!/usr/bin/env python3
#
# Copyright (c) 2019 Institute for Basic Science
#
# 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 limitation the rights
# to u... |
a14be6d20e5a3aaa3ec88fa98103a60bd1079ae1d2951cdd262e6302236e0c77 | Python | 10,214 | 244 | # python 3.7
"""Contains the generator class of StyleGAN.
This class is derived from the `BaseGenerator` class defined in
`base_generator.py`.
"""
import numpy as np
import torch
from . import model_settings
from .base_generator import BaseGenerator
from .stylegan_generator_network import StyleGANGeneratorNet
__al... |
573653c9ae651bf0ab6e98caa1a5669ac4ade7e4e6c46fc7e8f401d69ddb4ba5 | Python | 10,215 | 346 | import pandas as pd
import logging
import numpy as np
import io
import gzip
from datetime import datetime
def log_message(*message):
"""write message to logfile and stdout"""
if message:
for i in message:
logging.info(i)
print(i)
def get_INFO_annot(df):
"""Return a dataf... |
ae7bf18e3aa5dcaff2dcdeb396d767c0708c6f8f5b304430d3629ce31dd9b147 | Python | 10,218 | 230 | """
Script to compute confusion matrices from one or more pairs of true/pred .npz
files of labels
"""
import logging
import os
import numpy as np
import pandas as pd
from argparse import ArgumentParser
from glob import glob
from sklearn.metrics import confusion_matrix, f1_score, cohen_kappa_score
from utim... |
95696a4f09f6a084973ffa1b7234c53ef4ccda67f546da069fd474ac8ccdeaa8 | Python | 10,219 | 217 | """World-scenario renderer worker: ClipGT Parquet scene package -> per-camera control videos.
Wraps NVIDIA's ``scripts/generate_control_videos.py`` pipeline from
cosmos-transfer2.5 (``load_scene`` -> ``convert_scene_data_for_rendering`` ->
``render_multi_camera_tiled``, moderngl/EGL) in-process, in the ``transfer25``
... |
6d36153eca20d06112f2280c5cf8758a4d502c49e911f094db36efaff54a6600 | Python | 10,226 | 252 | import weka.core.jvm as jvm
from weka.classifiers import Evaluation
from weka.core.classes import Random
from math import log
import time
import os
import csv
import matplotlib.pyplot as plt
import numpy as np
from weka.classifiers import Classifier
from weka.core.converters import Loader, Saver
import itert... |
6b9bdaae42d00195e3e8d1fc0240295d9cdf3cbe7bc8a12c0dc5a808fa89e82d | Python | 10,228 | 209 | import torch
import torch.nn as nn
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.pytorch_distributed_syncbn.syncbn import DistributedSyncBN
batch_norm = DistributedSyncBN
blocks_key = [
'shufflenet_3x3',
'shufflenet_5x5',
'shufflenet_7x7',
'xception_3x3',
]
Blocks = {
'shufflen... |
8ae4b16cf8f403b09c1d810a64c9febff025c4cbf64339c6c33057b7709076c8 | Python | 10,228 | 326 | # Copyright 2021 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... |
146f436a06092ce8ae2f51e330049b869de94119300c832d08eac7352182a8b3 | Python | 10,235 | 260 | from collections.abc import Iterable
import numpy as np
import nibabel as nib
import logging
from tqdm import tqdm
import dipy.data as dpd
from dipy.align import resample
from dipy.direction import (DeterministicMaximumDirectionGetter,
ProbabilisticDirectionGetter)
from dipy.io.stateful_tra... |
f1d368395bbece111614e9157f0e48582aa9e565609e007a499aae8e48ebaf34 | Python | 10,235 | 285 | """Detect logical definitions from lexical elements in an ontology."""
import logging
import urllib
from typing import Dict, Iterator, List, Optional
import yaml
from pydantic import BaseModel
import oaklib.datamodels.obograph as obograph
from oaklib import BasicOntologyInterface
from oaklib.datamodels.vocabulary im... |
08be64664241da5f2aa02e17c345b86284feb7034f41f853b00008f0b4aa043b | Python | 10,238 | 296 | import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import DataLoader, Dataset
import pandas as pd
import numpy as np
import torchvision
import torchvision.transforms as T
from torchvision import models
import pytorch_lightning as pl
from pytorch_lightning.loggers import ... |
9d88da6bfe04fc2d0bfe79d040a94a65fc0168c2b5e0166fb3be01abc0c46075 | Python | 10,238 | 224 | #!/usr/bin/env python3
"""
File: create_replicating_ieqtl_table.py
Created: 2021/01/27
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 ... |
1bc12b4075587bf47bb5167e6d30ced5c18bca3a6f46fce36e666028dfa64f1d | Python | 10,241 | 243 | ####################################################################################################
# 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 ... |
6f5b719afd1d4f187ceb540ddb99575f0a91269ca161df6d9f580da3dddf1ad9 | Python | 10,243 | 225 | #%%
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from pymaid_creds import url, name, password, token
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import connectome_tools.celltype as ct
import connectome_tools.process_graph as pg
import connectom... |
5df5575960028d22aded3169791f67a42760b565b66697eb5910bc047255d7b2 | Python | 10,253 | 277 | import math
import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from .layer_factory import HEAD_OPS, AGG_OPS
from ..rl.genotypes import HEAD_OP_NAMES, HEAD_AGG_NAMES
from maskrcnn_benchmark.layers import Scale
class MicroHead_v2(nn.Module):
"""
Simplified head arch which is used to... |
74b90b0964c046fbc6968bb7be72745e9ff5e5bc8591bba3530bd6a3bb3ef101 | Python | 10,253 | 257 | """
This module provides the BedFileSampler class.
"""
from selene_sdk.samplers.samples_batch import SamplesBatch
import numpy as np
from .file_sampler import FileSampler
class BedFileSampler(FileSampler):
"""
A sampler for which the dataset is loaded directly from a `*.bed` file.
Parameters
--------... |
b26848952bd6a81c6de4cb9f22cfe1291b18d6ebead9a233c08de0a148baaaf8 | Python | 10,254 | 360 | #%%
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/')
f... |
0628b3494e32c99bcac66c2e1a9d897f4a1b6aba24415244fdb53d1d094ac39b | Python | 10,255 | 246 | ####################################################################################################
# Copyright (c) 2019, Ecole Polytechnique Federale de Lausanne / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoV... |
0bd489da90043eefc9a4019a3339f1fea9ec08aa7f941ed9e9c1e56d8b7c697b | Python | 10,257 | 308 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module with function useful for "cuts" of ROIs.
Cuts are a linear separation of an ROI into 2 ROIs, effectively making 2 axons
out of it.
/!\ It assumes ROIs elongated vertically. If they are horizontal, the code is
unable to guess which is the same side (it simply ... |
ff03852a45445476521481cfe70def71b4f017a139bc2b08f22a22e1b1d35225 | Python | 10,260 | 251 | import datetime as dt
import logging
from typing import Any
from PyQt5.QtBluetooth import QBluetoothDeviceDiscoveryAgent, QBluetoothDeviceInfo
from PyQt5.QtCore import QObject, QUuid, pyqtSlot, QAbstractItemModel, QModelIndex, pyqtSignal, Qt
import SensorChannel as sc
import SensorServiceDriver as ssd
import drivers.... |
474f96395264f71ebb1adbc2c2c8199cd487bf4e4e4a6462be6a0c05561108c6 | Python | 10,265 | 204 | import torch
from .vae_basic_model import VaeBasicModel
from . import networks
from . import losses
from torch.nn import functional as F
from sklearn import metrics
class VaeAlltaskModel(VaeBasicModel):
"""
This class implements the VAE multitasking model with all downstream tasks (5 classifiers + 1 regressor... |
5c062aa1b5a2e398b2149b249bad61fa78960283d4c0a6f9f8f33d40939ab1f6 | Python | 10,266 | 269 |
from nibabel import load
import os
import numpy as np
import scipy
import csv
import math
import scipy.stats
import glob
from scipy import ndimage
import copy
import random
#Function to get the indices of target value within given list
def findInd(List,Value):
return [i for i, x in enumerate(List) if x == Value]... |
7bf08c1d1c408ea994e475ec7843bd5563555a36f50d01b940acfb94c34df394 | Python | 10,266 | 224 | #!/usr/bin/env python3
"""
File: create_replicating_ieqtl_table.py
Created: 2021/01/27
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 ... |
83fc500258c19a4cb17cec8954ed6338b9c00144563b5669c881918cd1a84ca8 | Python | 10,266 | 230 | # Copyright 2023 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... |
f258a309a0767ea53f6cbcc76a3f9da11e631991a21849f9eb4dcae0f6b54e8a | Python | 10,266 | 379 | # %% [markdown]
# # EDA on full brain Drosophila larva connectome
# %% [markdown]
# ## Definitions
#
# **G**: the raw-weight graph for the full graph.
#
# **Gaa**: the raw-weight graph for axo-axonic synapses.
#
# **Gad**: the raw-weight graph for axo-dendritic synapses.
#
# **Gda**: the raw-weight graph for dendro-d... |
3c30e3ee8853f85e334ab44e02e94d61259353ebf5fe43bcc5de9180c2e4f75b | Python | 10,270 | 237 | """Command line client for preprocessing Finnish parliament transcripts."""
import json
from dataclasses import asdict
from logging import Logger
from pathlib import Path
from typing import IO
from typing import Any
from typing import List
from typing import Set
from typing import Tuple
from typing import Type
from typ... |
8040c874b2d74ab190bb42da5146407ca48b4831dab7a733b2b8b0a7d99a43f4 | Python | 10,270 | 238 | # Copyright 2021 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... |
93df49a5c53b60ee3f96a875d9323948ed919e1e44451c963d0d19c365195341 | Python | 10,279 | 226 | # Copyright (c) 2016, Konstantinos Kamnitsas
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the BSD license. See the accompanying LICENSE file
# or read the terms at https://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_im... |
c003a82a4605619adaa62729de19386f0de0a4bcc4d4a658907f54e23f960431 | Python | 10,280 | 224 | rule process_scores:
input:
alignments=expand('alignments/{{run}}-{sample}.bam',
sample=REFERNCE_TRANSCRIPTOME_SEQS),
blacklist='refs/badtranscripts.txt'
output: 'tables/alignment-scores-{run}.txt'
run:
import pandas as pd
import subprocess as sp
... |
1ed19d0e98b54d41ed8703536e5dd89abcda9d6dbc6744d40c7c43de4a7b044f | Python | 10,285 | 303 | # This computer git repos
from project.project_base_module import ProjectBase
from project.project_utilities_module import ProjectUtilities
from context.context_module import Context
from data_io.data_io_module import DataIO
from construction.connection_translation_module import ConnectionTranslator
from analysis.analy... |
f48dc57917a060cf14d033f75ab13ce737c085ff1f66e4729fdc79b205e83e75 | Python | 10,285 | 274 | #!/usr/bin/env python3
"""
File: visualise_decon_eqtl_betas.py
Created: 2021/09/07
Last Changed: 2021/10/07
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
th... |
d79d3bcedfe139d69e2b482639427ddd9a5e55904c7d482efe92842afe1efcb3 | Python | 10,286 | 255 | import sys
import os
import os.path
import glob
import logging
import argparse
import numpy as np
import torch
from load_data import DATA, PID_DATA
from run import train, test
from utils import try_makedirs, load_model, get_file_name_identifier
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
# a... |
e99c7a3004a797e00b3723344ab0c3c0dc102339453b1433d977eb3a0a5952d1 | Python | 10,287 | 311 | # coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
cdc9d4c2f98add360da84e1ef040592f2fbd9aabad1397e97f20088833655734 | Python | 10,288 | 254 | # python 3.7
"""Utility functions to invert a given image back to a latent code."""
from tqdm import tqdm
import cv2
import numpy as np
import torch
import clip
from models.stylegan_generator import StyleGANGenerator
from models.stylegan_encoder import StyleGANEncoder
from models.perceptual_model import PerceptualMod... |
093f317fd1934ab3c95bdfa78108047eb4a82d8a5a80a21f2e45066031e15448 | Python | 10,293 | 243 | ###################################################################
####
#### Version: 1.1.7
#### Date: 6/24/2023
#### Description: This file contains the class definition for the location object.
#### Author: Evan Cobb
####
###################################################################
import sys
import globvar... |
f421efd8d0f5de60ba356beb1c581d8a2bc19a248b7109c3fd76a24c7171d975 | Python | 10,293 | 217 | import torch
import torch.nn as nn
batch_norm = nn.BatchNorm2d
blocks_key = [
'shufflenet_3x3',
'shufflenet_5x5',
'shufflenet_7x7',
'xception_3x3',
]
Blocks = {
'shufflenet_3x3': lambda prefix, in_channels, output_channels, base_mid_channels, stride, bn_training: conv1x1_dwconv_conv1x1(prefix, in_... |
ef253272fc0991274e46621b88cd098bef7170d7191a69eb7974d9ff71c18632 | Python | 10,297 | 359 | # %%
import os
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import ortho_group
from sklearn.model_selection import ParameterGrid
from sklearn.neighbors import NearestNeighbors
from tqdm import tqdm
from graspologic.align import OrthogonalPro... |
a58407f8921342d476bfd90e4997fb45ae6b1742ba80875a82d8b13992b97a0c | Python | 10,305 | 244 | import tqdm
import ipdb
import argparse, sys; sys.path.append('../..')
import random as rand
import torch
from metrics import *
from graphxai.explainers import *
from graphxai.datasets import load_ShapeGGen
from graphxai.datasets.shape_graph import ShapeGGen
from graphxai.utils.performance.load_exp import exp_exists
f... |
afbec9151ec4f1f76040af92689f89accf1e5ee1544790bff6c60aa3dd152281 | Python | 10,310 | 238 | # 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... |
b2f727853f998dae4abb39b7fd24a457062c9764b092e2e96ad217d83d625983 | Python | 10,315 | 265 | from __future__ import absolute_import
from __future__ import division
from builtins import next
from builtins import zip
from builtins import range
from past.utils import old_div
from builtins import object
import itertools as it
import abc
import numpy as np
import sima
from . import _motion as mc
from future.utils... |
509090ffef77da0b38d0b61ed18ebcf671026030e96719f975762e70486e0b26 | Python | 10,321 | 321 | # Copyright (c) Open-MMLab. All rights reserved.
import os.path as osp
from collections import OrderedDict
import cv2
from cv2 import (CAP_PROP_FOURCC, CAP_PROP_FPS, CAP_PROP_FRAME_COUNT,
CAP_PROP_FRAME_HEIGHT, CAP_PROP_FRAME_WIDTH,
CAP_PROP_POS_FRAMES, VideoWriter_fourcc)
from mmcv.... |
7004a5d06370fd193831a9c1ad9ed764d0f71004b329ab12fe9108eee81a5e55 | Python | 10,321 | 334 | #!/usr/bin/env python
from __future__ import print_function
from pylauncher import *
import pylauncher
import sys
import os
import errno
def make_path(path):
try:
os.makedirs(path)
except OSError as exception:
if exception.errno != errno.EEXIST:
raise
elif not os.path.isdir(path):
raise
def tail(n, fil... |
a3b0fa29eb7fa052f91ed03739f5fe167153a6d47f2d04ac256f55a639604ae7 | Python | 10,321 | 319 | """
Training script for Burgers equation using Physics-Informed Neural Operator (PINO).
This script trains a neural operator on the 1D time-dependent Burgers equation
using physics-informed loss functions and advanced loss aggregation methods.
The script supports both Relobralo and SoftAdapt loss aggregation strategie... |
052c1ac72da80d13dd6c4efb2bcf4eba0d89cd3b9931bd5423988a42ecab639f | Python | 10,325 | 204 | import math
import unittest
import numpy as np
from alpamayo_coordinates import carla_rotation_matrix
from alpamayo_rig import (
BODY_CLEARANCE_CAMERA_INDICES,
CAMERA_RING,
CARLA_THIRD_PERSON_CAMERA,
body_clearance_z,
)
# Rotation block of ``carla.Transform.get_matrix()`` for the front-wide camera,
... |
c798af40a7b7ef39aa23349fc57d2d396de9fe0bafd20ed6f964ccc253cc0c11 | Python | 10,327 | 235 | from gssc.networks import ResSleep, SleepGRU
import numpy as np
import pickle
import torch
from torch.utils.data import DataLoader, SubsetRandomSampler, Subset
from torch.nn import NLLLoss
from torch.optim import AdamW
from torch.nn.init import kaiming_normal_, constant_
from gssc.utils import make_blueprint
import arg... |
02430bcd39c71ffa014416a49a8fae0e4ad9cd4bf692210bc6dce7c6b832e988 | Python | 10,328 | 250 | import copy
import logging
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import kaiming_init
from mmdet.models.registry import BACKBONES
from tools.apis.param_remap_search import remap_for_archadapt
from tools.multadds_count import comp_multadds_fw
from .operations import... |
64e84259af58ce1803d32ffac2244b90d3bd34c0765cbfcacc363cfec308ed1d | Python | 10,333 | 313 | """
File: qvalues.py
Created: 2020/07/21
Last Changed: 2020/07/22
Author: M.Vochteloo
This is a custom written Python implementation of R Bioconductor’s qvalue
package Version 2.22.0. Qvalues is written under the GNU LESSER GENERAL PUBLIC
LICENSE. A copy of the GNU LESSER GENERAL PUBLIC
LICENSE can ... |
ea80d850dfecc4453599014e34a4fae6b017abf4e2a97199f9b462b937699391 | Python | 10,338 | 310 | """BIDS functions for phys2bids package."""
import logging
import os
from csv import reader
from pathlib import Path
import yaml
from phys2bids import utils
LGR = logging.getLogger(__name__)
# fmt: off
UNIT_ALIASES = {
# kelvin: thermodynamic temperature
'kelvin': 'K', 'kelvins': 'K... |
2bda76d8b10289d1880842449c1b66de92b03d0fe724b5259cc59744950895ee | Python | 10,341 | 230 | #!/usr/bin/env python3
"""Generate an Autoware pointcloud_map.pcd for the CURRENT town of a running
CARLA server by sweeping the waypoint graph with a ground-truth ray-cast lidar.
Method
------
1. ``world.get_map().generate_waypoints(step)`` covers the whole road network.
2. Capture poses are picked from those waypoin... |
3b5134d78ecfda38e5382454840b6306e592fd6627ad0b98add7224d5cc79efb | Python | 10,347 | 231 | import tqdm
import ipdb
import argparse, sys; sys.path.append('../..')
import random as rand
import torch
from metrics import *
from graphxai.explainers import *
from graphxai.datasets import load_ShapeGGen
from graphxai.datasets.shape_graph import ShapeGGen
from graphxai.utils.performance.load_exp import exp_exists
f... |
0fcd17b5da94113ad0b0ba8d638b83a46ec318a3feac79d0e8c3536e1866b976 | Python | 10,359 | 337 |
# coding: utf-8
# In[7]:
from __future__ import print_function
pool_size = 5
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
np.unique(df['Multi_Spike_0_Cluster'])[:10]
# In[8]:
feature_count = 39
predict_column = -2
#column_vector = [1] * feature_count
#target_clust... |
67c4612303de5001adc09ba2876f81eb1f93c06efd80b87735ab79546e34fff8 | Python | 10,359 | 337 |
# coding: utf-8
# In[7]:
from __future__ import print_function
pool_size = 5
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
np.unique(df['Multi_Spike_0_Cluster'])[:10]
# In[8]:
feature_count = 39
predict_column = -2
#column_vector = [1] * feature_count
#target_clust... |
bc483175e43f1acd8d4c3af13313d6f1511e9876768a92475a73961608596308 | Python | 10,359 | 337 |
# coding: utf-8
# In[7]:
from __future__ import print_function
pool_size = 5
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
np.unique(df['Multi_Spike_0_Cluster'])[:10]
# In[8]:
feature_count = 39
predict_column = -2
#column_vector = [1] * feature_count
#target_clust... |
f563d5fc4e02dd141dbf540472cb6d858deeea082320eeaf1b715044c266f72c | Python | 10,359 | 337 |
# coding: utf-8
# In[7]:
from __future__ import print_function
pool_size = 5
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
np.unique(df['Multi_Spike_0_Cluster'])[:10]
# In[8]:
feature_count = 39
predict_column = -2
#column_vector = [1] * feature_count
#target_clust... |
e3e999a78e0e011f3b1788e523d14ec7b6e352e003d7f89fbd06e2ff79cb712c | Python | 10,360 | 336 | #%% Imports and file loading
from pathlib import Path
import glob
import json
from os import listdir
from operator import itemgetter
import pandas as pd
import networkx as nx
import numpy as np
from graspy.plot import gridplot
from src.data import load_networkx
# File locations
base_path = Path("./maggot_models/data/... |
fbff2e7be6f63c986e6474ba89644c9544f235d1b83c17230768be78df3ca8e4 | Python | 10,360 | 336 | #%% Imports and file loading
from pathlib import Path
import glob
import json
from os import listdir
from operator import itemgetter
import pandas as pd
import networkx as nx
import numpy as np
from graspy.plot import gridplot
from src.data import load_networkx
# File locations
base_path = Path("./maggot_models/data/... |
93b57d44e0ff4f246aaa28baa771a21638f082c78fde0ae4dcb7f0519fa7462c | Python | 10,363 | 338 |
# coding: utf-8
# In[2]:
from __future__ import print_function
pool_size = 5
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
#df
np.unique(df['Multi_Spike_1_Cluster'])[:10]
# In[6]:
feature_count = 39
predict_column = -1
#column_vector = [1] * feature_count
#target_c... |
e2442bc81e7dc061d7ced270b164cff830d1f79f24a9845585033b783f39799c | Python | 10,363 | 338 |
# coding: utf-8
# In[2]:
from __future__ import print_function
pool_size = 5
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
#df
np.unique(df['Multi_Spike_1_Cluster'])[:10]
# In[6]:
feature_count = 39
predict_column = -1
#column_vector = [1] * feature_count
#target_c... |
00d87a531a353520b0b32f8bd8ab1211291ea4d74dc20b98626e366ab028245b | Python | 10,364 | 237 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Module for the output selection window widget.
In this GUI page, the use will have to select which data to continue with between
raw data, cross-correlation registered data, and optic flow warped data.
Created on Wed Jun 19 11:48:44 2019
@author: nicolas
"""
import ... |
2ab527c35d290fc64cde0c29513db087910c10c3df499a619404d44a4f494397 | Python | 10,372 | 312 | import torch_geometric.transforms as Transforms
from torch_geometric.data import Dataset
import numpy as np
from ..simulation.diffusion_models import generators, params_sampler
from ..simulation.traj_tools import *
from ..data.data import TrajData
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats impo... |
d15945a41b542ee5a27d2e004ab2d7a8e8722ab4e1df80df038a17aef4093d27 | Python | 10,372 | 202 | import os.path
from datasets import load_file
from datasets import get_survival_y_true
from datasets.basic_dataset import BasicDataset
import numpy as np
import pandas as pd
import torch
class CDataset(BasicDataset):
"""
A dataset class for miRNA expression dataset.
File should be prepared as '/path/to/da... |
aa1ef6c5627a0752d9f3611d8bd633662f93b3a3d25fa00cdbf485e20f107fb9 | Python | 10,373 | 337 | #!/usr/bin/env python
"""
trajUtils.py -- functions to compute some common values on
trajectories
"""
# Numeric
import numpy as np
# Uniform filter
from scipy.ndimage import uniform_filter
# DataFrames
import pandas as pd
#########################################
## OPERATIONS ON TRAJECTORY DATAFRAMES ##
#####... |
fef94ff5976f45c25090b10852922599cf6bef289c27cb46e18802d90ac0b0dd | Python | 10,380 | 388 | #%% [markdown]
## Matching ALPNs
#> Exploring the use of quadradic assignment problem solvers to match neuron morphologies.
#- toc: true
#- badges: true
#- categories: [pedigo, graspologic, graph-matching, drosophila]
#- hide: false
#- search_exclude: false
# %% [markdown]
# ## Load the data
#%%
# collapse
import datet... |
26b9e193e90cb345ae94165848dcb53358a106019dea22a41c0e59c0dddbb209 | Python | 10,382 | 241 | '''
LEGACY VERSION. The new one is faster.
Define coupling and driving force based on hydrodynamic simulations of cilia.
- Sum up pair-wise interactions
- Assume that self-friction doesn't depend on phases of neighbouring cilia.
Can change function `define_gmat_glob_and_q_glob` s.t. it doesn't need e1,e2, a:
- Load w... |
59a5e6c7e11821479344daf75c5f22000a7b9f7708b0ae3499e8a153a3e3f6e0 | Python | 10,386 | 342 |
# coding: utf-8
# In[19]:
#from pandas import DataFrame
#import numpy as np
#df = DataFrame.from_csv('pca_normed.csv')
#np.unique(df['Multi_Spike_Cluster'])
# In[26]:
from __future__ import print_function
pool_size = 15
feature_count = 39
predict_column = -3
#column_vector = [1] * feature_count
#target_clust... |
4ae3b6f2db2ae6fa6f23ae18e168f2af7e5d44e9569ecbddc3a5007aa520025c | Python | 10,392 | 252 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
cb56e74630bdff582e8e611f4d5cecb8249d53cce7aa8cb2077168f4700c6caf | Python | 10,392 | 289 | # 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... |
3db5b1b70d6f85639165e9798100900cc47facb6fef8daa1923a1b39aced5d45 | Python | 10,397 | 290 | import sys
import time
import torch
import random
import argparse
import numpy as np
from model import *
from utilities_gru import *
from scipy.linalg import block_diag
from torch_geometric.data import Data, DataLoader
from torch_geometric.utils import to_dense_adj
def run():
# Parser options
parser = argparse... |
33bd87436059d63283dc2a9f9f6a818ec428c06eb1dbac8da991f6485681a6e7 | Python | 10,410 | 341 |
# coding: utf-8
# In[2]:
from __future__ import print_function
pool_size = 10
from pandas import DataFrame
import numpy as np
df = DataFrame.from_csv('pca_normed.csv')
#df
np.unique(df['Multi_Spike_1_Cluster'])[:10]
# In[6]:
feature_count = 39
predict_column = -1
#column_vector = [1] * feature_count
#target_... |
75eca89ca01c93ba11afd11cf139973430b3810e4e994725334570967d3b02bc | Python | 10,414 | 407 | # %% [markdown]
# # Signal flow of the Drosophila larva brain
# %% [markdown]
# ## Imports and functions
from operator import itemgetter
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from graspy.embed import LaplacianSpectralEmbed
from graspy.plot ... |
251d42279c32c171ae97d1998529aa9f6c473cf97bdfb959b6515acb70ef5fe3 | Python | 10,417 | 248 | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class ConvBlock(nn.Module):
def __init__(self, in_planes, out_planes, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Conv2d(in_planes, out_planes, 3, stride=stride, padding=1, bias=False)
self.bn = ... |
eee98a86b6487c1637216a0fec5ba6bc8d1b14b09f5b57e416e2297f60bc2032 | Python | 10,420 | 283 | import numpy as np
import torch
from sklearn.utils.random import sample_without_replacement
from graphxai.utils import check_random_state
def _generate_hypercube(samples, dimensions, rng):
"""
Returns distinct binary samples of length dimensions.
"""
if dimensions > 30:
return np.hstack([rng.... |
fca5553c9c9da121209c58ca5a969e40b05ce0cd4e73726dc89460da50ddbfb6 | Python | 10,420 | 305 | """
The preprocessing module contains functions to preprocess fNIRS signals.
"""
import warnings
from os import path
import numpy as np
import pandas as pd
from scipy import interpolate
def _extinctions(wavelengths, table='wray', verbose=True):
"""
Get molar extinction coefficients for oxygenated hemoglobin... |
2902a6b6838db2eb44d317bf71af3633d082d8eaf6ef211a86690b326ad1f146 | Python | 10,421 | 397 | #%%
from operator import itemgetter
import networkx as nx
import numpy as np
import pandas as pd
from bokeh.embed import file_html
from bokeh.io import output_file, output_notebook, show
from bokeh.layouts import gridplot
from bokeh.models import ColumnDataSource, FactorRange, Legend, Span
from bokeh.palettes import... |
9c6c054945725ec7fe63c848e3ec65b05d725dc9d899996edd80e49936b447bc | Python | 10,421 | 229 | #!/usr/bin/env python3
# Copyright 2019 Zili Huang
# This script is evoked by diarization/VB_resegmentation.sh. It prepares the necessary
# inputs for the VB system and creates the output RTTM file. The inputs include data directory
# (data_dir), the rttm file to initialize the VB system(init_rttm_filename), the dir... |
77ac3f00a50dcfddc5f4ca8826b6c11b821bf2976636eb4cb871ee77dffa8c4f | Python | 10,422 | 251 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
__all__ = ["ENet"]
class ENet(nn.Module):
def __init__(self, classes=2, aux=True, only_encode=False):
super(ENet, self).__init__()
self.state = only_encode
self.encoder = Encoder(classes... |
bad0bdef58102415eab8d0e34e99c66f3e79fe8c1dd5acdcc4bcce016dd12718 | Python | 10,425 | 256 | # 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... |
a5036575bebd92e6273c0094d2bb896a6ead01a459a9a6ca339c614914cfd319 | Python | 10,427 | 302 |
from numpy import random
import math
import numpy as np
import matplotlib.pyplot as plt
import copy
def tree_array(m,p,b):
'''
Simulate a tree like gene expression matrix
:param m: number of mutations per bifurcation
:param p: number of genes
:param b: number of bifurcations
... |
e4c773a73f09077892a91e52d61719b247877619645221d36ee18a189746fb5e | Python | 10,438 | 236 | # Allen Institute Software License - This software license is the 2-clause BSD
# license plus a third clause that prohibits redistribution for commercial
# purposes without further permission.
#
# Copyright 2017. Allen Institute. All rights reserved.
#
# Redistribution and use in source and binary forms, with or withou... |
d56fea83db644b34695619a85cf815d7976c9839bc50fbe48827ced2522a03ad | Python | 10,442 | 254 | """
Loading Data
============
In this tutorial we demonstrate the various options for loading data. This tutorial covers:
1. The Data Class
2. Getting Example Data
3. Loading Data in NumPy Format
4. Loading Data in MATLAB Format
5. Loading Data in fif Format
6. Loading Data in txt Format
"""
#%%
# The Data class
# ^... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.