sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
561f605f2b3276c5e4d88c326c395bd03ad2972005503f93a27e6732590b9337 | Python | 13,926 | 283 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import torch
import math
from torch import nn
from torch.nn import init
from torch.nn.modules.utils import _triple
from dcn.functions.deform_conv_func import DeformConvFunction
class De... |
60689c132fb64f3258d8eef6849e3773fefeef8ab2613b5806548a959dbb1fc3 | Python | 13,929 | 281 | import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, GlobalAveragePooling2D, Flatten, GlobalMaxPooling2D, AveragePooling2D
from tensorflow.keras.layers import *
from tensorflow.keras import Model
from tensorflow.keras import regularizers
import logging
import sys
logging.basicConfig(stream=sys.std... |
1080196da1c6fb5ea34d1129a17df5af71881889489f1840476e65c1b92348ab | Python | 13,931 | 414 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test implementation using cell models of the Blue Brain Project with LFPy.
The example assumes that the complete set of cell models available from
https://bbp.epfl.ch/nmc-portal/downloads.html is unzipped in this folder.
Execution:
python example_EPFL_neurons.py
... |
adf0c1b82580dc7cc52e625218092f9ec00698e1fdcd07e54860ff8019849af6 | Python | 13,941 | 425 | # coding=utf-8
# Copyright 2026 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... |
77591b7996934acb30cbf4da1954a09e10f2ab8c16dcfe9a9e7d8b7a27d78db1 | Python | 13,943 | 394 | import numpy as np
import pandas as pd
import neuprint as neu
import networkx as nx
from .janelia import JaneliaDataSet
from .scenes import HEMIBRAIN_MINIMAL_SCENE
from .ds_utils import (
_get_hemibrain_meta,
_get_neuprint_hemibrain_client,
_get_hemibrain_types,
_get_hb_sides,
_add_types,
_pars... |
a5d3fd8f4425cd58941c343b6d9aba14cd5324448d26a0fc71158ae456eb5f4e | Python | 13,944 | 375 | from unittest.mock import patch
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import pytest
from scipy.integrate import trapezoid
from SurvivalEVAL import (
CompetingRisksEvaluator,
SurvivalEvaluator,
aj_calibration,
aj_calibration_per_event,
)
@pytest.... |
51b27ded2cc89cc6e6562c23368e45f4b0e17969a70f3a5dbd27cb4c36cabcaa | Python | 13,948 | 335 | """
Unsupervised and deterministic classification test for HAC algorithm
Input: - The STAR file with the particles to classify
- Ground truth mask
- Classification parameters
Output: - A set of STAR files with the new classes
- 2D rotational averaged around membrane n... |
e89b8f8891504fcea5e7986993f1bfdf621c3a81f603101f5b5ab50bc31cec17 | Python | 13,954 | 333 | # -*- coding: utf-8 -*-
"""
Created on Fri May 13 11:53:14 2022
@author: Dalton
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import dill
import os
import glob
import seaborn as sns
from scipy import sparse
from scipy.ndimage import gaussian_filter
from sklearn.metrics.clust... |
713ffcd265909c52dd10bb77e01a0ead704b3fb78a0c33afdbd36c1541f6af64 | Python | 13,956 | 357 | #https://github.com/sanghvirajit/Medical-Image-Classification-using-CNN/blob/main/Medical_Image_Classification.ipynb
#Fixing issues faced during installation of libraries###
## cv2: https://stackoverflow.com/questions/63732353/error-could-not-build-wheels-for-opencv-python-which-use-pep-517-and-cannot-be
#pip3 inst... |
85164f8b5eb8c091c561e43bfb122c887fef6916c759ef8e69762372c54ad45e | Python | 13,959 | 345 | # Node-group asset "Style HBonds" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# _build_group() is the source of truth: the docstring, __init__ and accessors are regenerated from it on the next dump.
import math
from typing import TY... |
94c40ba122bc55e644ee640a768ae8d92198c80ca674fdf28c24ac46118fb6ac | Python | 13,962 | 375 | import yaml
import numpy as np
import pickle
import os
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, Subset
from torch.utils.data.dataset import Dataset
import torch.nn.functional as F
import torchmetrics
import tqdm
from matplotlib import pyplot as plt
from matplotlib.ticker import Multip... |
a912a1dfa45a7f6bcbc0f0f5c44d180cb4f950430edae0f07cdc7ff7293e3020 | Python | 13,965 | 371 | """
Script for studying the averaged neighbourhood of a set of vertices
Input: - GraphMCF (pickle file)
- Reference surface
Output: - 3D graphs (VTK files) with the averaged information
- Vertex normal to reference surface
"""
__author__ = 'Antonio Martinez-Sanchez'
# ########... |
dc8e7d8d15a931db0947518ff1de4cdb7d6f4deb570d734163f78c16e0d40c49 | Python | 13,966 | 262 | 4# -*- coding: utf-8 -*-
# @title Hodgkin & Huxley parameters
# @file Hhparam.py
# @author Romain Beaubois
# @date 05 Dec 2022
# @copyright
# SPDX-FileCopyrightText: © 2022 Romain Beaubois <refbeaubois@yahoo.com>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# @brief Class to generates HH ... |
86c646ff859feec6e0acce1e5a5b5dedd6f4c0a55ee314ba834a169c305d56d1 | Python | 13,969 | 411 | import itertools
import shutil
import bpy
import numpy as np
import pytest
from databpy import ObjectTracker
import molecularnodes as mn
from .constants import codes, data_dir
from .utils import NumpySnapshotExtension, sphere_value
@pytest.mark.parametrize("code", codes)
def test_op_fetch(fetch, snapshot_custom: Nump... |
d47c40c9ca73e4720f58335a866eb0c08cc77ce888c3dd3ba23c590c13783cfb | Python | 13,971 | 288 | """
Modules containing function works for:
1. circuit_test: Given single circuit (the connections and weights are fixed)
generate its output on randomly generated input
2. circuit_search: Given only connection information, randomly sample the weights
3. circuit_injected_stimulus: Given ... |
a7cb46bafaf52984f260a4aecfcd5088fda7a85b23a02be352e74baab9fc7834 | Python | 13,974 | 293 | import os
import re
from typing import Callable, Dict, Tuple, Union
import numpy as np
import scipy.io as scio
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
class TSUBenckmarkDataset(BaseDataset):
r'''
The benchmark dataset for SSVEP-Based brain-computer interfaces (TSUBen... |
1a8bea1fb8f5feffd74b73544e60c10d0b84dabf295fc3ccbe2f337145c74b71 | Python | 13,978 | 259 | from eworm.utils import *
import numpy as np
import matplotlib.pyplot as plt
import pickle
from neuron import h, load_mechanisms
import colorsys
import os
import os.path as path
h.load_file('stdrun.hoc')
working_directory = path.join(path.dirname('__file__'), "figs")
electrophysiology_simulation_config = ... |
2b738a29527e9fc048562981cde4ae7ca5d17390b38807f404acd633fcaeaf7f | Python | 13,987 | 402 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import math
import numpy as np
import torch
def random_short_side_scale_jitter(
images, min_size, max_size, boxes=None, inverse_uniform_sampling=False
):
"""
Perform a spatial short scale jittering on the given... |
c2a23d9a2571a634067f66b3759f4443d4da44f5dc53a2ee26f3b4fdd18b58b0 | Python | 13,987 | 331 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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 use, copy, modify, merge,... |
551ec39a5f08d787665475b39a5109f95ce5119ad1813a580ff15a809307d643 | Python | 13,989 | 395 | import os
import collections
from ._common_blocks import ChannelSE
from .. import get_submodules_from_kwargs
from ..weights import load_model_weights
backend = None
layers = None
models = None
keras_utils = None
ModelParams = collections.namedtuple(
'ModelParams',
['model_name', 'repetitions', 'residual_blo... |
de7ad68ffa34f3996dcad6353ee1ccbc186fda775ce0b05948d63fb6d45ab399 | Python | 13,989 | 290 | import os
import logging
from typing import Any, Callable, Dict, Tuple, Union
import numpy as np
import scipy.io as scio
from ..base_dataset import BaseDataset
from ....utils import get_random_dir_path
_log = logging.getLogger('torcheeg')
class BCICIV2aDataset(BaseDataset):
r'''
A dataset for motor imagery,... |
3f60cdcbb7b28f97d94fdbcdd0f4e0c1238b70ff40ac4c492b66cbe1dfb94572 | Python | 13,998 | 354 | import logging
from typing import List, Tuple
import torch
import torch.nn as nn
import torchmetrics
from numpy import random
from torch.autograd.function import Function
from ..classifier import ClassifierTrainer, classification_metrics
_log = logging.getLogger('torcheeg')
class CentersLoss(nn.Module):
'''
... |
4df353a3ff3872b7ccd41f5c68c3639d2fe651dc589e123015e7e31d58bea597 | Python | 14,000 | 362 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
An LFPy example file showing how cells can be run in parallel using MPI.
To run using MPI with 4 cpu cores, issue in terminal
openmpirun -np 4 python example_mpi.py
The example uses mpi4py with openmpi, and do not rely on NEURON's MPI
implementation.
Execution:
<... |
aa74ea8b820c894d5d4c13bb1f74270ddc4ab81d0506cb8f7b84fc517c5afa46 | Python | 14,006 | 373 |
import os
import copy
import numpy as np
import logging
import multiResData as mrd
import PoseTools
import tfdatagen as opdata
import apt_dpk
__all__ = ["TrainingGeneratorTFRecord"]
logr = logging.getLogger('APT')
# Adapter class for use with DeepPoseKit. Some code adapted or taken from DeepPoseKit by Jake Gravi... |
18866d3aedd6e331c2cf3d491b8be58ff4ad8e41231d5e20802f907d8fe5e12f | Python | 14,007 | 512 | # morphoglia/io/overlays.py
from __future__ import annotations
from pathlib import Path
from typing import Iterable, Tuple, Optional
import cv2
import numpy as np
from matplotlib import colormaps
# BGR colors
YELLOW = (0, 255, 255)
GREEN = (0, 255, 0)
RED = (0, 0, 255)
def render_instance_map_diagnostic(
in... |
44560be8774216c1dff5646972f8b7c3e7e98fef0ee5d319f16f7a55d28d75b2 | Python | 14,007 | 443 | from abc import ABC, abstractmethod
from itertools import islice
from operator import itemgetter
from threading import RLock
from typing import (
TYPE_CHECKING,
Dict,
Iterable,
List,
NamedTuple,
Optional,
Sequence,
Tuple,
Union,
)
from ._ratio import ratio_resolve
from .align import... |
2ddb761302caed06e03c4363335a9f0a4315047fdb34452f00ce28d40a164758 | Python | 14,008 | 346 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Copyright (C) 2012 Computational Neuroscience Group, NMBU.
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 the License, or
(at you... |
c64dbc1ec3da13af26e60e98e0cbc8deced99279059d7306a1b91cc269fede27 | Python | 14,011 | 480 | # coding=utf-8
# Copyright 2026 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... |
9aea9f91c5ee59c412b783d1b0c58a70e1fcb72650401675ba1ded87b8c81a9c | Python | 14,012 | 303 | import copy
import unittest
from hed import schema
from hed.errors import ErrorContext, ErrorHandler, TemporalErrors
from hed.models import DefinitionDict, HedString
from hed.validator import DefValidator, HedValidator, OnsetValidator
from tests.validator.test_tag_validator_base import TestHedBase
# Todo: Add test c... |
10a19c4c38abe38ce255a4b6ea26d77731b6d5ed2724758462a4c1061f052807 | Python | 14,013 | 356 | import numpy as np
import pandas as pd
import scipy.sparse as sp
import torch
from torch_geometric.data import Data
from torch_geometric.loader import DataLoader
from scipy.sparse import coo_matrix, csr_matrix
from sklearn.metrics import roc_auc_score, average_precision_score, precision_recall_curve, auc, confusion_mat... |
b6570358a26b48864ef2c4fd6bf77fa4038f5643db4bac0788623e582e631e27 | Python | 14,015 | 408 |
import numpy as np
from bonito.nn import Permute, layers
import torch
from torch.nn.functional import log_softmax, ctc_loss
from torch.nn import Module, ModuleList, Sequential, Conv1d, BatchNorm1d, Dropout
from fast_ctc_decode import beam_search, viterbi_search
class ModelTinyNoSkipX2(Module):
"""
Model temp... |
e2dc954880b3821a67b6e30664806ae7dae121e3bb133796851aada5d7a53dee | Python | 14,016 | 390 | import os
from typing import Dict, List, Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import schnetpack.transform as trn
from ase import Atoms
from matplotlib.ticker import ScalarFormatter
from schnetpack import properties
from schnetpack.data import AtomsDataFormat, load_dataset
from spainn.proper... |
b62cc636ddf7643dc6600e800c51396cb5b40f40ec9d4fdf43ef9ecbed084f32 | Python | 14,017 | 368 | from __future__ import division, print_function
import copy
import numpy as np
from scipy.interpolate import splrep,splev
from scipy.signal import hilbert
from scipy.stats import pearsonr
import matplotlib.pyplot as plt
from soundsig.signal import find_extrema
class IMF(object):
"""
Container class for... |
c3abd80c9b1925e75c51f6df278a1c94a65386dec0f45b73b2b8f21401b3f3df | Python | 14,019 | 361 | import functools as ft
import itertools as it
import math
import random
from typing import Literal
import networkx as nx
import numpy as np
import pandas as pd
from skymap.metrics import SkyMapMetrics
from skymap.utils import (
distance,
gen_beta_moments,
imbalance_distribution,
pmf_disc_beta,
pmf... |
539df8bb0509bdbd391b95e36cbcfde1e309fdd383acc3d3c455f73348bb1c87 | Python | 14,027 | 424 | from dreamcoder.task import *
from dreamcoder.type import *
from dreamcoder.utilities import *
import random
def lcs(u, v):
# t[(n,m)] = length of longest common string ending at first
# n elements of u & first m elements of v
t = {}
for n in range(len(u) + 1):
for m in range(len(v) + 1):
... |
4f6607c285224603d5db58815738d00348f35b458a1f14e8eeaa82859ad7d644 | Python | 14,036 | 286 | import collections
import numpy as np
from ..file_utils import add_end_docstrings, is_torch_available, requires_pandas
from .base import PIPELINE_INIT_ARGS, ArgumentHandler, Pipeline, PipelineException
if is_torch_available():
import torch
from ..models.auto.modeling_auto import MODEL_FOR_TABLE_QUESTION_AN... |
14bff31e95a4feb54e739a03e0aef716720b09ddd6aa6005a8a50bd3e88575ec | Python | 14,041 | 495 | """Module to work with channels.
It provides a general class to work with channels. Channels is the general term
that refers to the points where signal comes from, it's an abstract concept.
Electrodes, magnetometer, axiometers and gradiometers are the actual recording
devices measuring the signal. For example, in the ... |
8a9962855f929dd87aceea4073470670a234a129af287da1d073e4330cfa28bf | Python | 14,042 | 340 | # coding=utf-8
# Copyright 2020 Hugging Face
#
# 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... |
82e73aa3acd51d1020520e387cd945b5a85c9b874e7ea53bdab227a3edd3fb5d | Python | 14,046 | 306 | #This script is used to prepare training dataset for methylation basecaller by extracting raw signal chunks with m6a segments
import re
import os
import h5py
import pysam
import pickle
import editdistance
from Bio import motifs
from Bio.Seq import Seq
from sklearn.mixture import GaussianMixture
from xron.utils.seq_op ... |
32ce076656348c59e0728fc32e81e3ae421833cf43cc3cac4f6081fc3679b87b | Python | 14,049 | 385 | # -*- coding: utf-8 -*-
import gzip
import mmap
import os
import pickle
import shutil
import struct
import sys
import tarfile
import unicodedata
import urllib
import zipfile
from collections import defaultdict
from typing import Any, Dict, Iterable, List, Optional, Set, Tuple, Union
import torch
from omegaconf import... |
365a3bf8bc547a81dc020bf979fa13caafcf5f8985ff2d3139b01136322892d5 | Python | 14,052 | 358 | # regtools/tests/test_registration_batch_2d_cli.py
"""Offline unit tests for the CLI ``--data_type batch_2d`` path
(``regtools.registration.registration_2d.registration_batch_2d``).
These cover two verified bugs in that path:
* Bug 1: ``--rotate/--flip_h/--flip_v`` (and ``--tissuecyte_orient``) were
ignored ... |
e995b74fb317222c644d5c12b30f47565b8ce82b70a5476ef08fa233befb02c8 | Python | 14,053 | 390 | """
Script for finding filaments which though a GraphMCF (parent) interconnects nodes of a thresholded
GraphMCF based of the parent GraphMCF
Input: - Parent GraphMCF (pkl)
- Thresholded GraphMCF (pkl)
- Filament parameters
Output: - GraphMCF thresholded nodes and filaments
... |
f102e987808224c0e2f491c2b1e427a02538684fe65ace6ba98829de7e6ff3e6 | Python | 14,054 | 278 | #%%
import nibabel as nib
import numpy as np
from pathlib import Path
from scipy import ndimage
from PIL import Image
from nilearn import plotting
from matplotlib.colors import LinearSegmentedColormap
import matplotlib.pyplot as plt
its = 1000
YA_n = 244
OA_n = 350
all_n = 594
var_names = 'SC_ne_age_CattellTotal'
ATL... |
9457b553e252c93ebb932a6c5c9c8d04932a408f894deb5b7f4e015c14e9a33a | Python | 14,062 | 352 | """
code adapted from: https://raw.githubusercontent.com/facebookresearch/FixRes/main/imnet_extract/Res.py
"""
import torch
from torch import Tensor
import torch.nn as nn
from typing import Type, Any, Callable, Union, List, Optional
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'r... |
d7e6e0682e1db493c22ec6065d0391d261ee4ce463b9bd6c7ab4dd5d5ffb5e5c | Python | 14,064 | 359 | from __future__ import print_function, division
import numpy as np
import scipy
import time
import os
import datetime
import torch
from learn_tools import helper
from operator import itemgetter
from learn_tools.learner import FAILURE, THRESHOLD, SUCCESS, score_accuracy
#from pybullet_tools.utils import interval_gen... |
f2567216bcd8eeab682a2092924d4db7b82fea13a46dd9cad2358e14a001151b | Python | 14,064 | 308 | #####################################
######## Paper Draft Cartoon ########
#####################################
#%%# Catalyzer
import os
import sys
path = os.path.dirname(os.path.realpath(__file__)) + '/../Resources'
sys.path.append(path)
path = os.path.dirname(os.path.realpath(__file__))
sys.path.append(path)
impo... |
9dacfc80792b3b92416013bf9d6e2f1354247bb5ce256d59f72515f73897eda8 | Python | 14,067 | 311 | import subprocess
import re
import sys
import shutil
try:
FileNotFoundError
except NameError:
FileNotFoundError = IOError
if sys.version_info.major != 2 and sys.version_info.major != 3:
raise NotImplementedError("not suppport Python version: %d" % sys.version_info.major);
def input_param(message):
... |
72ce8038671db703f18b2824da6d5b5feb31862ca69a696a2af327f8dda6c478 | Python | 14,074 | 393 | import pickle as pk
import warnings
from contextlib import chdir
from pathlib import Path
from typing import Dict, Union
import bpy
from bpy.app.handlers import persistent
from bpy.props import StringProperty
from bpy.types import Context
from databpy.object import LinkedObjectError, get_from_uuid
from .entities import... |
3b2467a7273e720fbe1c356652570fca40d4aa290af2bbd729c4ff9066deccad | Python | 14,080 | 284 | # -*- coding: utf-8 -*-
import torch.nn.functional as F
from torch import nn
import torch
class SegmentCACSModel():
"""
SegmentCACS model
"""
def __init__(self):
""" Init SegmentCACS class
:param settingsfilepath: Filepath to settings file
:type settingsfile... |
77b9af9dce711bd4bd7da0a0a41cbafdc02213058bbb23094b1345eb86a97382 | Python | 14,081 | 390 | # coding=utf-8
# Copyright 2026 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... |
e065cb1be10a26e56ce250f589d8aa54dbed2d19fdb03844f730f980cfae9ebe | Python | 14,083 | 436 | #!/usr/env/bin python
# -*- coding: utf-8 -*-
#
# brunel_alpha_nest.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... |
ac0eb56d64b2bf1feca2f3f1ada9e3f5648101dbf5b63b4381fb01f6f72a7f23 | Python | 14,085 | 352 | #----------------------------------------------------------------------------------------------------------------------------
# Author: Brandon S Coventry CAP Lab Purdue University Weldon School of BME
# Date: 09/02/20
# Revision History: 09/15/20 - Adaptation made for multiprocessor use. On a single RX process... |
db03efd915518d121efab5e7311a624d50214f52fb35e9131bf4212f9c0f033b | Python | 14,090 | 381 | """A wrapper around ASE's Vasp calculator that makes it better suited for high-throughput DFT."""
from __future__ import annotations
import os
import subprocess
from logging import getLogger
from pathlib import Path
from typing import TYPE_CHECKING
import numpy as np
from ase.calculators.vasp import Vasp as Vasp_
fr... |
fe43881499dedf19b20349748a8f1ba9cb3a4abde53da250f194c1429732228b | Python | 14,094 | 366 | # Node group ".MN_utils_style_ribbon_nucleic" (GeometryNodeTree), dumped by nodebpy.assets.dump_library.
# Rebuild the library with nodebpy.assets.build_library (nodebpy build).
# Shared by several assets, which import it; not an asset itself.
# _build_group() is the source of truth: the docstring, __init__ and accesso... |
b3eb8536fcdbde8de50a967d4a4a78e3f75b260494dd4f5e465e04e687a7468e | Python | 14,097 | 296 | # -*- coding: utf-8 -*-
"""
VGG-Net for CIFAR-10.
Introduction
----------------
VGG is a convolutional neural network model proposed by K. Simonyan and A. Zisserman
from the University of Oxford in the paper 鈥淰ery Deep Convolutional Networks for
Large-Scale Image Recognition鈥? .
Download Pre-trained Model
-----------... |
cc99cddcb442f3b415a678ce0b1ab93bac93bf2d5b90e7900dab98f90cc299d8 | Python | 14,099 | 409 | import torch
from torch.nn import functional as F
from torch_scatter import scatter_add, scatter_mean, scatter_max
import networkx as nx
from rdkit import Chem
from rdkit.Chem import Descriptors
from torchdrug import utils
from torchdrug.layers import functional
from torchdrug.core import Registry as R
from torchdrug.... |
e10dde9c747f460ff94c28d3f100b42f276ada5fdd78c876622440196e51ccb4 | Python | 14,105 | 122 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
from lab.environments import LocalEnvironment, BaselSlurmEnvironment
from lab.reports import Attribute, geometric_mean
from downward.reports.absolute import AbsoluteReport
from common_setup import IssueConfig, IssueExperiment, DEFAULT_OPTIMAL_SUITE, is_test_r... |
031966ae2932c937ab088793824cbb8ed376e825c6c190004eff8c43431784ee | Python | 14,111 | 382 | #!/usr/bin/env python
# As a module: contains functions for generating and checking Gabor filters
# When this script is run as the main file, it generates Gabor filters and saves them
# Make sure current directory is added in the PATH variable
import h5py
import itertools
import math
import matplotlib.pyplot as plt
im... |
44520bb6bb9476c50f854b94298aab1d51a41ae3d0963414616cc72424c76ac1 | Python | 14,113 | 402 |
import numpy as np
from bonito.nn import Permute, layers
import torch
from torch.nn.functional import log_softmax, ctc_loss
from torch.nn import Module, ModuleList, Sequential, Conv1d, BatchNorm1d, Dropout
from fast_ctc_decode import beam_search, viterbi_search
class ModelTinyNoSkipX011(Module):
"""
Model t... |
733ddd55399336cc6cbcf9ce096595a0dbe5dba7ac2512b63d20ca7c44367ad2 | Python | 14,117 | 451 | #!/usr/bin/env python
#******************************************
#
# SHARC Program Suite
#
# Copyright (c) 2023 University of Vienna
#
# This file is part of SHARC.
#
# SHARC is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#... |
09c6c08833aadec16728c2cf5aedf8f03a1dfb09d16d189ab9a1277150074047 | Python | 14,118 | 344 | """Tissue masking algorithm.
Single-pass pipeline:
multi-Otsu (3 classes) -- pick the lower threshold (tissue/BG)
-> binary_opening -- remove background salt
-> keep largest CC -- one tissue blob
-> binary_closing -- bridge thin cortex breaches
-> binary_fill_holes... |
d93b1e1447d3ca117e8cecba24fb66d12c56c42ff14f33d84b453f8df1c12a7c | Python | 14,122 | 424 | import numpy
import matplotlib.pyplot as plt
import math
import os
import scipy
import scipy.ndimage.filters
import scipy.ndimage.morphology
import skimage.io, skimage.util, skimage.filters, skimage.transform, skimage.feature, skimage.exposure
import sys
import networkx
def detect_local_minima(arr):
# http://stack... |
066c1ac9223fbc32e417bfe8ab2d2c12c7265a4bdd00cabb34c626bfc4ee1894 | Python | 14,123 | 384 | import functools
import logging
import numpy as np
from theano.compat import OrderedDict
from theano import tensor as T
from pylearn2.linear.conv2d_c01b import make_random_conv2D
from pylearn2.models import Model
from pylearn2.models.maxout import check_cuda # TODO: import from original path
from pylearn2.models.mlp ... |
db1cc0ab7f78a3d179de2170882b6be3408ab6c87d85c07dc3a7d75d558af944 | Python | 14,124 | 337 | """
Script for extracting an analyzing a GraphMCF from a segmented membrane (Multiprocessing version)
Input: - A STAR file with a list of (sub-)tomograms to process:
+ Density map tomogram
+ Segmentation tomogram
- Graph input parameters
Output: - A STAR file with the (s... |
49446ef0bab91574c50b27ebd4c7c806b648213471ba1c9f079e35b274a31418 | Python | 14,125 | 352 | from dreamcoder.program import Primitive, prettyProgram
from dreamcoder.grammar import Grammar
from dreamcoder.type import tlist, tint, arrow, baseType #, t0, t1, t2
#from functools import reduce
#todo
int_to_int = baseType("int_to_int")
int_to_bool = baseType("int_to_bool")
int_to_int_to_int = baseType("int_to_int_... |
81ad30c8774b5ce9493fbdebfba536bd83c557420b3fb2fb18b941cb9393ed4d | Python | 14,125 | 292 | """
Modules containing function works for:
1. circuit_test: Given single circuit (the connections and weights are fixed)
generate its output on randomly generated input
2. circuit_search: Given only connection information, randomly sample the weights
3. circuit_injected_stimulus: Given ... |
7b277ed059326abba596f9361161db99f89a8593d3c216a306a3f23bbe59f419 | Python | 14,126 | 431 | import math
import numpy as np
import pandas as pd
import seaborn as sns
import scipy.cluster.hierarchy as sch
import scipy.spatial.distance as ssd
import dash_bootstrap_components as dbc
from plotly import subplots
from dash import dcc, html, Dash, dash_table
from dash.dependencies import Input, Output, State
impor... |
3c60d2812d15b6d9c39d04de4d32fd0595adf1b43de62bc39c5b7f689e9b7c35 | Python | 14,133 | 121 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
from lab.environments import LocalEnvironment, BaselSlurmEnvironment
from lab.reports import Attribute, geometric_mean
from downward.reports.absolute import AbsoluteReport
from common_setup import IssueConfig, IssueExperiment, DEFAULT_OPTIMAL_SUITE, is_test_r... |
88719043841ba9cd884e5bd89f5f8615a9aed007c8fb94a0170c80a04a179423 | Python | 14,134 | 460 | # coding=utf-8
# Copyright 2026 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... |
abbed443a2a9b16bb6f358c00c71e9e70a11e440d9de5672aafce49344ce06a3 | Python | 14,135 | 353 | from __future__ import division
import logging
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from func_unsupervised_TC_shuffled import fit
from IterativeMethod import iterativeTC
"""
Created on Mon Oct 29 13:48:02 2018
@author: Hannah Choi
"""
"""
This code genereates shuffled v... |
3ff7b4f85147fcbd2c0ecf39c33baa3a2add92028cf1cc2dd9549fb9299f2d99 | Python | 14,138 | 346 | """
Copright © 2023 Howard Hughes Medical Institute, Authored by Carsen Stringer and Marius Pachitariu.
"""
import os
from matplotlib import patches, collections
from scipy.io import loadmat
from fig_utils import *
def example_basis_fcns():
kx,ky = np.meshgrid(np.arange(0,31,1,"float32"), np.arange(0,31,1,"float3... |
71de3344e8592aa0c0b16611674bcbd9fbb7e625953f28c5a3bdb2251cb3623a | Python | 14,143 | 416 | """Translation layer between pyproject config and setuptools distribution and
metadata objects.
The distribution and metadata objects are modeled after (an old version of)
core metadata, therefore configs in the format specified for ``pyproject.toml``
need to be processed before being applied.
**PRIVATE MODULE**: API... |
c472e366ca3f20e655d7b9497d367cc146c451c97cde5c93c69b1786aed59b2d | Python | 14,145 | 266 | import copy
import os
import torch
import shutil
import warnings
warnings.filterwarnings("ignore")
import time
from argparse import ArgumentParser, Namespace, FileType
from rdkit.Chem import RemoveHs
from functools import partial
import numpy as np
import pandas as pd
import scipy
from Bio.PDB import PDBParser
from r... |
dede5e9e12fe3c7e74796cee481f1753104285d1b8a435657063795ca75ac4af | Python | 14,146 | 384 | # analog of list.py for regex tasks. Responsible for actually running the task.
from dreamcoder.domains.regex.makeRegexTasks import makeOldTasks, makeLongTasks, makeShortTasks, makeWordTasks, makeNumberTasks, makeHandPickedTasks, makeNewTasks, makeNewNumberTasks
from dreamcoder.domains.regex.regexPrimitives import bas... |
2b4b8cff8811d90c21389d3ff650e8dde3de9f9a317d26a052b534880d7efc43 | Python | 14,147 | 438 | from __future__ import print_function
"""
get_image_size.py
====================
:Name: get_image_size
:Purpose: extract image dimensions given a file path
:Author: Paulo Scardine (based on code from Emmanuel VAÏSSE)
:Created: 26/09/2013
:Copyright: (c) Paulo Sc... |
a78dd6ad4047019e0e6e03b062e69e1ca82098765b35bd425c680446d789c300 | Python | 14,148 | 440 | # coding=utf-8
# Copyright 2026 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... |
ea5d608423325d4228e5493783ec4299d2f9fbb1c16cb9a580588be93dde1bb8 | Python | 14,150 | 330 | import torch
from torch_geometric.loader import DataLoader
from imports.ABIDEDataset import ABIDEDataset,MergedDataset
from imports.utils import train_val_test_split,train_val_split,GHMC
import torch.optim as optim
from torch.optim import lr_scheduler
import torch.nn.functional as F
from gnn import GNN
from GAT import ... |
7b50f697111b488e6e1871130b0b0fbc476502d6bf1c1aadbdc950b48a7db5f5 | Python | 14,153 | 382 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
f65c3ce87a4793539fcccf305fc6411993652e997177b88796a77721eaa3f18b | Python | 14,156 | 482 | from pathlib import Path
import numpy as np
from MDAnalysis import Universe
from MDAnalysis.coordinates.base import ReaderBase
from MDAnalysis.core.topology import Topology
from MDAnalysis.core.topologyattrs import (
Atomids,
Bonds,
ChainIDs,
Resids,
Resnames,
)
# Resnums,
from MDAnalysis.lib impor... |
0b3bd78c32e8d8be16ae1ce2b184ffe9e5a265dc8c5e6887e40d2c96a345b453 | Python | 14,157 | 385 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab.steps import Step
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compa... |
5d063073f69ba1c0faabbae6f0606ca714d2ec5b606afd5f35456a60bd5bb0f3 | Python | 14,159 | 288 | from collections import defaultdict
from pddlstream.algorithms.scheduling.utils import partition_external_plan
from pddlstream.language.constants import get_prefix, get_args, get_parameter_name, is_parameter, Minimize
from pddlstream.language.conversion import substitute_expression, list_from_conjunction
from pddlstre... |
c5ef02728dee82c0a15a80f6729ce87fcb3761f8d0ac985d7815661700516605 | Python | 14,159 | 312 | """
DeepLabCut2.0 Toolbox (deeplabcut.org)
copyright A. & M. Mathis Labs
https://github.com/AlexEMG/DeepLabCut
Please see AUTHORS for contributors.
https://github.com/AlexEMG/DeepLabCut/blob/master/AUTHORS
Licensed under GNU Lesser General Public License v3.0
"""
import wx
import os,sys,pydoc
import deeplabcut
from ... |
9da282468cf7bdd69d79f556517d0658733240fe5fa58b4b12662b14f4197e71 | Python | 14,165 | 296 | import os
from typing import Callable, Dict, Tuple, Union
import numpy as np
import pandas as pd
import scipy.io as scio
from ....utils import get_random_dir_path
from ..base_dataset import BaseDataset
class M3CVDataset(BaseDataset):
r'''
A reliable EEG-based biometric system should be able to withstand cha... |
29fff529694241ef3ef38b370b669abce898bd3d23c27ea05b6fc912713738ce | Python | 14,168 | 351 | # -*- coding: utf-8 -*-
from __future__ import annotations
import os
import queue
import tempfile
import threading
from contextlib import contextmanager
from typing import Dict, Iterable, List, Union
import pathos.multiprocessing as mp
import torch
import torch.distributed as dist
from torch.distributions.utils impo... |
36be7dab38ca59efb5b52b28708d0a313e0581105c72e2e7dd1b642fda6461fc | Python | 14,171 | 458 | import numpy as np
import torch
import h5py
import os
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from sklearn.metrics import euclidean_distances
def mexican_hat(weighted_distance_matrix):
"""
Return matrix of lateral effects between neurons under Mexican Hat effect.
... |
e3af84af6fafcd2224560ba101456bb06b41cb07397a446c19925c87804b2a96 | Python | 14,171 | 385 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
54cb6aa71c42263d7e3f7f874978df0a42f14f4e3574408fdde99375eb0f1629 | Python | 14,180 | 347 | import torch
import torch.nn as nn
from base import BaseModel
class Genomic_Feature_Extractor(BaseModel):
def __init__(self, genomic_dim=20, genomic_embedding_dim=8):
super().__init__()
self.genomic_dim = genomic_dim
self.genomic_embedding_dim = genomic_embedding_dim
self.genomic_... |
5ba4dc20950ad25a189bf17f629838dde50a433a098e20115c43ed9776b087c8 | Python | 14,182 | 384 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
09e08f08d0dbcb322c753ce6b4930c80747cba9f203bbb0890b22124fc3c8a53 | Python | 14,183 | 358 | """
code adapted from: https://raw.githubusercontent.com/facebookresearch/FixRes/main/imnet_extract/Res.py
"""
import torch
from torch import Tensor
import torch.nn as nn
from typing import Type, Any, Callable, Union, List, Optional
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'r... |
05718bc284f87f6d1ecdc8598044f6cf25c5bf4ce07cfd85423bd83587ec8122 | Python | 14,185 | 384 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
0ee617e545b34dd876da20386877443b625e0b02f798f012cbefde4204aedec3 | Python | 14,191 | 358 | """
Script for finding transmembrane high density structures (features)
Input: - Density map tomogram
- Membrane segmentation tomogram
- Segmentation parameters
Output: - Transmembrane MCF graph
- List (.csv) of feature coordinates and properties
"""
__author__ = 'A... |
aa330c21bb750cc1078e4273ebced80e85122e142b205f3f4e90a781a07d6683 | Python | 14,191 | 378 | """Core recipes for espresso."""
from __future__ import annotations
from typing import TYPE_CHECKING
from ase.optimize import BFGSLineSearch
from quacc import job
from quacc.atoms.core import check_is_metal
from quacc.calculators.espresso.espresso import EspressoTemplate
from quacc.recipes.espresso._base import run... |
220840638d321af10cdc8d5523d818dacce6980a81ec4a9d34dcef402dea1c43 | Python | 14,193 | 367 | """Compose registration deformations into a single displacement field.
Given a registration directory produced by the standard pipeline, compose the
three forward-direction transforms - the axis-alignment affine, the ANTs SyN
warp, and the Laplacian pullback - into one dense displacement field on the
template gri... |
f7b0f843c0040dbd24a62ef9bb86d8de9d2fc2283d40bcf7e83231bf42c4d382 | Python | 14,198 | 386 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab.steps import Step
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compa... |
f2de2cfaa75056f5d86ee40ff2664e1bf7db701f574efa0fb8f7b6b1350afff9 | Python | 14,203 | 384 | # -*- coding: utf-8 -*-
import itertools
import os
import platform
import subprocess
import sys
from lab.experiment import ARGPARSER
from lab import tools
from downward.experiment import FastDownwardExperiment
from downward.reports.absolute import AbsoluteReport
from downward.reports.compare import ComparativeReport... |
c7d5d17ed0fbd16201ce1b19a365ed44a736ee087edb28bf2edf14b744ce832f | Python | 14,210 | 346 | #
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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 use, copy, modify, merge,... |
f2abce7e233846d1030a0b99c5124a4c2ff9e5942065a650c01c42ed2d89b2c3 | Python | 14,211 | 294 | """Sliding-window continuous generation: software tests on random tiny weights.
These check bookkeeping (window bounds, reservoir updates, probes, files), not language.
"""
from threading import Event
import numpy as np
import pytest
from conftest import assert_no_hooks
from liquidaion_fly.continuous import (Continu... |
06a1e3ecbec7376705db20f6616a69f523eab7a2d1f7ee597b120fc2c713a435 | Python | 14,215 | 297 | # -*- coding: utf-8 -*-
"""
Created on Thu Apr 13 2023
Main code for manuscript entitled "Multiscale effective connectivity analysis of
brain activity using neural ordinary differential equations"
@author: Yin-Jui Chang (DerekYJC) @ SantacruzLab
"""
#%% Import the required package
import os
impo... |
4514975114153edca9dbb6859c0658d9640cd7bebdb613839b186ec802140ad5 | Python | 14,217 | 313 | # coding=utf-8
# Copyright 2021 The Facebook AI Research Team Authors and The HuggingFace Inc. team.
#
# 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/LIC... |
2111d0e18d2a825b8289f52d999d3596821a85d56bb150640b2c2070a21fc4ed | Python | 14,219 | 448 | import numba
import numpy as np
from neurolib.control.optimal_control.oc import OC
from neurolib.models.aln.timeIntegration import (
compute_hx,
compute_hx_nw,
Duh,
Dxdoth,
compute_hx_de,
compute_hx_di,
)
class OcAln(OC):
"""Class for optimal control specific to neurolib's implementation ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.