sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
422d78b58efdc46676aab3364590a9a189825ab184ae1c7f2ac007c3188699df | Python | 170 | 9 | '''
Author: ----
Date: 2022-04-04 23:33:18
LastEditors: GhMa
LastEditTime: 2022-10-02 19:28:52
'''
from .snn import *
from .snn_modules import *
from .toy_net import *
|
ee444e03ef612000059ba3613283b4f78cfbeadbfeaca6adfb2fca907b5500b2 | Python | 170 | 9 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 8 12:53:54 2021
@author: fhu14
"""
from .skfinfo import SkfInfo
from .skfwriter import main, determine_index, write_skfs |
0e5f1225b35bcd09095e1bf5915801079fa74766ab9cff2e00945d233d2135c1 | Python | 171 | 6 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat4(output, target, misc):
return surface_distance_calc(output, target, misc, 4) |
448372ba60bac8e556c0c2c3c9e2f6b64b70153b0a8a353c506b0a15017c644e | Python | 171 | 6 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat3(output, target, misc):
return surface_distance_calc(output, target, misc, 3) |
54b06f0cf34efc4e233bf5b0b558ed30af15b6a8295eab3ad189ab8b97ac9aff | Python | 171 | 6 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat5(output, target, misc):
return surface_distance_calc(output, target, misc, 5) |
a5535ce7ab8d0f7e7667f124d737316eadce94035af5997ba914c483aafdcede | Python | 171 | 4 | from .common.get_model import get_model
from .common.get_optimizer import get_optimizer
from .common.get_scheduler import get_scheduler
from .common.utils import get_unit
|
b25087826db31e22514ca96550ff1596a2eafc4efa990a551c8bd1272918682e | Python | 171 | 6 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat7(output, target, misc):
return surface_distance_calc(output, target, misc, 7) |
c77f46d14aafaaf3e0dfc5d05cf1eb8e9d430d3f49373760c9c9fd0d66ed5d01 | Python | 171 | 6 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat6(output, target, misc):
return surface_distance_calc(output, target, misc, 6) |
5a3ff3b4c8ce7ec5c2db726853cb56f403917c1b8f203937e8714cb54ec64aba | Python | 173 | 8 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat2(output, target, misc):
return surface_distance_calc(output, target, misc, 2) |
b866690266f50db636d08a568e3dca51add4c7933eef6665cc225ba62d15f9c4 | Python | 173 | 8 |
from metric.surface_distance_avg import surface_distance_calc
def surface_distance_cat1(output, target, misc):
return surface_distance_calc(output, target, misc, 1) |
fcd09ffa6140f160309f27481dbf19a5ff19df9e18bda68ecd26032048f8008f | Python | 173 | 7 | from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version("torchmd")
except PackageNotFoundError:
# package is not installed
pass
|
72c5d5775cc29e0aa549bce362b4481166258b7cff1f76730c896068727b5838 | Python | 175 | 9 | #!usr/bin/env python
#coding:utf-8
"""
@author: Haidong Zhang
@contact: haidong_zhang14@yahoo.com
@time: 2020/12/10 17:12
@project: MalariaDetection
@description:
""" |
9f9ade5cb94e28d61e5ef8ed3a0df56c7810ffd264522c83b21682b890ddb17e | Python | 175 | 9 | #!usr/bin/env python
#coding:utf-8
"""
@author: Haidong Zhang
@contact: haidong_zhang14@yahoo.com
@time: 2020/12/14 22:17
@project: MalariaDetection
@description:
""" |
b529306218db0e99b69af644dfbfb5a2653eae72215649339fefdd0e9b00639a | Python | 175 | 9 | #!usr/bin/env python
#coding:utf-8
"""
@author: Haidong Zhang
@contact: haidong_zhang14@yahoo.com
@time: 2020/12/10 16:00
@project: MalariaDetection
@description:
""" |
5904adf790ddd89d370a68ac6119baf1239079d3ba4cd8c334362c74c883e054 | Python | 177 | 6 | from loss.bce_loss import bce_loss
from loss.dice_loss import dice_loss
def bce_and_dice_loss(output, target):
return bce_loss(output, target) + dice_loss(output, target)
|
5aa661eaac95cb5ee15d6b55d425dc13af04ac5369e35bd34d0317b2f46a0bc6 | Python | 177 | 7 | from importlib.metadata import version, PackageNotFoundError
try:
__version__ = version("torchmd-net")
except PackageNotFoundError:
# package is not installed
pass
|
d85bef5b14b964f466561888fee6d26711b5ade066a63af0233b624670803179 | Python | 177 | 8 | ls = LeafSupport('../input.nex')
#Setting the proportion of quartets or triplets to sample, range 0.0 - 1.0
ls.useAllQuartets = False
ls.noQuartetsToUse=0.4
ls.leafSupport()
|
ef201c8ff4907dfbce46821d5cc7555629b64931220c8554370cf5f79159127c | Python | 177 | 8 | # Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.
from .explainer import Explainer
from .extractor import Extractor
__all__ = [
Extractor,
]
|
002ab45bcb76bbb4f27aa302d1c2c2fa7d8f424e6dab6b12fbde948a9c46e589 | Python | 181 | 9 | var.doCheckForBlankSequences=False
var.verboseRead = 0
read('d.nex')
d = Data()
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.simsForModelFitTests(reps=11)
t.modelFitTests()
|
8e6b7a53addba5b33fb6c875a2b62e56c90ffcdfc816fa6224d465485631cb5f | Python | 181 | 9 | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 8 13:01:15 2021
@author: fhu14
"""
from .rotations import get_axis_rotation_matrix, rotation_matrix_atom, rotation_matrix_bond
|
300ef1260578417ced7ba7e8a0a7fb5f43160c0017bdcf0b8652b4ea6241f261 | Python | 184 | 10 | cpr = McmcCheckPointReader(theGlob='*')
cpr.writeProposalAcceptances()
# How was swapping between heated chains?
cpr.writeSwapVectors()
if 0:
m = cpr.mm[0]
print(m.tunings)
|
c4ba981d0cdc12a568d868f012d7a1cb863c4af4c4165d49b7cbae64abc5b447 | Python | 187 | 4 | # Copyright (C) 2024-2025 ETH Zurich, Niels Maeder and other DASH contributors.
from .cleaner import CLEANER_CONTENT
from .worker import get_lsf_worker_content, get_slurm_worker_content
|
e60ec93f9729bf8ac26a6a13700809ac2b16fc9fe5a07a596b43f3f6d3bcafb2 | Python | 189 | 6 | """Utilities for reading and writing Evolutionary Compression (.ecomp) archives."""
from .reader import read_ecomp
from .writer import write_ecomp
__all__ = ["read_ecomp", "write_ecomp"]
|
0ecb2c4143e1aa3c4723f38d38897b187f18fd89ae7f552399ceb168f6948975 | Python | 192 | 10 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat5(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 5)
|
5479d1b393403c53165738aaa26a05cd18233a00fb48d73f5ead651ae207214b | Python | 192 | 10 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat7(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 7)
|
60b5cf9be4f422c17c16789593381a7c81013f5506efafb83ea2ace4b91b5332 | Python | 192 | 5 | from .adversarial_loss import * # NOQA
from .duration_prediction_loss import * # NOQA
from .feat_match_loss import * # NOQA
from .mel_loss import * # NOQA
from .stft_loss import * # NOQA
|
6b9028a654c994a4ede987a971c1f2d5254f6505120bf0274df32233f8028595 | Python | 192 | 10 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat4(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 4)
|
ad43daf12d1077ecb55425e56c6b4f8e1672fc8c378e38680c7f8b34f898c315 | Python | 192 | 10 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat6(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 6)
|
10b9ddfe17dfe8bf08531251f76069e0045e84a6d8129bb477a93c3d5a49cc2d | Python | 193 | 11 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat3(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 3)
|
21d7511337a82d2e025d1a3adb71777e6b0cb5b6a1fd478d81a46a5fd52f2cae | Python | 193 | 11 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat2(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 2)
|
2f0ff3a690329885dbacafcb405e517e03e77d4fa7de460339370b3b0f80bd63 | Python | 193 | 6 | import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO, format="%(message)s")
logger = logging.getLogger(__name__)
log_file_logger = logging.getLogger("log_file")
|
59b05198392b00025d5d5c7a5c4bf2ebcf78942e657742c672ae2d192c911b00 | Python | 193 | 11 |
from metric.hausdorff_distance95_avg import hausdorff_distance95_calc
def hausdorff_distance95_cat1(output, target, misc):
return hausdorff_distance95_calc(output, target, misc, 1)
|
a8ce337a1b3a10d3654b4be552389059194e1d1970b54062363ea5aacd811e3f | Python | 193 | 8 | import yaml
def load_yaml(filename):
with open(filename, 'r') as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc) |
dd8e2b730bd1c29331fc3beda10d395983133de57683a9390a637ee78d121ec7 | Python | 195 | 9 | tp = TreePartitions('mcmc_trees_0.nex', skip=1000)
t = tp.consensus()
for n in t.iterInternalsNoRoot():
n.name = '%.0f' % (100.0 * n.br.support)
t.write()
t.draw(width=30, showNodeNums=0)
|
bb06de226cf6cefe0d72d2ca832d9db9d2ae03b2605f5f9a6d5e4b92913488b3 | Python | 197 | 8 | # from . import bigquery
# from . import pandas
# from . import polars
# from . import spark
# from .pandas import mrmr_classif, mrmr_regression
# from .main import mrmr_base
__version__ = "0.2.8" |
86c52053d0d3b2159e3734165c68e95eba937bf66e7c3b9335d6987d27182201 | Python | 198 | 6 | from .hifigan import * # NOQA
from .melgan import * # NOQA
from .parallel_wavegan import * # NOQA
from .style_melgan import * # NOQA
from .uhifigan import * # NOQA
from .vqvae import * # NOQA
|
14cdc49976fdf4d49ba47ba43276ad34e9cf0e7d2dc4fdc80628d5a5a9a131e0 | Python | 200 | 9 | # Copyright (c) OpenMMLab. All rights reserved.
from mmcv.utils import Registry
FILTERS = Registry('filters')
def build_filter(cfg):
"""Build filters function."""
return FILTERS.build(cfg)
|
f0cef7abb27f221840ffa1d8dafd8f3fd5844a6902d8fb59b35a3f5560b971af | Python | 200 | 3 | # Copyright Universitat Pompeu Fabra 2020-2023 https://www.compscience.org
# Distributed under the MIT License.
# (See accompanying file README.md file or copy at http://opensource.org/licenses/MIT)
|
1b241196c3a43aabb060804a9688c7d5c354244c40635538b97df7643e76d7d1 | Python | 201 | 8 | ############### Configuration file for Training of SplitMNIST and Mixtures ###############
n_epochs = 5
lr_start = 0.001
num_workers = 4
valid_size = 0.2
batch_size = 256
train_ens = 15
valid_ens = 10
|
bd50a03f7f9575122d4077b8b34bffc6575664f3b18e41737362ccfb664d8a10 | Python | 202 | 6 | from os.path import dirname, basename, isfile
import glob
modules = glob.glob(dirname(__file__) + "/*.py")
__all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]
|
ed48038b6a05653ee7acf110334e9e6334c2823cc51313a904e4cbba098b149a | Python | 202 | 4 | from .zoo import get_model # noqa: F401
from .weights_fetcher import fetch_weights # noqa: F401
from .git_cloner import GitCloneError # noqa: F401
from .model_loader import ModelLoader # noqa: F401
|
31e1e7ba5f00198edc2eefa7b3818e9908f99f967909b35f504b24e00b52751f | Python | 203 | 11 | var.doCheckForDuplicateSequences=False
read('d.nex')
a=var.alignments[0]
a.setCharPartition('cp1')
d = Data()
d.alignments[0].writePhylip()
oneBoot = d.bootstrap()
oneBoot.alignments[0].writePhylip()
|
e9f2dbf592cd9cceb2fded8d59aeb3c1aee19ad990937e82a5c09750afbfc7c0 | Python | 203 | 7 | from . import particle
from . import population
from .algorithm import psoSimple, vlpso
from .report import PSOReport
from .callback import Callback, EarlyStopping
from .util import rankFeatures
|
278ed44548afaf7713e383116cc2910fb6f8d37ada5f99b80dc8b936dd5ec68f | Python | 206 | 4 | # Copyright (c) OpenMMLab. All rights reserved.
from .utils import check_result_same, construct_toy_data, create_random_bboxes
__all__ = ['create_random_bboxes', 'construct_toy_data', 'check_result_same']
|
01b95cf45ccfb6a796103af6832d567d56b8b0fd7a5e480e232788956dcae479 | Python | 207 | 6 | from .binn import BINN
from .logger import SuperLogger
from .network import Network
from .importance_network import ImportanceNetwork
from .sklearn import BINNClassifier
from .explainer import BINNExplainer
|
1bc12dd661a406ae898515dc17d68beaccc4f58d44b0b223322886daed7a7b7c | Python | 207 | 10 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 7 20:02:31 2021
@author: fhu14
"""
from .dftb import DFTB, ANGSTROM2BOHR
from .fermilevel import determine_fermi_level, fermi
from .sccparam import _Gamma12
|
05d581ca3642e7797f673ee1c4f329d9c693c5d5f2c638bfb40775b663d37ff9 | Python | 209 | 4 | # Copyright (c) OpenMMLab. All rights reserved.
from .base_panoptic_fusion_head import \
BasePanopticFusionHead # noqa: F401,F403
from .heuristic_fusion_head import HeuristicFusionHead # noqa: F401,F403
|
b0d8e1efbb93757ea5b2c7080c1935e4f3c8803dd3400fa6a52e7e9b7dd7d32b | Python | 209 | 4 | from .bibiplot import create_bibiplot1x2
from .alignmentplot import plot_alignment, plot_alignment_error, plot_alignment_and_error
from .scatter import scatter2d, scatter3d
from .heatmap import create_heatmap2 |
06716258615911c75488ac61df1778efa239b2b4eb40bd77be786efb3a2f248e | Python | 214 | 10 | var.doCheckForDuplicateSequences = False
read('ds.nex')
a=var.alignments[0]
a.writePhylip(None)
b = a.subsetUsingCharSet('cs2')
b.writePhylip(None)
if 0: # Turn on to see some details
a.nexusSets.dump()
|
d663adabc4df9bb54ac312f74c5a997e92992f7bfe616b09e2e93c26a53daa69 | Python | 214 | 10 | from setuptools import find_packages, setup
setup(
name='dtor',
packages=find_packages(),
version='0.1.0',
description='Deep-learning response prediction',
author='SB-MT',
license='MIT',
)
|
eec123606055614420acd83633214a7e0004a4b9b2ba0974567eb4f841500e6f | Python | 214 | 10 | # Read in the last one ...
cpr = McmcCheckPointReader(theGlob='*', last=True)
m = cpr.mm[0]
t = m.treePartitions.consensus()
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (n.br.support * 100)
t.draw()
|
cd9e6f15b19a9bbd92809b8efef010ef15a8c36e6a67e2881242b3b6c7d1af22 | Python | 215 | 10 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 11 19:42:58 2021
@author: fhu14
Module for handling predictions for targets generated from the dftb_layer
"""
from .molec_target_updates import organize_predictions
|
2d1edfaeccb54d25d2ab4a47ec54613191f2d39c365edabbb94e1c87d7f4864d | Python | 216 | 4 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from sbi.examples.minimal import flexible, simple
|
7c929b9a842c14298c84aa8a4a1a03677cd10492d856d06a9d165a7b2e33db33 | Python | 216 | 10 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Convenience wrapper for running clipkit directly from source tree."""
import sys
from clipkit.clipkit import main
if __name__ == "__main__":
main(sys.argv[1:])
|
12f0dd85306723e287b6aab315bf594ab5246dd465666045a4e6ddf08fc78fe6 | Python | 217 | 8 | # -*- coding: utf-8 -*-
"""
Created on Fri Jun 4 16:15:20 2021
@author: fhu14
"""
from .input_parser import parse_input_dictionaries, construct_final_settings_dict,\
collapse_to_master_settings, inflate_to_dict
|
67586562e14e0740cd67857a98349c61b18e8ab670ababe97f00e4b2d6a1a52b | Python | 218 | 7 | var.verboseRead = 0
read('../../noTRuberNoGapsNoAmbiguities.nex')
d = Data()
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.compoTestUsingSimulations(nSims=100, doIndividualSequences=0, doChiSquare=1, verbose=1)
|
e9b3d885d165c04e0955839a5a3c59044435e9785a10e5692bdf4ce5a2a9aa75 | Python | 220 | 4 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from sbi.__version__ import __version__ # noqa: F401
|
2b98984f35046d30ff838923b9f5e389dc73c3c73a6fce2620e6e9d2be7eac9d | Python | 221 | 7 | # Make a consensus tree, uncomplicated.
tp = TreePartitions("mcmc_trees_0.nex", skip=500)
t = tp.consensus()
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
t.writeNexus('cons.nex')
|
732a1ae487ce62b8d48713634afd794834d4a5eabd5a6c997d37b9aa23481834 | Python | 221 | 5 | # Copyright (c) OpenMMLab. All rights reserved.
from .builder import build_iou_calculator
from .iou2d_calculator import BboxOverlaps2D, bbox_overlaps
__all__ = ['build_iou_calculator', 'BboxOverlaps2D', 'bbox_overlaps']
|
6f89e12931501fc489bdbe5ea19f45e7aea03d5bf15bf64f28014dcca3278843 | Python | 222 | 9 | # Copyright (C) 2022-2025 ETH Zurich, Niels Maeder and other DASH contributors.
"""Typing tools for the use of rdkit."""
from rdkit import Chem
Molecule = Chem.rdchem.Mol
Atom = Chem.rdchem.Atom
Bond = Chem.rdchem.Bond
|
65d38e7132530eca4a70e467b228f2d453d696da1530edbea6bff078aad2fc2f | Python | 223 | 11 | from rdkit import Chem
def make_mol(s: str):
"""
Builds an RDKit molecule from a SMILES string.
:param s: SMILES string.
:return: RDKit molecule.
"""
mol = Chem.MolFromSmiles(s)
return mol
|
661bdf423103857f421b1da850114ba7608598014f6478628c77a812ce67336d | Python | 225 | 6 | # analytical corrections
from .zbl_repulsion_energy import ZBLRepulsionEnergy
from .electrostatic_energy import ElectrostaticEnergy
from .d4_dispersion_energy import D4DispersionEnergy
from .functional import cutoff_function |
de9ab0434672ba38ad20e53f99b3dfb28b0976fb84e54e08c986e7cc58f59855 | Python | 225 | 9 | from .noise import plot_gain_fit, estimate_gain
import logging
log = logging.getLogger(__name__)
try:
from .deconvolution import deconvolve
except ModuleNotFoundError:
log.warn("deconvolution module not available")
|
78394025607374b37d9ee704a1e669e976f8a0e1f7ce52b13078ac101caea01d | Python | 227 | 5 | # Variable that modifies output aspects depending on whether the code is to be executed on a notebook or on a
# terminal. By default it is assumed that it will be executed on a terminal.
USE_NOTEBOOK_ENVIRONMENT = False
|
fdc98e6b00b2b00ec17a26eb95d703877ceea2aa7c6bb96048837ef3bed5fe06 | Python | 227 | 8 | from p4.supertreesupport import SuperTreeSupport
sts = SuperTreeSupport('supertree.nex', 'input.nex')
sts.doSaveDecoratedTree = False
sts.decoratedFilename='mytree.nex'
sts.verbose=2
sts.doDrawTree=True
sts.superTreeSupport()
|
434c9732a9f3e54b4548dcdded0a9044fc8d06391d513f1a73b61954a9ff71d9 | Python | 230 | 6 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
VERSION = (0, 27, 0)
__version__ = ".".join(map(str, VERSION))
|
5ff2fadfae4506488b43dc46ff1f09ee5ebb8af9496f1be2db4d101fc565581b | Python | 232 | 6 | # Copyright (c) OpenMMLab. All rights reserved.
from .camera_base import CAMERAS
from .single_camera import SimpleCamera
from .single_camera_torch import SimpleCameraTorch
__all__ = ['CAMERAS', 'SimpleCamera', 'SimpleCameraTorch']
|
7ef7f3b12c9e4482450ae384050c0683f9c7bf3b35e8c000a88d716568dc7f9c | Python | 232 | 5 | # Copyright (c) OpenMMLab. All rights reserved.
from .image import (color_val_matplotlib, imshow_det_bboxes,
imshow_gt_det_bboxes)
__all__ = ['imshow_det_bboxes', 'imshow_gt_det_bboxes', 'color_val_matplotlib']
|
e0b4cc0cd63e4086e84357e88931611b125b9d0d72f4067fbc536e8588490b06 | Python | 232 | 4 | from dtor.datasets.dataset_nominal import CTImageDataset
dset = CTImageDataset("data/external/Label.csv", label="L_LTP_date",
shape=(64, 64, 64), stride=(32, 32, 32)) # shape=(64,64,48), stride=(32, 32, 24))
|
1da765100815f65bf9ba315da59e16ca076ab92c76cac910dfcff8afa14672ef | Python | 238 | 5 | # Copyright (c) OpenMMLab. All rights reserved.
from .transforms import (bbox_cs2xywh, bbox_xywh2cs, bbox_xywh2xyxy,
bbox_xyxy2xywh)
__all__ = ['bbox_xywh2xyxy', 'bbox_xyxy2xywh', 'bbox_xywh2cs', 'bbox_cs2xywh']
|
09dcb4688b7a3f3b451f645fd908301e71ddec283c436db88cddb461685c5a26 | Python | 240 | 4 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from sbi.inference.trainers.marginal.marginal_base import MarginalTrainer
|
77e7b8852b6c097056499bfb18b1fbdfd3e3e4ea6533b51ef4c6628b8453be65 | Python | 240 | 10 | import numpy as np
import random
# from theano.tensor.shared_randomstreams import RandomStreams
def set_random_seeds(random_seed):
# srng = RandomStreams(seed=random_seed)
random.seed(random_seed)
np.random.seed(random_seed) |
0d75901d6da6d9857351339177c1f230a830f0c9ab9b3ac6287a3977058b4c70 | Python | 241 | 9 | """Command modules for the beast CLI."""
from daart.cli.commands import predict, train
# dictionary of all available commands
COMMANDS = {
'train': train, # model training
'predict': predict, # model inference on keypoints
}
|
7134d05b0f3b78aac358991ab8f0f804004c971b7db9b7cd1badf690aa9334c8 | Python | 242 | 10 | """Functions for reading and writing files."""
import yaml
def load_yaml(filename):
with open(filename, "r") as stream:
try:
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
|
09a4c25cc15a754a1fa0d6f7380626b69f34120d5ff904ee0be468f14aa969fd | Python | 244 | 6 | # Copyright (c) OpenMMLab. All rights reserved.
from .monitor_node import MonitorNode
from .object_assigner_node import ObjectAssignerNode
from .recorder_node import RecorderNode
__all__ = ['MonitorNode', 'ObjectAssignerNode', 'RecorderNode']
|
154aaacd0354f6c5591b107679c9396be5978a5b0e5da0649f5db4e75cd86b96 | Python | 244 | 2 | from .util import normalize, rotx, roty, rotz, get_rgba, translate, scale
from .shapes import GlQuad, GlTri, GlVertices, GlCube, GlSphericalRect, GlCylindricalWithPhiRect, GlSphericalCirc, GlCylinder, GlSphericalPoints, GlSphericalTexturedRect
|
c5a39f1eb2f42db96f2bef580cadba1390dd36fda55134d48d149abef29feca0 | Python | 244 | 11 | ls = LeafSupport('../input.nex')
#Set writeCsv to true to output the resulting lists to a csv file.
ls.writeCsv = False
#The csv filename can be specified, default name is leafSupport.csv
ls.csvFilename='leafSupport.csv'
ls.leafSupport()
|
fcfde019052ea06f4e8fc780aacc4849791390f7e0e717c599afe1f5941f8841 | Python | 244 | 11 | """Useful utils
"""
from .misc import *
from .logger import *
from .visualize import *
from .eval import *
# progress bar
import os, sys
sys.path.append(os.path.join(os.path.dirname(__file__), "progress"))
# from progress.bar import Bar as Bar |
e5434c0f0851105ecece1ea836693724c42e04167f6b61db377af3733e0c8435 | Python | 245 | 10 | from p4.supertreesupport import SuperTreeInputTrees
stit = SuperTreeInputTrees('balanced64.nex')
stit.writeInputTreesToFile = True
stit.outputFile = 'inputtrees.tre'
stit.noTaxaToRemove = 32
stit.noOutputTrees = 20
stit.generateInputTrees()
|
96deef80103c9b8f0e22d4e4432f93a012915cb87b0280d55eb52c0fc0037f2d | Python | 247 | 16 | var.doCheckForDuplicateSequences = False
var.verboseRead = 0
read('ds.nex')
b = var.alignments[1]
b.writePhylip()
b.excludeCharSet('cs2')
b.writePhylip()
b.setCharPartition('cD')
d = Data()
d.dump()
b.setCharPartition(None)
d = Data()
d.dump()
|
f1f69ad4451c22e061eb759da7cebe1a43c44a8c5b17a3437ea5aa4f225d9a47 | Python | 248 | 10 | var.verboseRead = 0
read('d.nex')
d = Data()
d.compoChiSquaredTest(verbose=1, skipColumnZeros=1, useConstantSites=1, skipTaxNums=None, getRows=0)
read('opt.p4_tPickle')
t = var.trees[0]
t.data = d
t.simsForModelFitTests(reps=83)
t.modelFitTests()
|
10d6ab030024f03a4833dded9b985d16c5830526cde04334d851eee4f6f203bf | Python | 249 | 7 | import os
def create_folders(path):
# create output folder if it does not exist
if (path != '') and (not os.path.isdir(path)):
print(f'directory "{path}" does not exist and will be created.')
os.makedirs(path, exist_ok=True) |
b0cd39eaf4b5aeb973257872c9900febe385de068204de98fd9530d1c9265c04 | Python | 250 | 10 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 7 18:31:26 2021
@author: fhu14
"""
from .charge_loss import ChargeLoss
from .dipole_loss import DipoleLoss
from .form_penalty_loss import FormPenaltyLoss
from .total_energy_loss import TotalEnergyLoss
|
e15337402b078e8f8b0562c15842253eeaa14639707c02b796ec4b110b4196a9 | Python | 250 | 10 | tp = TreePartitions("mcmc_trees_0.nex", skip=200)
t = tp.consensus()
# put support on node.name's, for the text drawing
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
# Save it
t.writeNexus(fName='cons.nex')
|
d0fe375f5567d7714f0e68f812accf853262f890a185d12fd1ccc077e732dd91 | Python | 251 | 10 | import json
from glob import glob
from FOD.Predictor import Predictor
with open('config.json', 'r') as f:
config = json.load(f)
input_images = glob('input/*.jpg') + glob('input/*.png')
predictor = Predictor(config, input_images)
predictor.run()
|
5e6e19870c235230310f8cafc8b6fdd8d4a75124c5c4972931d0d3eca4886e3a | Python | 252 | 3 | # All dataset training Neuron Segmentation
nohup python tools/train.py configs/swin-sim-seg/1_mask_rcnn_swin-t-p4-w7_fpn_ms-crop-3x_sim_seg.py --gpu-ids 0 --work-dir results_all_data/09-19-2022/ > results_all_data/09-19-2022/output_all_data_seg.log &
|
faba9c71fc0ea01aaa2931c8ced162de84319455cb4db6ae11ee61b8d6805333 | Python | 252 | 8 | import sys
from os.path import join, dirname, realpath, exists
from os import makedirs
current_dir = dirname(realpath(__file__))
sys.path.insert(0, dirname(current_dir))
# from config_path import PLOTS_PATH
# saving_dir = join(PLOTS_PATH, 'analysis')
|
0930c0f5968a479828972266cb1a704cdc7adb50502e0fd7dfa98490066acc5a | Python | 253 | 7 | # Copyright (c) OpenMMLab. All rights reserved.
from .coco_api import COCO, COCOeval
from .panoptic_evaluation import pq_compute_multi_core, pq_compute_single_core
__all__ = [
'COCO', 'COCOeval', 'pq_compute_multi_core', 'pq_compute_single_core'
]
|
8bae5b1a368f8096e672218ff7ee90c7419ca3e65d88bb5a5fb4a42d3b2c40f5 | Python | 255 | 9 | import socket
def find_random_open_port() -> int:
"""Find a random open port on localhost."""
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind(("", 0))
port = s.getsockname()[1]
return port # noqa: RET504
|
7016c7256287f1f71e8bd6cb3d1c16b231baf7d3fedeb738b32e9b3973b43e8d | Python | 256 | 10 | # Copyright (c) OpenMMLab. All rights reserved.
from ..builder import DETECTORS
from .detr import DETR
@DETECTORS.register_module()
class DeformableDETR(DETR):
def __init__(self, *args, **kwargs):
super(DETR, self).__init__(*args, **kwargs)
|
bad10239680ddc4edf240241576e3461fd8df6788bda8796c10c699aff58231e | Python | 259 | 8 | from p4.supertreesupport import SuperTreeInputTrees
stit = SuperTreeInputTrees('balanced64.nex')
stit.writeInputTreesToFile = True
stit.outputFile = 'inputtreesWithDist.tre'
stit.useTaxonDistribution = True
stit.noOutputTrees = 20
stit.generateInputTrees()
|
fdc099198e4a675730dfaa203e74b457d1233cedf770c01e4fa6792133399e6a | Python | 259 | 7 | # Copyright (c) OpenMMLab. All rights reserved.
from .fpn import FPN
from .gap_neck import GlobalAveragePooling
from .posewarper_neck import PoseWarperNeck
from .tcformer_mta_neck import MTA
__all__ = ['GlobalAveragePooling', 'PoseWarperNeck', 'FPN', 'MTA']
|
4683db4c7a5f56e3193bb7af3255b4cb99a3b997d780763966951fd61af7ea4c | Python | 260 | 10 | import torch
def accuracy_binary(output, target):
with torch.no_grad():
pred = (output > 0.5)
assert pred.shape[0] == len(target)
correct = 0
correct += torch.sum(pred == target).item()
return correct / target.numel()
|
5c7341294831679e117c28f6ae9f7a0b9a73e51f109d917894603d62de4726da | Python | 261 | 11 | rNum = 0
tp = TreePartitions('mcmc_trees_%i.nex' % rNum, skip=100)
t = tp.consensus()
# Transfer node.br.support to node.name as percent
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
t.writeNexus("cons%i.nex" % rNum)
|
d5b37122434c1eda13148140ba0d8ad17260bd64b96b67e3040c8bf1b8204c0a | Python | 261 | 10 | from .fitting import *
from .statistics import *
from .distributions import *
from .data import *
try:
from ._version import __version__
except ImportError:
# Fallback for development installations without setuptools_scm
__version__ = "0.0.0.dev0"
|
43152a3330516ff9cdedd7a841d1e03553b64afc8ca25f130cd9455ea11a0544 | Python | 263 | 10 | import setuptools
setuptools.setup(
name="pybrid",
version="0.0.1",
description=("Hybrid inference: Inferring fast and slow"),
license="MIT License",
url="https://github.com/alec-tschantz/pybrid/",
packages=["pybrid", "pybrid.models"],
)
|
8957d41d02eb340574754436ddf274313fd91a2d3dd9f827e24f3e97023b0247 | Python | 263 | 7 | # This file is part of sbi, a toolkit for simulation-based inference. sbi is licensed
# under the Apache License Version 2.0, see <https://www.apache.org/licenses/>
from sbi.samplers.rejection.rejection import (
accept_reject_sample,
rejection_sample,
)
|
411c59f29644e0c98954ac3793693f55fb61820880a8ec2fe01232764b41eb44 | Python | 264 | 9 | from p4.supertreesupport import SuperTreeInputTrees
stit = SuperTreeInputTrees('balanced64.nex', distributionTrees='FelidaeRVS.tre')
stit.writeInputTreesToFile = True
stit.outputFile = 'inputtreesBuiltDist.tre'
stit.noOutputTrees = 20
stit.generateInputTrees()
|
7646d8ed73d3b622693e99d2d338e22d1cf4db67ca997153ef6ccb37ad795749 | Python | 264 | 7 | from .BBB.BBBLinear import BBBLinear as BBB_Linear
from .BBB.BBBConv import BBBConv2d as BBB_Conv2d
from .BBB_LRT.BBBLinear import BBBLinear as BBB_LRT_Linear
from .BBB_LRT.BBBConv import BBBConv2d as BBB_LRT_Conv2d
from .misc import FlattenLayer, ModuleWrapper
|
796acf5e3d5b76bc4c2585d9c7cb9c613b72d8c4ac8ba8d032cf0029e5e35ad9 | Python | 264 | 8 | tp = TreePartitions("mcmc_trees_0.nex", skip=500)
tp.read("mcmc_trees_1.nex", skip=500)
t = tp.consensus(minimumProportion=0.5)
for n in t.iterInternalsNoRoot():
n.name = "%.0f" % (100. * n.br.support)
t.draw()
t.name = 'stMcmc'
t.writeNexus('stMcmcCons.nex')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.