sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
8259f6d7f188cfcb543d9d1e26e4cf5b2f859d1f84c796dd519e7cc5681f9fb9 | Python | 19,379 | 367 | import glob
import json
import os
import sys
import time
import warnings
from typing import Literal
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib import cm
from scipy import integrate
import Functions.globalFunctions.ExtracellularField as EcF
from Analyses.SDC_singlePulse_sing... |
f9b2a3855152e8039e945139793aae8b297d83ce3d9579c75f37149e8f3b8b0a | Python | 19,392 | 499 | #!/usr/bin/env python
"""
"""
from PIL import Image
import pandas as pd
import glob
import gc
import os
import numpy as np
import h5py
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils import data
from torchvision import models, transforms
import imgaug
from imgaug import augmenters as ... |
6294ebb7e0239430149a0da35cf0aa3d1913406fba9648f29c762ebac0023697 | Python | 19,416 | 565 | """ Pooling-based Vision Transformer (PiT) in PyTorch
A PyTorch implement of Pooling-based Vision Transformers as described in:
* `Rethinking Spatial Dimensions of Vision Transformers` - https://arxiv.org/abs/2103.16302
This code was adapted from the original version at https://github.com/naver-ai/pit, original copyr... |
31325c284c4adb2353e240d26fe5f097ad26e1ef7239daf9a79532bb3c3186fa | Python | 19,444 | 519 | """Comprehensive smoke tests — import and minimally invoke every
public PTSA function/class so we catch import-time bugs, constructor
bugs, and gross runtime breakage even for code that has no other
test coverage.
These are not correctness tests — see tests/test_morlet_correctness.py,
tests/test_butterworth_resample_c... |
49bb3d568761adfe8dc6173f7dd9355ac764c8d3a75728a2e2256bab66035847 | Python | 19,453 | 509 | import sys
import os
import bisect
import time
import sqlite3
import collections # for now, plz commands are not allowed to 'from collections import something_specific'
import re
import subprocess
import operator
# import dash
# import dash_cytoscape
# import webbrowser
# import threading
# import flask
from parsers... |
4e7741b6508468794804baa550a69f0a6d18e1d2f5fb062a804155e1c6043975 | Python | 19,483 | 429 | """ DeiT - Data-efficient Image Transformers
DeiT model defs and weights from https://github.com/facebookresearch/deit, original copyright below
Papers:
* `Training data-efficient image transformers & distillation through attention` - https://arxiv.org/abs/2012.12877
* `DeiT III: Revenge of the ViT` - https://arxiv.o... |
acce79ac0521614a1ca416adeb14171d2aa313975db305e48951204fa59ad13b | Python | 19,487 | 320 | """
Computes behavioral comparisons, e.g. between weight/no-weight.
@author: bartulem
"""
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from numba import njit
from scipy.stats import sem
import sessions2load
import make_ratemaps
@njit(parallel=False)
def get_bins(feature_arr, min_val, max_v... |
91032d9fbe8b48f45e3acd14b17237f53091bd85df93df4608b743f787d357d1 | Python | 19,488 | 465 | """Block orientations from the parent-grain (PAG) orientations.
Two modes:
'KS'
Each block gets one of the 24 Kurdjumov-Sachs variants of its parent grain. The variant is
picked hierarchically -- a packet draws a PacketClass (0..3, the four {111}_gamma habit planes),
a block draws a PairClass (0..2) and a... |
6bc4793e96da418a85f0e22f581b82d2e87eca18f305a5385278b89b73112e89 | Python | 19,512 | 500 | """
CreateBatchFiles
================
**CreateBatchFiles** produces files that allow individual batches of
images to be processed separately on a cluster of computers.
This module creates files that can be submitted in parallel to a cluster
for faster processing. It should be placed at the end of an image
processing ... |
60545cb9a9acfaec2d29b8947ff63ba408586d8c2b88455762c47049b82cccad | Python | 19,515 | 360 | """
Author: "Keitaro Yamashita, Garib N. Murshudov"
MRC Laboratory of Molecular Biology
This software is released under the
Mozilla Public License, version 2.0; see LICENSE.
"""
from __future__ import absolute_import, division, print_function, generators
import gemmi
import numpy
import json
import scipy.sparse
from s... |
ec61b20cb6f170719d52095a6ccc2d2a53f48b5c013676b5eb77685cf9c7d233 | Python | 19,520 | 542 | import os
from os import path
import time
from typing import Callable, Dict, Iterable, Iterator, List, Optional, Tuple
from zipfile import ZipFile
from functools import partial
import multiprocessing
import numpy as np
import SimpleITK as sitk
import tensorflow as tf
tf.compat.v1.disable_eager_execution()
... |
40506f1837bb70ac6150d7586fe9c6f6fd9c7ff6499d5e78666a75884b56525f | Python | 19,535 | 503 | """ PP-LCNetV2
Reference:
https://github.com/PaddlePaddle/PaddleClas/blob/release/2.6/docs/en/models/PP-LCNetV2_en.md
The Paddle Implement of PP-LCNetV2 (https://github.com/PaddlePaddle/PaddleClas/blob/release/2.6/ppcls/arch/backbone/legendary_models/pp_lcnet_v2.py)
PP-LCNetV2 is a CPU oriented network built on PP-LC... |
50452f3f1d88ecacb47506d6e8945e311980c452d432a2b40288eab50bc8410a | Python | 19,566 | 518 | import argparse
import numpy as np
import pandas as pd
import os
import random
import json
import copy
import torch
import torch.nn.functional as F
import dgl
from dgllife.utils import CanonicalAtomFeaturizer, mol_to_bigraph
from rdkit import Chem
from sklearn.metrics import r2_score, mean_absolute_error
import torch.o... |
bdf03e63a1112361c8af3ff7d1a20d22179e0bf315d56a4ce426decc340f67bd | Python | 19,597 | 480 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 17 17:56:34 2021
@author: Manuel
Loading data and preparing the training tiles.
"""
__author__ = "Manuel R. Popp"
## select plots to use
use_plots = ["B1_6_0003", "B1_6_0023", "B1_6_0063", "B1_6_0078", "B1_6_0086",\
"B1_6_0119", "B1_6_... |
8cec1dcf4ff83f94ab3576452aad0341cf0e9f40472683c6a652fecb10bfdb98 | Python | 19,625 | 695 | import numpy
import numpy.testing
import pytest
import skimage.morphology
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler_core.module
from cellprofiler_core.constants.measurement import COLTYPE_FLOAT, COLTYPE_INTEGER
from cellprofiler_library.opts.measureimageintensity import Te... |
581f0ecac4905833e242c06f99b6b2c3c0a8ce13e91a3ffdc4e91e94139c300b | Python | 19,644 | 473 | import pandas as pd
import numpy as np
import scipy
import os
import scanpy as sc
from tqdm import tqdm
# from skimage.metrics import structural_similarity as ssim
# import pickle
from math import floor
import json
from sklearn.metrics import confusion_matrix
from sklearn.metrics import classification_report
# from sea... |
7845b77dd7ee87bd690dd94489f091d7915d7b856bed5bdbfcfd494026c2f176 | Python | 19,645 | 537 | import numpy
import six.moves
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler.modules.tile
import cellprofiler_core.object
import cellprofiler_core.pipeline
import cellprofiler_core.workspace
import tests.frontend.modules
INPUT_IMAGE_NAME = "inputimage"
OUTPUT_IMAGE_NAME = "out... |
ddd31f1f08e5f7be1d769c7ee776c48348fd201e7607c93a8e66ba20c7c9bf67 | Python | 19,653 | 571 | """ VoVNet (V1 & V2)
Papers:
* `An Energy and GPU-Computation Efficient Backbone Network for Real-Time Object Detection` - https://arxiv.org/abs/1904.09730
* `CenterMask : Real-Time Anchor-Free Instance Segmentation` - https://arxiv.org/abs/1911.06667
Looked at https://github.com/youngwanLEE/vovnet-detectron2 &
http... |
1a8357a10be023cfbba96f09d25b81a0edd0be2735a1753e82f332ddb47cc5ae | Python | 19,669 | 480 | """NaFlex data loader for dynamic sequence length training.
This module provides a specialized data loader for Vision Transformer models that supports:
- Dynamic sequence length sampling during training for improved efficiency
- Variable patch size training with probabilistic selection
- Patch-level random erasing aug... |
3166d957cb42c05a72b1307c84a08a098a55348b28e005b65ed1b175e018d08e | Python | 19,709 | 524 | """Attempt to generate templates for module reference with Sphinx
XXX - we exclude extension modules
To include extension modules, first identify them as valid in the
``_uri2path`` method, then handle them in the ``_parse_module`` script.
We get functions and classes by parsing the text of .py files.
Alternatively w... |
a44615cd6d3034efdd1c518e856400ccfcc8febea28f5ef0cb3daa9a2bb20e3c | Python | 19,769 | 414 | # Fundamental libraries
import os
import re
import sys
import time
import glob
import random
import datetime
import warnings
import itertools
import numpy as np
import pandas as pd
import pickle as cp
import seaborn as sns
import multiprocessing
from scipy import stats
from pathlib import Path
from ast import literal_e... |
b30f84b75025525e1ed6ac23afe0336558c4973dc109170781f6db82e47599e3 | Python | 19,801 | 547 | """
Tile
====
**Tile** tiles images together to form large montage images.
This module allows more than one image to be placed next to each other
in a grid layout you specify. It might be helpful, for example, to place
images adjacent to each other when multiple fields of view have been
imaged for the same sample. Im... |
b845fea1280ee99c3be53bcf86a163b450ac052376c9908c55ccacada940276c | Python | 19,806 | 562 | # This file is part of pyunicorn.
# Copyright (C) 2008--2026 Jonathan F. Donges and pyunicorn authors
# URL: <https://www.pik-potsdam.de/members/donges/software-2/software>
# License: BSD (3-clause)
#
# Please acknowledge and cite the use of this software and its authors
# when results are used in publications or publi... |
038b6b86950c0ef2bd073f0c522d9933c496721f5811b1232c92eb5efef4fab6 | Python | 19,873 | 455 | import os
import time
import numpy as np
import subprocess
from os.path import join as pjoin
import pandas as pd
import scipy.io as sio
import nibabel as nib
from scipy.stats import zscore
import nibabel as nib
import scipy.io as sio
from nibabel import cifti2
from dnnbrain.dnn.core import Activation
def waitsecs(t=... |
333d12995421176713c94b393adc67ffb4fa2f432868f4473e83988a692cf7aa | Python | 19,875 | 479 | import ast
import traceback
from copy import deepcopy
from GANDLF.configuration.differential_privacy_config import DifferentialPrivacyConfig
from GANDLF.configuration.post_processing_config import PostProcessingConfig
from GANDLF.configuration.pre_processing_config import (
HistogramMatchingConfig,
PreProcessin... |
cf091c4c10e014781f13a8bbfe5d12aa6fb9583e6f10fab8622fa18e9f2338e0 | Python | 19,913 | 352 | """
Author: "Keitaro Yamashita, Garib N. Murshudov"
MRC Laboratory of Molecular Biology
This software is released under the
Mozilla Public License, version 2.0; see LICENSE.
"""
from __future__ import absolute_import, division, print_function, generators
import unittest
import json
import os
import shutil
import tempf... |
01f57645ee8d15513617043b4ffe2f29b99f5880e1ae86af89f7045fe4a075d5 | Python | 19,930 | 566 | import collections
import functools
from rdflib import URIRef
from nidm.core import Constants
import nidm.experiment.CDE
from nidm.experiment.Query import (
ACQUISITION_MODALITY,
IMAGE_CONTRAST_TYPE,
IMAGE_USAGE_TYPE,
TASK,
OpenGraph,
URITail,
expandUUID,
getDataTypeInfo,
matchPrefix... |
0dfe632f9b73d749a24496a40d20e16fd2222e17f79e77321e1a3f18cbccb1c4 | Python | 19,937 | 523 | """FasterNet
Papers:
* `Run, Don't Walk: Chasing Higher FLOPS for Faster Neural Networks` - https://arxiv.org/abs/2303.03667
Code: https://github.com/JierunChen/FasterNet
@article{chen2023run,
title={Run, Don't Walk: Chasing Higher FLOPS for Faster Neural Networks},
author={Chen, Jierun and Kao, Shiu-hong and He... |
afe3abf01a4379065c1c11bf6b6f947a1a743aff7f5e51849b353697b0db557d | Python | 19,960 | 575 | """ Normalization layers and wrappers
Norm layer definitions that support fast norm and consistent channel arg order (always first arg).
Hacked together by / Copyright 2022 Ross Wightman
"""
import numbers
from typing import Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
from .fast_norm im... |
e21f6d234c7b0cb1474f8805371fd3a377e86320bc8a6e4d7c3ea7615c551a95 | Python | 19,980 | 493 | # -*- coding: utf-8 -*-
"""
@authors: Jingyi Guo Fulgostad & bartulem (original code: B. A. Dunn)
Re-floor and re-head various tracking files according to one template file.
Due to some discrepancies in floor tilt, this script fits the floor to lie
on the plain covered by the rear point, and corrects for the elevat... |
54d2e4614e6bb1727d1e13f063654b54f8444be88a2109a821ac6e909c25bc52 | Python | 20,046 | 532 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 26 11:56:59 2019
@author: Nikolai M Chapochnikov
These plots are for the supplements
External files that are read and used for this plotting:
in plots_paper_import:
f'results/cons/cons_full_{k}.hdf'
'results/act3.hdf' FROM preprocess-activity.py
'... |
33bc16b394c6db59c4fbd2adbf603fea87cfbf904aa2ac8e1f74e3331a67de6c | Python | 20,095 | 482 | """ Bring-Your-Own-Attention Network
A flexible network w/ dataclass based config for stacking NN blocks including
self-attention (or similar) layers.
Currently used to implement experimental variants of:
* Bottleneck Transformers
* Lambda ResNets
* HaloNets
Papers:
* `Bottleneck Transformers for Visual Reco... |
9aaeb4ece27a30ffcbe2fb9248a27f17f5335fe871b8cddd70221654a4340fb9 | Python | 20,095 | 555 |
import pandas as pd
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import seaborn as sns
from IPython.display import Image
from pathlib import Path
import re
import umap
import pickle
from sklearn.cluster import DBSCAN, KMeans, SpectralClustering, AgglomerativeClustering, OPTICS
from adju... |
980da5b893387e1ebb50c6df3d8e73ebc65fd0fd713474a3070ad60bcfabec45 | Python | 20,116 | 441 | """test_knime_bridge.py - test the Knime bridge"""
import pytest
import unittest
import uuid
import zmq
import cellprofiler.knime_bridge
import cellprofiler.modules.flagimage
import cellprofiler.modules.identifyprimaryobjects
import cellprofiler.modules.measureobjectsizeshape
import cellprofiler.modules.saveimages
i... |
c2b65d35981b17239225be027a40e980e5070339799ef0ee4276917b74003456 | Python | 20,120 | 583 | import math
import numbers
import random
import warnings
from typing import List, Sequence, Tuple, Union
import torch
import torchvision.transforms as transforms
import torchvision.transforms.functional as F
try:
from torchvision.transforms.functional import InterpolationMode
has_interpolation_mode = True
exce... |
43b8052dbf900d46cf43b8e741a03ec0153878a3621a22dd3b94142b61feb0e9 | Python | 20,135 | 407 | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 26 17:06:06 2021
@author: Jing Li, Small steps make changes. dnt_seq@163.com
"""
import pandas as pd
import numpy as np
import torch
import torch.utils.data as Data
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
impo... |
3ea705a67fb52914a2326457bbb28c6ad3780fd6b67fd25c7dff6ab1645ac16b | Python | 20,137 | 495 | """ AdamW Optimizer
Impl copied from PyTorch master
References for added functionality:
Cautious Optimizers: https://arxiv.org/abs/2411.16085
Why Gradients Rapidly Increase Near the End of Training: https://arxiv.org/abs/2506.02285
NOTE: This impl has been deprecated in favour of torch.optim.AdamW and remains... |
2a017c30c41d987ef2da53c4aa9943d4f1ad7a89fdcbdfa189ac851c55e0ff5c | Python | 20,207 | 516 | import logging
import wx
from cellprofiler_core.setting.filter import Filter, FilterPredicate
from cellprofiler_core.setting.filter._filter import (
AND_PREDICATE,
OR_PREDICATE,
LITERAL_PREDICATE,
)
from ._module_view import ModuleView
from ..utilities.module_view import edit_control_name
LOGGER = loggin... |
af804b64d23617494a9283779dfd2105a5ae97e9b7719819b344f13308d8a801 | Python | 20,237 | 520 | # code adapted from https://github.com/HsinYingLee/MDMM
import functools
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from torch.optim import lr_scheduler
####################################################################
# -------------... |
db05ef59f50951844a166bf673f3bb88bcc2e0dfa930069e96ea023e4857cb67 | Python | 20,239 | 479 | import numpy
import cellprofiler_core.utilities.grid
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler.modules.definegrid
import cellprofiler.modules.identifyobjectsingrid
import cellprofiler_core.object
import cellprofiler_core.pipeline
import cellprofiler_core.workspace
OUTPUT... |
b84f15d0cde1920e9cbd73ee5a948e5e4e20da9bea8fbe1dd3cd03a31e389dac | Python | 20,280 | 442 | """
Author: "Keitaro Yamashita, Garib N. Murshudov"
MRC Laboratory of Molecular Biology
This software is released under the
Mozilla Public License, version 2.0; see LICENSE.
"""
from __future__ import absolute_import, division, print_function, generators
import gemmi
import numpy
import json
import os
import sys
i... |
7897e0919069adbf57eca1d50fcfad97c55d0dd530c31296d2d3c03614057794 | Python | 20,291 | 636 | import sys
import os
import os.path as op
import argparse
from sys import platform as _platform
try:
from src.mmvt_addon.scripts import call_script_utils as utils
except:
try:
import call_script_utils as utils
except:
pass
try:
import bpy
except:
pass
IS_LINUX = _platform == "li... |
f248ad4da0c9b08d9931d4ad9aba9f9212ebd1ee052462e2182d5397b812ce56 | Python | 20,295 | 418 | import scipy.spatial as spa
import numpy as np
from numpy import linalg as LA
import dgl
from src.utils.protein_featurizers import residue_type_one_hot_dips_not_one_hot, residue_type_one_hot_dips
import math
from scipy.special import softmax
from scipy.spatial.transform import Rotation
from src.utils.zero_copy_from... |
874f3c84289b7fc38aa7f54eec7be5e0fc8618ba53110b6c7892507ae9894cca | Python | 20,349 | 599 | # -*- coding: utf-8 -*-
"""
pysteps.utils.dimension
=======================
Functions to manipulate array dimensions.
.. autosummary::
:toctree: ../generated/
aggregate_fields
aggregate_fields_time
aggregate_fields_space
clip_domain
square_domain
"""
import numpy as np
_aggregation_methods ... |
0908e0bd0dbb5645b08386b013958971e7f766c4453da8c01362bc74435b1055 | Python | 20,386 | 423 | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 4 08:57:32 2021
@author: filtez
This scripts take the grapheme to phoneme dictinory file and freq count file
to calculate the phoneme suprisal and entropy values of the each word in the stories
based on cohort model.
"""
import os
from os import path, mkdir
import js... |
821924e3df6434ec316893486ac3b92f0a3932e14479085336da434740fb1bce | Python | 20,429 | 540 | """Re-fetch and decode every dataset in an immutable registry release."""
from __future__ import annotations
import argparse
import json
import sys
import tempfile
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Literal, cast
import dm_... |
c92439b34b066a35dbafffc72cecec0ed50b86e677c7ba65a9a0b52f3d6866da | Python | 20,429 | 473 | import sys
import json
from typing import Optional
from pprint import pprint
import pandas as pd
from tqdm import tqdm
import torch
import torchio
import SimpleITK as sitk
import numpy as np
from GANDLF.config_manager import ConfigManager
from GANDLF.utils import (
find_problem_type_from_parameters,
one_hot,
... |
e785c5aa707b8efaddd58c2c337e6cd4e4bd95b86c7165c9f4f5976f62eb01a4 | Python | 20,443 | 566 | """Draft validated dataset manifests from retrieved and decoded artifacts."""
from __future__ import annotations
import argparse
import bz2
import copy
import gzip
import os
import sys
import tempfile
from collections.abc import Mapping, Sequence
from dataclasses import dataclass
from datetime import UTC, date, datet... |
59f521d1260c869c76f87c4c6da11fd86fb68eb53b62a4c3a780f7014433ebdb | Python | 20,451 | 428 | import os
import sys
import time
import inspect
from serial import SerialException
from array import array
from .pyboard import Pyboard, PyboardError
from config.paths import config_dir, framework_dir, devices_dir, tasks_dir
# -----------------------------------------------------------------------------------... |
4821e08f3e10c2a254550203d8b1d36e47dd9cc74664c85dc3fa45af269159e6 | Python | 20,530 | 500 | """
displays the default preferences in the lower right corner
"""
import os
import wx
from cellprofiler_core.analysis import use_analysis
from cellprofiler_core.preferences import DEFAULT_IMAGE_DIRECTORY
from cellprofiler_core.preferences import DEFAULT_IMAGE_FOLDER_HELP
from cellprofiler_core.preferences import DEF... |
d529ecefb5873037f6c232e0c45aede72b3dcb6f4c4dee0c99fde378dcedd949 | Python | 20,556 | 449 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon May 17 17:56:34 2021
@author: Manuel
Loading data and preparing the training tiles.
"""
__author__ = "Manuel R. Popp"
## select plots/images to use
trn_plots = ["B1_6_0003", "B1_6_0023", "B1_6_0063", "B1_6_0078", "B1_6_0086",\
... |
f547fb70d443800af16741caf4a83296acd7311d46e5141afbacd7a9825a6f28 | Python | 20,618 | 691 | # -- coding: utf-8 --
"""
pysteps.verification.spatialscores
==================================
Skill scores for spatial forecasts.
.. autosummary::
:toctree: ../generated/
intensity_scale
intensity_scale_init
intensity_scale_accum
intensity_scale_merge
intensity_scale_compute
binary_mse
... |
5eca87b0b71f3deacfeb55dd1c4be26faa131a96830b69c51d8b0a060e59f604 | Python | 20,667 | 626 | """Handle parsing files to internal AFIDs representation."""
import csv
import io
import json
import math
import re
from enum import Enum
from flask_dance.consumer.storage.sqla import OAuthConsumerMixin
from flask_login import LoginManager, UserMixin
from flask_sqlalchemy import SQLAlchemy
from pkg_resources import p... |
996b990fb90beb3331aedad43e302eee4be99ff2dc998e5254ef2c1f2171fb25 | Python | 20,680 | 626 | """Handle parsing files to internal AFIDs representation."""
import csv
import io
import json
import math
import re
from enum import Enum
from flask_dance.consumer.storage.sqla import OAuthConsumerMixin
from flask_login import LoginManager, UserMixin
from flask_sqlalchemy import SQLAlchemy
from packaging.version impo... |
70a954197ed83999f4881034ec71014e5eec604c56a0d012347fb33671632763 | Python | 20,737 | 483 | import tensorflow as tf
from tensorflow import keras
from keras import layers, models,activations, initializers , Model
import numpy as np
## ------------------ HELPER FUNCTIONS & CLASSES -----------------------##
## ##
## ... |
03bccf7516e0811d3f507ce578d6c71cf4bba865e4af22b1ad8280c99490ea77 | Python | 20,784 | 350 | """
Performs dimensionality reduction on neural data.
@author: bartulem
"""
import io
import os
import sys
import json
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import umap.umap_ as umap
from scipy.stats import zscore
from kneed import KneeLocator
from sklearn.preprocessing import Standard... |
d332a2c8655df5091e7cca42eb5433bb7bf1b26e3d9346c3ca78c9090dbb335a | Python | 20,786 | 428 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import re
import os
import warnings
from matplotlib.ticker import FormatStrFormatter
from activation_utils import compute_mean_digit_separations_domainIL, compute_mean_digit_separation_classIL, get_distances
def preprocess_performance_data(results,... |
ce0a4839296c852c8e59748aa296e03621982fd8ec68028b0dd960222b40311e | Python | 20,830 | 638 | import glob
from os.path import basename
import nibabel as nib
import numpy as np
from traitlets import Integer, Enum, Dict, Undefined, Unicode, Bool, Float
from traitlets.config import ArgumentError
from mrHARDI.base.application import (mrHARDIBaseApplication,
required_file... |
682fcf70ecfa826448799942b15f67a30c22bedf37ba0dfaa9bae6786e43ba30 | Python | 20,878 | 581 | """SHViT
Papers:
* `SHViT: Single-Head Vision Transformer with Memory Efficient Macro Design` - https://arxiv.org/abs/2401.16456
Code: https://github.com/ysj9909/SHViT
@inproceedings{yun2024shvit,
author={Yun, Seokju and Ro, Youngmin},
title={SHViT: Single-Head Vision Transformer with Memory Efficient Macro Desi... |
5165c3bed6b0b7e37d7cb214a141267e53afb4b408c32941103fa851c22732b4 | Python | 20,884 | 542 | # nate berry
# 2023-01-11
#
# -----------------------------------
# NOTES:
# - plots for manuscript
#
# - somatomotor channels
# - RIGHT [25, 22, 28]
# - LEFT [8, 6, 11]
#
# -----------------------------------
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from pyrqa.time_series ... |
11461ce640afcd45b5dbcaa22ce5042348844d5b31fd72babdaccd46e8d5fb3d | Python | 20,921 | 512 | # -*- coding: utf-8 -*-
"""
guideseq.py
===========
serves as the wrapper for all guideseq pipeline
"""
import os
import sys
import yaml
import argparse
import traceback
# Set up logger
import log
logger = log.createCustomLogger('root')
from alignReads import alignReads
from filterBackgroundSites import filterBack... |
e6388963757ebc8a8a607ec5c6bcf08973c636b82dc4ea2e990136f87af70cc5 | Python | 21,020 | 489 | import torch
from pytorch_lightning import LightningDataModule
from sklearn.model_selection import train_test_split
from torch.utils.data import DataLoader, Dataset, WeightedRandomSampler, Subset
import numpy as np
import pandas as pd
from collections import Counter
from src.utils import utils
import plotly.express as ... |
3f5f7c26398a798cf135953bc9e4e405298fa2c647150ba6dba41b5ccf9b3bfa | Python | 21,062 | 498 | """ PyTorch Feature Extraction Helpers
A collection of classes, functions, modules to help extract features from models
and provide a common interface for describing them.
The return_layers, module re-writing idea inspired by torchvision IntermediateLayerGetter
https://github.com/pytorch/vision/blob/d88d8961ae51507d0... |
87abc085a34d81cdd3fba3771eac7b69b6aa3e3b6f9050118cd8983ed3628d16 | Python | 21,069 | 546 | from .util import robust_min, robust_max
from .path_utils import ensure_dir
from .timers import Timer, CudaTimer
from .loading_utils import get_device
from os.path import join
from math import ceil, floor
from torch.nn import ReflectionPad2d
import numpy as np
import torch
import cv2
from collections import deque
impor... |
f5ba950cc89e1c635d09b1155bc74d1470d637ebedb2e2ff26a2138cd9ba135f | Python | 21,090 | 567 | """
InceptionNeXt
Papers:
* `InceptionNeXt: When Inception Meets ConvNeXt` - https://arxiv.org/abs/2303.16900
Original implementation & weights from: https://github.com/sail-sg/inceptionnext
"""
from functools import partial
from typing import List, Optional, Tuple, Union, Type
import torch
import torch.nn as nn
f... |
ebc617ed7703a4f0ab57e6fcf453196118c196c10483e3c41899e8bee43b183d | Python | 21,091 | 531 | #!/usr/bin/env python3
"""
Beta version of script find PINT (Personal Instrisic Network Topography)
Usage:
ciftify_PINT_vertices [options] <func.dtseries.nii> <left-surface.gii> <right-surface.gii> <input-vertices.csv> <outputprefix>
Arguments:
<func.dtseries.nii> Paths to directory source image
<left-su... |
4bd2759f621446b8e2357763e13354ae40ae9fd5447bd2c666c94af57befb2aa | Python | 21,117 | 603 | from functools import partial
from typing import Any, Callable, List, Optional, Type, Union
import torch
import torch.nn as nn
from torch import Tensor
def conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1) -> nn.Conv2d:
"""3x3 convolution with padding"""
return nn.C... |
b141fa0f1352c847d28bee004c162c8c23ebb2c654315c7868af27d2ce796359 | Python | 21,211 | 387 | """
Copyright 2018 Quonlab.
Copyright 2016 Google Inc.
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... |
da20cf0f6c61de907c273167981f2760ae142cc6d7e6913c3b56e5589e666042 | Python | 21,243 | 544 | import argparse
import inspect
import numpy as np
import pytest
import torch
from timm.models._helpers import clean_state_dict, load_state_dict, resume_checkpoint
_HAS_WEIGHTS_ONLY = 'weights_only' in inspect.signature(torch.load).parameters
_HAS_SAFE_GLOBALS = hasattr(torch.serialization, 'safe_globals')
class _... |
eebfe1016223ec94d9dd285918de339e3fdcb735292befb9350b85ebb7b7155c | Python | 21,255 | 542 | """
MeasureObjectSkeleton
=====================
**MeasureObjectSkeleton** measures information for any branching structures,
such as neurons, root or branch systems, vasculature, or any skeletonized
system that originates from a single point (such as neurites branching from
a single nucleus/soma).
This module measure... |
4787d18703d23ffc6e6872d57e218a4b72c387303a857fb3c6ea96acd41769a4 | Python | 21,291 | 360 | # Fundamental libraries
import os
import re
import sys
import time
import glob
import copy
import random
import datetime
import warnings
import itertools
import numpy as np
import pandas as pd
import pickle as cp
import seaborn as sns
import multiprocessing
from scipy import stats
from pathlib import Path
from ast impo... |
68450392c918c746007f81e29398fed752f05d5399597a0eab0d6aba398994b3 | Python | 21,295 | 527 | import os
import json
import h5py
import numpy as np
import torch
import copy
from torchmeta.utils.data import Task, MetaDataset
from torchmeta.datasets.utils import get_asset
class TCGA(MetaDataset):
"""
The TCGA dataset [1]. A dataset of classification tasks over the values of
an attribute, based on th... |
a846d7de35794ca2a201b7166b6b66c9a41bffabb2b11cdfee8f318ae655052f | Python | 21,309 | 407 | import glob
import json
import os
import sys
import time
import warnings
from typing import Literal
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from matplotlib import cm
from scipy import integrate
import Functions.globalFunctions.ExtracellularField as EcF
from Analyses.SDC_singlePulse_sing... |
0dc5ef79affad0177fb00103f449e4d50372836dc8f93ddf4245b4e4273b5f90 | Python | 21,338 | 406 | """
Author: "Keitaro Yamashita, Garib N. Murshudov"
MRC Laboratory of Molecular Biology
This software is released under the
Mozilla Public License, version 2.0; see LICENSE.
"""
from __future__ import absolute_import, division, print_function, generators
import gemmi
import argparse
import numpy
from servalcat.uti... |
92577b3fce44fbff821c7448a6053a3f6eb9472fb3ef7ded81e858e8292db4ba | Python | 21,351 | 545 | import matplotlib
import matplotlib.axes
import numpy
import wx
import wx.lib.scrolledpanel
from cellprofiler_core.constants.measurement import EXPERIMENT
from cellprofiler_core.constants.measurement import IMAGE
from cellprofiler_core.constants.measurement import M_LOCATION_CENTER_X
from cellprofiler_core.constants.me... |
99ff554f843a26df74bfb7825839c8f4110388a4ec3cb5f9279c8b28e4fb2a83 | Python | 21,353 | 648 | # -*- coding: utf-8 -*-
"""
pysteps.motion.vet
==================
Variational Echo Tracking (VET) Module
This module implements the VET algorithm presented
by `Laroche and Zawadzki (1995)`_ and used in the
McGill Algorithm for Prediction by Lagrangian Extrapolation (MAPLE) described
in `Germann and Zawadzki (2002)`_.... |
2e06b07f4f9df9220efdca5632e4d645db7c541bb0b5548ad1b7c2410e599ec3 | Python | 21,372 | 654 | """Callback library containing training routines. See :doc:`Callback Functions
</python/callbacks>` for a quick introduction.
"""
import collections
import os
import pickle
from abc import ABC
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Sequence,
Tuple,
TypeAlias,
Ty... |
50e2d0eff42966ce2d803be1f0361be0747ba5a6063ffd56bfd068728573cf14 | Python | 21,391 | 616 | """ ReXNet
A PyTorch impl of ReXNet (paper originally titled 'ReXNet: Diminishing Representational Bottleneck on
Convolutional Neural Network')
Papers:
* `Rethinking Channel Dimensions for Efficient Model Design` - https://arxiv.org/abs/2007.00992
Adapted from original impl at https://github.com/clovaai/rexnet
Copyr... |
7618d1549a45e450af505a762418e4d4485054546398a7da7839c55ad6f91b17 | Python | 21,406 | 593 | from matplotlib import pyplot as plt
import pandas as pd
import numpy as np
from NAnalytical import calcN_AB,calcN_IL
import matplotlib.ticker as mtick
from matplotlib import cm
from scipy.optimize import curve_fit
from matplotlib.ticker import (MultipleLocator, AutoMinorLocator)
colors = cm.Set2(np.linspace(0,1,8))
... |
aaf1a9a30da04440af1cd22d02d66457d0c350890f9dd419ae54cb135036adfc | Python | 21,424 | 566 | """ ConViT Model
Papers:
* `ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biases` - https://arxiv.org/abs/2103.10697
@article{d2021convit,
title={ConViT: Improving Vision Transformers with Soft Convolutional Inductive Biases},
author={d'Ascoli, St{\'e}phane and Touvron, Hugo and Leavitt,... |
2e0f5d6b5dec4119fe63e750097108071d7f14cec7c1703dd5e1f2c0418fe217 | Python | 21,437 | 453 | import copy
import json
from contextlib import nullcontext
import pytest
import torch
import timm
from timm.data import resolve_data_config, resolve_input_data_config
from timm.layers import DropBlock2d, DropPath
from timm.models import get_model_args, get_model_input_config, get_model_traits, resolve_model_input_arg... |
b799924f2c9a5d507ed75c81c0b0c9ee48aeac7eb57c34b9232b611dc8f5e6ab | Python | 21,474 | 601 | """ Pyramid Vision Transformer v2
Papers:
* `PVT v2: Improved Baselines with Pyramid Vision Transformer` - https://arxiv.org/abs/2106.13797
@misc{wang2021pvtv2,
title={PVTv2: Improved Baselines with Pyramid Vision Transformer},
author={Wenhai Wang and Enze Xie and Xiang Li and Deng-Ping Fan and Kaitao Son... |
6224a3c2ba25102818f0f05728b864ee22ab60de5f0fb9f36785501ca496b58d | Python | 21,484 | 507 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import h5py, os
from scipy.stats import t, norm
from visual_coding_2p_analysis.pawplot import make_pawplot_population, mega_paw_plot, save_figure
JUST_POOLING = True
NO_LEGEND = True
BONFERONI = True
ALPHA = 0.01/2
NUM_CLUST... |
7e44c531396b4df2221cd8613f362c7c5bd905204310826033ba59ee00eb30d0 | Python | 21,527 | 559 | from cellprofiler_core.constants.measurement import COLTYPE_INTEGER
from cellprofiler_core.constants.measurement import FF_CHILDREN_COUNT
from cellprofiler_core.constants.measurement import FF_PARENT
from cellprofiler_core.image import ObjectsImage
from cellprofiler_core.module import Identify
from cellprofiler_core.se... |
49b713c96b3fa9a1539f1a459491e2abdc4d29eb03bbbb74619b26f5e5270d29 | Python | 21,565 | 577 | import os, sys
from typing import List, Optional, Tuple, Union
from pandas.util import hash_pandas_object
import numpy as np
import SimpleITK as sitk
import pandas as pd
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torchio
import torchmetrics
from tqdm import tqdm
from torchinfo imp... |
a3eb88cb8e8f5e353c91a51bb712c2e929a2f184a6f35d70ffabdf958ad5158e | Python | 21,571 | 364 | # -*- coding: utf-8 -*-
"""
@author: bartulem
Get spike times for individual sessions by splitting clusters.
After cluster-cutting, regardless of whether the sessions were concatenated or not, the spike times
for every individual cluster need to be converted from sample number into seconds, relative to session
(or ... |
cecb5164d4f09d91f17e8ee3b5e1be3f23d3ba5e3f8941b79d87b8a6478a2f1e | Python | 21,579 | 573 | # -*- coding: utf-8 -*-
# (C) Copyright 2020, 2021, 2022, 2023 IBM. All Rights Reserved.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
38b260d56a9ee311b2972d88f8d33adf772b6a5fb51fe5b2659911ae76e32ecb | Python | 21,582 | 601 | """
An implementation of RepGhostNet Model as defined in:
* `RepGhost: A Hardware-Efficient Ghost Module via Re-parameterization` - https://arxiv.org/abs/2211.06088
Original implementation: https://github.com/ChengpengChen/RepGhost
"""
import copy
from functools import partial
from typing import List, Optional, Tuple,... |
b9ad75e8a922f4a4b940f9e74dee11247fdb943348331d9e7058251f373c848f | Python | 21,589 | 660 | import numpy
import six.moves
import cellprofiler_core.image
import cellprofiler_core.measurement
import cellprofiler_core.measurement
import cellprofiler_core.modules
from cellprofiler_core.constants.measurement import FF_COUNT, COLTYPE_INTEGER, M_LOCATION_CENTER_X, COLTYPE_FLOAT, \
M_LOCATION_CENTER_Y, FF_PARENT... |
19d9d58299e4dd42fbd6aa0a9bcc6f8eeb2ce90bd9dadfcad3113c5f412a1cb7 | Python | 21,602 | 598 | """_workspace.py - the workspace for an imageset
"""
import io
import logging
import os
import h5py
import cellprofiler_core.utilities.measurement
from ._disposition_changed_event import DispositionChangedEvent
from ..constants.measurement import EXPERIMENT
from ..constants.workspace import DISPOSITION_CONTINUE
from... |
85e4f54924d6690a600747877e5d86be1954dbf5ec7115dd2920b4c318e0bf76 | Python | 21,657 | 490 | # -*- coding: utf-8 -*-
"""
@author: danielm
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 (c) 2018. Allen Institute. All rights reserved.
Redistribution an... |
09db1f96ca6cd607bc114bb3b905e61596f125f9adc97ae068bb68aebe5ab995 | Python | 21,662 | 512 | # imports #####################################################################
import matplotlib.pyplot as plt
import copy
import pickle
import tensorflow as tf
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Activation, Lambda, Dense
from tensorflow.python.keras import backend as ... |
78606bbf32d87756bd13e726d8446eb25a7f99c91e339504854de0f22eaff8ec | Python | 21,670 | 456 | #coding:utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import tensorflow as tf
slim = tf.contrib.slim
class Block(collections.namedtuple('Block', ['scope', 'unit_fn', 'args'])):
"""A named tuple describing a ResNet block.
I... |
05f37c38cc995c35b19e00d82b08c1497f40e4e039a186742b319d21d30528f1 | Python | 21,673 | 632 | """ ViTamin
Papers:
* `ViTamin: Designing Scalable Vision Models in the Vision-Language Era` - https://arxiv.org/abs/2404.02132
A family of model weights on Huggingface: https://huggingface.co/collections/jienengchen/vitamin-family-661048126b72debdaca060bf
@inproceedings{chen2024vitamin,
title={ViTamin: Design... |
9fc8c88a8ccb4097b758a9ab1261b3ba766d6ddf491714b418c442019841c3e9 | Python | 21,745 | 549 | import concurrent.futures
import os
from functools import partial
from .patch import Patch
from .utils import get_patch_class_proportions, convert_to_tiff
import numpy as np
from tqdm import tqdm
from pathlib import Path
import pandas as pd
import openslide
class PatchManager:
def __init__(self, filename, output_... |
8bb09f0f6963ff07e430df0f58d01035fc0c161cfe07b1826a0b9d64c82a17b9 | Python | 21,762 | 514 | """
RescaleIntensity
================
**RescaleIntensity** changes the intensity range of an image to your
desired specifications.
This module lets you rescale the intensity of the input images by any of
several methods. You should use caution when interpreting intensity and
texture measurements derived from images t... |
4059943c596fbbbaf84d796247365b21b6682506ab0911d50076e3baa78eaaa4 | Python | 21,770 | 609 | # coding=utf-8
"""metadatadlg.py - dialog for editing an expression that might contain metadata
"""
import wx
import wx.lib.masked
from cellprofiler_core.constants.measurement import C_FRAME
from cellprofiler_core.constants.measurement import C_METADATA
from cellprofiler_core.constants.measurement import C_SERIES
from... |
7ac7622630c444baa384cce1062d14a1aee20083b86b3b5da84710e61cb0bc0e | Python | 21,785 | 536 | """Anatomical descriptions and placement guidance for the 32 AFIDs landmarks."""
# Keys match the abbreviation used as the attribute name on the Afids object
# (i.e., EXPECTED_DESCS[i][-1]).
LANDMARK_INFO = {
"AC": {
"full_name": "Anterior Commissure",
"description": (
"A white matter t... |
2bcdcef791afa65a6df6135deb5952f86fe6df032987216e960c63e58a39b3ae | Python | 21,850 | 738 | import mahotas
import numpy
import numpy.testing
import pytest
import scipy.ndimage
import skimage.color
import skimage.feature
import skimage.filters
import skimage.filters.rank
import skimage.segmentation
import skimage.transform
import cellprofiler_core.image
import cellprofiler.modules.watershed
instance = cellpr... |
3652da53d68c2a38f687362ba797ac39ee93f6c28f8c87d93f590a80219046cb | Python | 21,888 | 439 | from . GenomeTrack import GenomeTrack
from .. utilities import change_chrom_names, InputError, get_optimal_fontsize
import bx.align.maf
import bx.interval_index_file
import bx.seq
import matplotlib as mpl
from matplotlib.patches import Rectangle
import numpy as np
from tqdm import tqdm
import tempfile
import re
# Colo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.