sha256 stringlengths 64 64 | language stringclasses 28
values | size int32 1 491k | lines int32 1 23.2k | content stringlengths 1 200k |
|---|---|---|---|---|
e6046423b99afb1e201c8dc901d0718a2f3b374c9543d104bd7dd643254cb521 | Python | 8,142 | 179 | import torch
from .vae_basic_model import VaeBasicModel
from . import networks
from . import losses
from torch.nn import functional as F
from sklearn import metrics
class VaeMultitaskModel(VaeBasicModel):
"""
This class implements the VAE multitasking model, using the VAE framework with the multiple downstrea... |
27278050c13f9826c35006f3161c751c935ddbeb223a605716b8fe1e402b4c1a | Python | 8,145 | 204 | ## 2021/08/04
# Gene Regulatory Network Simulation Using Simple Multivariate Gaussian
#
## Plots
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib import offsetbox
from matplotlib import cm
import seaborn as sns
import pandas as p... |
0f9cf131f64f283deaba1c7089e8f878c04a3557d2035e7c3636f1c471df1ad8 | Python | 8,147 | 208 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
5135f543bcf04edcec9061270940c0432ee774c1815e6e7aec47af6785643194 | Python | 8,147 | 258 | import pytest
import os
import sys
import tempfile
import subprocess
from pathlib import Path
import numpy as np
import warnings
import torch
from nequip.data import to_ase
from nequip.utils.global_dtype import _GLOBAL_DTYPE
from nequip.integrations.ase import NequIPCalculator
from omegaconf import OmegaConf, open_d... |
37a53842d286a5720add824bf063481f2237298e86bb8473596303b786cc0785 | Python | 8,148 | 285 | import json
import csv
import pandas as pd
from abc import ABC, abstractmethod
from cleaner import clean_row, get_id, get_name, Differ, Dropper
from thefuzz import fuzz
class Reader(ABC):
@abstractmethod
def read(self, *args) -> pd.DataFrame:
raise NotImplementedError
class BaseReader(ABC):
def ... |
a80d9a5a8e6d7f757c31638ff617827ad87a2defd5a119a15950ba66adcac8a8 | Python | 8,153 | 205 | #!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.10"
# dependencies = ["PyGithub==2.10.0", "requests"]
# ///
"""
Post MultiQC preview report comments on PRs, from builds made by module-report-build.yml.
Run by .github/workflows/module-report.yml. Never runs PR code: it only reads build
results a... |
59913f03b76ad9bfcd56b4e98aa2a0cd6e33e1517f342e6fc71394c952f63b81 | Python | 8,157 | 199 | from .hook import HOOKS, Hook
from .lr_updater import annealing_cos
class MomentumUpdaterHook(Hook):
def __init__(self,
by_epoch=True,
warmup=None,
warmup_iters=0,
warmup_ratio=0.9):
# validate the "warmup" argument
if warmup is ... |
a274053f4b53c1deea03fa55a459f4a2a1b81edd40c3a39b67fb8d05d559f369 | Python | 8,161 | 156 | # Copyright (c) 2016, Konstantinos Kamnitsas
# All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the BSD license. See the accompanying LICENSE file
# or read the terms at https://opensource.org/licenses/BSD-3-Clause.
from __future__ import absolute_im... |
6492af0a397cb2e928b74f004a2849321a11d310f79e7bbe6fdbb384e1021ae0 | Python | 8,167 | 225 | from typing import Tuple, Union
import numpy as np
from enum import Enum
from pydantic.dataclasses import dataclass
from ..utils import fix_dataclass_init_docs
def phase_matrix(top: float, bottom: float = 0):
return np.array([
[np.exp(1j * top), 0],
[0, np.exp(1j * bottom)]
])
def coupling_... |
b829b55a4320acf6f8757c75d51e2c30443dfd748045c6d1699b204170f9606c | Python | 8,172 | 198 | # Copyright 2020 Google Research. All Rights Reserved.
#
# 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... |
d1618a3f672896c6d730966ef4f0c47a69acd1fd1a343fa64b0a06ceb9ab4832 | Python | 8,176 | 209 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
a12520b68beda3a201574a202c428683f5ce5054facfd6ba1d30a983e664c37e | Python | 8,180 | 188 | import datetime as dt
import logging
import struct
from typing import List
from PyQt5.QtBluetooth import QBluetoothDeviceInfo, QLowEnergyService, QBluetoothUuid, QLowEnergyCharacteristic
from PyQt5.QtCore import QObject, pyqtSlot, QByteArray, Qt
import SensorChannel as sc
import SensorServiceDriver as ssd
class SS1... |
ccf1281091087f95b10073f550ac79d1ba23823776dff98a4f1ee3539912356c | Python | 8,185 | 249 | import numpy as np
import pandas as pd
from rl_analysis.util import rle
from typing import Callable, Sequence, Optional, Union
from functools import partial
def align_window_to_label(
label_key: str = "labels",
include_labels: np.ndarray = np.arange(100),
window_bounds: tuple[float, float] = (-10, 10),
... |
a36d78138b6c5862e8eef3654cfa17179e561a9be1815ea555ee997d25648403 | Python | 8,186 | 204 | #!/usr/bin/env python3
"""
File: visualise_deconvolution_covariates.py
Created: 2020/09/30
Last Changed: 2020/11/24
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publis... |
9002fd8ab23e0f84729781958563e2f670ca50b7edd600ad078c324fa8c29452 | Python | 8,201 | 252 | # Copyright 2020 Google Research. All Rights Reserved.
#
# 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... |
068d1db8349e07a5ac16916fe23c4ce9e058135c0f2441530c357ca654c062e6 | Python | 8,202 | 135 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
c67b9d899fee2d5b11de1123ebece80b159240044510c34bf64887050e017a07 | Python | 8,204 | 216 | ####################################################################################################
# Copyright (c) 2019 - 2021, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
0556ffae5cd5b7e52a57cc803519763f6b9cec48b48b45b3300db8313ceb6998 | Python | 8,205 | 248 | # LZW Update May 2017, Feb 12 2017 to match TN00344.
# G. Ruffini with Eleni Kroupi / Starlab + Neuroelectrics (2017)
# Updated May 2017 with Entropy rate calculators
# Part of this code from sources as indicated, but modified to
# be used with binary data.
# Permission is hereby granted, free of charge, to any pers... |
42a25e202599a20450efd9c763fdabd9315a53ca897d0acf08d281ba638a2f75 | Python | 8,205 | 203 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
079bb927e35215a5591513ac32f2ed02ed8f44b94d873ee1591f9bf7abd481f1 | Python | 8,207 | 231 | #!/usr/bin/env python
import os,subprocess,sys
from itertools import izip
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
from scipy.stats.stats import pearsonr, spearmanr
def plot_txs (tx_i, tx_j, clust_i, clust_j,
x_i, y_i, error_i, xfit_i, yfit_i,
... |
254cf586f770f170f5800cb63ca7ce8c93f1b6afc804830ae2c441c019394f64 | Python | 8,207 | 226 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
d04334f138ad3e173f8a7ad538851bf600dc956f8d4c2a1c4e9034c2f5a88381 | Python | 8,207 | 221 | import os
import numpy as np
import pyBigWig
import torch
from src.criterion import WeightedMSELoss, WeightedMSELossWithMPI
from src.dataset import EncodeDataset, encode_worker_init_fn
TEST_DATA_PATH = "data/test_data/"
class TestWeightedMSELoss:
def test_loss(self):
np.random.seed(10)
sample_s... |
df1aac804c5b728f4294209d52da6cb5c653391a1f3b2b2c5f744383691e4651 | Python | 8,207 | 209 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
6630be9ffe22855675277e7e9d2f2c74b234a1f7c8c5a87211b80fae6b9f0c26 | Python | 8,212 | 202 | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
ef0bad67268f0600b8c58c877b34d5b542d9be3c60c5bd80500df799bc7b5f24 | Python | 8,216 | 243 | from tensorflow import keras
import numpy as np
def calculate_input_dim(feature_dim, architechture, past_frames, future_frames):
"""
Data is arranged as [t, flattened_feature_dimensions]
where t => [past_frames + 1 + future_frames]
In this version, we flatten the feature dimensions
But ano... |
04ec28406cef53333b12c33be3236bb89f048d735e23efe6c13cd5ad6721b957 | Python | 8,217 | 207 | ####################################################################################################
# Copyright (c) 2019 - 2023, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of VessMorphoVis <https://github.com/BlueBrain/VessMorphoVis>
#
# This program is free ... |
b7b0ae2be6deddc012c45b36577beb35233be6467f511af4a4e6d54351eb9b2b | Python | 8,217 | 154 | __author__ = 'duarte'
from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict
from modules.input_architect import EncodingLayer, InputSignalSet, InputNoise, InputSignal
from modules.net_architect import Network
from modules.io import set_storage_locations
from modules.signals import iterate_... |
fafc8cf00cc394cdf5417d24a9d4340e48f2c0816b6bc16cc321bf16d38b3ff9 | Python | 8,217 | 202 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
1955caa126ea7c2bce79bda87643f2af8d8df328009a4272afbab5ae4e411cbe | Python | 8,220 | 192 | # Copyright 2020-21 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
20d3ef5b00786497712de1ff487f8742821c20cc5e62f3ccdaf6c7a1476d3df5 | Python | 8,220 | 393 | __author__ = "Jianfeng Sun"
__version__ = "v1.0"
__copyright__ = "Copyright 2023"
__license__ = "GPL v3.0"
__email__ = "jianfeng.sunmt@gmail.com"
__maintainer__ = "Jianfeng Sun"
from typing import Optional
import pandas as pd
from tmkit.id.Fasta import Fasta as idfas
from tmkit.id.PDB import PDB as idpdb
from tmkit.... |
7f1f3e08a3abcd6f114d5907be4c2b1ea0849fe37a2656949be7323a97815494 | Python | 8,222 | 188 | # Copyright 2020-21 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
9441b2576ef05327ca526fcf0e7d37756eb6fc6b4f2ee77e008b7c78dc3d251e | Python | 8,224 | 198 | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
b4ed29b18c5d545a6d84090aaf660e2fb3601ca55f8fb127546ccbdd403fb5bb | Python | 8,226 | 287 | from typing import Union, Callable, Optional
from typing import Union
from scipy import signal
from sklearn import linear_model
from rl_analysis.util import rolling_mad
from numba import jit
import numpy.typing as npt
import numpy as np
import pandas as pd
def compute_photometry_quality_metrics(
df_phot: pd.DataFram... |
085a6baefed78bd0ecec9750642542aae8fbe467fc691a3a6b53dc32bc3e82a6 | Python | 8,229 | 231 | # Code from https://github.com/pytorch/vision/blob/master/torchvision/models/vgg.py
# Modified to use perceptual loss
import torch.nn as nn
import torch.nn.functional as F
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from... |
4db6db4b390ec5c392b41f4aba86894013a2dac15f9d092699377ae0bfe10307 | Python | 8,230 | 259 | '''
Written by Nathan Neeteson.
A set of functions for plotting the results of model outputs on a test set.
'''
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import linregress
# this function just adds an annotation to a plot that shows the slope, intercept,
# and rsquared values (with 95% CI) o... |
1dee8ad288a8726584bd7bccf8cf1165dca2fd471f99c87c01034450934a5f70 | Python | 8,234 | 206 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
81ee10e6eec07c8f9f237609efade8426607c80b1c14303cd3e73c65e22d4d85 | Python | 8,235 | 210 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
96dcc541b2ad21e61728ced153716c399648003995327aee1b127c51313167bf | Python | 8,235 | 285 | import functools
import logging
import pickle
import torch
import torch.distributed as dist
_LOCAL_PROCESS_GROUP = None
def all_gather(tensors):
"""
All gathers the provided tensors from all processes across machines.
Args:
tensors (list): tensors to perform all gather across all processes in
... |
690018360f8dafd180eb189ca157e67b701a6f92341c3ca895273be1cd56bdf3 | Python | 8,241 | 273 | """
Training script for nonlinear Poisson equation using GINO.
This script trains a Graph Neural Operator (GINO) on the nonlinear Poisson
equation with boundary conditions. The model learns to solve elliptic PDEs
with complex geometries and boundary conditions using graph-based representations.
"""
import sys
import... |
8f12e8335411dd0d16b74232ed64dafa50efd970bd2c3aa6f29bc293fd01a7c3 | Python | 8,242 | 212 | import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
class Sampling(layers.Layer):
def __init__(self, name='sampling'):
super(Sampling, self).__init__(name=name)
def call(self, inputs):
z_mean, z_log_var = inputs
epsilon = tf.rand... |
d853bed9ec0c6f5fe9312ab587d0f17e3b0237e44485e80c887d3b2948e9ded8 | Python | 8,244 | 248 | import torch
import torch.optim as optim
from tqdm.auto import tqdm
from torch.nn.utils import clip_grad_norm_
from moses.interfaces import MosesTrainer
from moses.utils import (
SmilesOneHotVocab,
Logger,
smiles_tokenize,
set_torch_seed_to_all_gens,
compute_reconstruction_trans
)
from moses.trans... |
44f9ef8b1fdc866c9dab61caa557815ef7918f31b9a739e323ac74b545e99a54 | Python | 8,246 | 261 | # Copyright 2020 Google Research. All Rights Reserved.
#
# 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... |
2b38bc958a8e5c84bb95566de66023c447b1949421fde24da6b7b8143f9a437f | Python | 8,249 | 210 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
5de5a106facc84e04ea9707a21811040f04bdcb1049e1353aad303a27249a8a3 | Python | 8,254 | 231 | """
Created on Thu Oct 21 11:09:09 2017
@author: Utku Ozbulak - github.com/utkuozbulak
"""
import os
import copy
import numpy as np
from PIL import Image
import matplotlib.cm as mpl_color_map
import torch
from torch.autograd import Variable
from torchvision import models
def convert_to_grayscale(im_as_arr):
"""
... |
8643ef3b7037cebed7d4362572820c21aac08a99a11233ddae606ff496020d67 | Python | 8,261 | 175 | """The ClipGT scene-package format: Parquet schemas, the rig calibration row, the writer.
This is the *format*, with no CARLA in it — :mod:`carla_cosmos.scene` fills the
tables from a live world, :mod:`carla_cosmos.synthetic` fills them with a
straight-line drive for tests, and both write them through :func:`write_tab... |
8300cd52bac0c617a01abf146bd7ae1294bb1aefd7fbb461798f72be9b953864 | Python | 8,262 | 196 | import unittest
import numpy as np
import scipy
import bayesian_bootstrap as bb
from bayesian_bootstrap import (
mean,
var,
bayesian_bootstrap,
central_credible_interval,
highest_density_interval,
BayesianBootstrapBagging,
covar,
)
from sklearn.linear_model import LinearRegression
RNG = np.... |
1ada6db9785460e3c3cbeca22335426ea101c38c486111266fce85677c15b7f9 | Python | 8,265 | 194 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
68cf717475a139b9375784f99f068428dab1531fa10396e0958e2ff8098a4b26 | Python | 8,267 | 203 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
988484ad6924798fd788f3f7860899f3cafb67fb5292527c2004d9ae9871671f | Python | 8,268 | 188 | #!/usr/bin/env python3
"""Tune the Traffic Manager: how autopilot vehicles drive, globally or per vehicle.
Commands:
global [--speed-diff -30] [--distance 2.5] [--seed 42]
[--hybrid on|off] [--hybrid-radius 70] [--respawn-dormant on|off]
[--osm on|off] TM-wide sett... |
aac1311b692557ba9ad49b70ee07f2970a572f9a49da376aa773555f88160501 | Python | 8,268 | 201 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
6988c3e46a9a981cdf15e6219da263a3e7ffa815f407857a826e25cadb5b5491 | Python | 8,269 | 176 | # basic imports
import os
import pickle
import numpy as np
import pyqtgraph as qg
# framework imports
from cobel.agents.sfma import SFMAAgent
from cobel.interfaces.gridworld import InterfaceGridworld
from cobel.misc.gridworld_tools import make_gridworld
def define_run_patterns() -> dict:
'''
This function pr... |
6127ed25bede645c8dc57931b5b042e4b5f71b45ba53a0fe72b396d9d74e7925 | Python | 8,270 | 202 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
738c654f1de592b04216f8841a098d61787346cd017b3871bf6f14874862b95a | Python | 8,270 | 202 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
2423b5f4503a788fe992a20d65ca0a43ad085e9d60652ee2591b3cbd36357a96 | Python | 8,276 | 242 | # libraries
import pandas as pd
import numpy as np
from sklearn import preprocessing
import math
import pickle
import tensorflow as tf
from tensorflow.keras.models import Model, load_model
from tensorflow.keras import optimizers, regularizers
from tensorflow.keras.layers import Dense, Dropout, BatchNormalization, Con... |
6be9212314efba37eaf09fe9e56ff1825028dfae137dfec1496aa5e8e04b7836 | Python | 8,276 | 201 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
759a6c2dca5c2ceac333c8b4cf3654af42e833e0fc080c33980d6d0e94958d2c | Python | 8,279 | 176 | # This file is part of me-features-to-mol-ID-mapping.
#
#
# Copyright © 2021-2022 Blue Brain Project/EPFL
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the APACHE-2 License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... |
264c42966b3eca8ab6308ec8a7bc9bcb6d575526b6cdcb8a56fe2c2fc918fed4 | Python | 8,280 | 326 | #%%
import datetime
import time
from pathlib import Path
import colorcet as cc
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from graspologic.utils import remove_loops
from mpl_toolkits.axes_grid1 import make_axes_locatable
from src.data import lo... |
f577f7b75de8adb4b13f57ac7efd37d61182b6ea88fc10fbd67771bc5cade0ec | Python | 8,280 | 237 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
c83df01fd0dfec3525954e7626ccbc19551cce0c5625e6f5c62aa61780d876d0 | Python | 8,281 | 210 | import os
import collections
from os.path import join
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
f734100d9a4b454d6d9cdbdb205d3d6ea87cc4209fd433d9d0ca43592d4e0881 | Python | 8,283 | 204 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
00f725ca8c3d752ed6789181aa17caae76a0870e91f1c701549332213dbaeabb | Python | 8,286 | 195 | import numpy as np
import jax.numpy as jnp
from ..typing import Callable, Union
from .coupling import CouplingNode
from .forward import ForwardMesh
def checkerboard_to_param(checkerboard: np.ndarray, units: int):
param = np.zeros((units, units // 2))
if units % 2:
param[::2, :] = checkerboard.T[::2, ... |
7118ac874dad29bdb2e05c271500bce47458ff0f4bdf4f5ded0fe1a092d1a1d5 | Python | 8,286 | 209 | # -*- coding: utf-8 -*-
# Building blocks of the data-driven dose calculator.
# COPYRIGHT: TU Delft, Netherlands. 2021.
import numpy as np
import tensorflow as tf
from tensorflow.keras import Sequential, layers
from tensorflow_addons.layers import GroupNormalization
class ConvEncoder(layers.Layer):
""" Learnable p... |
a7a59ff7981cb8b6816b9cab7790eb9067dd994c3a02016f1b8063578de75353 | Python | 8,286 | 202 | # Copyright 2020-21 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
761d2953ffc522b1a4a4f47742b0832babf42370d059250173f7f3e81df09362 | Python | 8,287 | 261 | import torch
import itertools
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from torch_geometric.datasets import TUDataset
from torch_geometric.utils import to_networkx, remove_isolated_nodes
from graphxai.datasets.dataset import GraphDa... |
168a17da8f401ac045665f71e023d8745aacf40f608de0c332a20cb43315e8c5 | Python | 8,288 | 204 | # Copyright 2020-2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
5c5227450369986fbd2e756ffc489d119f4d68e012feaa1641056daccc068e7c | Python | 8,293 | 196 | import sys, time, os, io, warnings, importlib
import typing as tp
import numpy as np
import torch, torchvision
from torchvision.models._utils import IntermediateLayerGetter
import PIL.Image
warnings.simplefilter('ignore') #pytorch is too noisy
if "__torch_package__" in dir():
#inside a torch package
import t... |
1571cfc2c9a8862c742bd5c829bd348c9ab8515a6f942d39ab624b15023907d7 | Python | 8,294 | 209 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
3131ac9c1e90915ceab5be80e8d3507bb451743d99ecb74b0fe7ade1953e7e8c | Python | 8,295 | 210 | import os
import collections
from os.path import join
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
63ed5c39d5bff1c5cbab560a1f0525f9cbb6ad872ac5251f234815adf3213c53 | Python | 8,296 | 202 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
031f43fa7588c46475d8f7efc51d8c550b719c40598e7ace28af3cfa35cbe7f7 | Python | 8,302 | 218 | #!/usr/bin/env python3
"""
File: covariate_cluster_plot.py
Created: 2020/04/27
Last Changed:
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softwar... |
4db4f865b36d3d7817e47b0f46ad4009213ebeb172dbcda44c6f1aefb91c2b70 | Python | 8,307 | 195 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
aff681bba6415b6276d0c5b09dcf4228afccb6e6aa19bc65c4f347e463a607e7 | Python | 8,309 | 262 | import torch
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.nn.modules.utils import _pair
from maskrcnn_benchmark import _C
class DeformConvFunction(Function):
@staticmethod
def forward(
ctx,
input,
offset,
weight,
... |
86f9872e9f67954815c3e55f7bebb84e81c9f658e13a1db6bdb1e76575b718df | Python | 8,314 | 209 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
a3f5a3e6d545f6bdab7ad76dfff629d6b8d80db1c95fd423ea68d483799bbd8b | Python | 8,316 | 203 | import tqdm
import ipdb
import argparse, sys; sys.path.append('../..')
import random as rand
import torch
from metrics import *
from graphxai.explainers import *
from graphxai.datasets import load_ShapeGGen
from graphxai.datasets.shape_graph import ShapeGGen
from graphxai.utils.performance.load_exp import exp_exists
f... |
eb0db8b6943ae785b92cc7595ecebfbacb6d2deea162c5d8ae47d995701b8ca5 | Python | 8,317 | 219 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
import datetime
import logging
import os
import time
import torch
import torch.distributed as dist
from tqdm import tqdm
import numpy as np
from maskrcnn_benchmark.data import make_data_loader
from maskrcnn_benchmark.utils.comm import get_world_si... |
53e4617b8563cf1eabe85a1f85c9cec3730dba678337a2f495caf601bda18ba7 | Python | 8,318 | 282 | import os
import shutil
from pathlib import Path
import torch
from torch import nn
from torch.utils.data import Dataset, DataLoader
from neuralop.models import FNO, ConditionalFNO
from neuralop.data.datasets import load_darcy_flow_small
from neuralop import Trainer, LpLoss, H1Loss
from neuralop.tests.test_utils impor... |
4788ad11f34230187b7aaf996e272cb04c957eb215578bc8beca460d4ca1f655 | Python | 8,319 | 205 | """Command line client for downloading Finnish parliament data."""
import shutil
import subprocess
from logging import Logger
from pathlib import Path
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Optional
import pandas as pd
import requests
from ... |
5a55f52a38d9d714b9ccc46c1c156a4b936fc51963432969320578fe4b00ff8a | Python | 8,319 | 199 | # Copyright 2020-2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
a6e09d78c70c7fdab02eb9c3fb59ca5ed221b1bd29522ac17f09d00c2a38536a | Python | 8,319 | 271 | import torch
from torch.nn import Parameter
from torch.testing import assert_close
import pytest
import math
import neuralop.training.tensorgrad as tensorgrad_module
from ..adamw import AdamW
from ..tensorgrad import (
TensorGRaD,
TensorGRaDProjector,
UnstructuredSparseProjector,
fno_tensorgrad_param_g... |
736eb96bb8cb6aa7c4f31f9e74ee1bad830a3165298a35def01faa8faef7ccb5 | Python | 8,321 | 261 | import torch
from pathlib import Path
import numpy as np
from utils.data import make_blobs_dataset, make_trees_dataset
from utils.nnet import get_device
from hebbcl.logger import MetricLogger1Hidden, LoggerFactory
from hebbcl.model import Nnet, ModelFactory
from hebbcl.trainer import Optimiser, train_on_blobs, train_... |
c52f02ee4c3d94e77ae158d3d3fb18baad719fef38b150b4008a6124987c424d | Python | 8,321 | 229 | """Contains the SensorChannel class definition.
SensorChannel objects are automatically created by SensorServiceDrivers when a sensor device is connected and fully
set up by the driver.
Examples:
sc = SensorChannel("name", parent=mySensorServiceDriver)
sc.add_sample(483943, 0.48502)
"""
from typi... |
4da1488c7d75fa36181ac7a671746d8c5c5a58529140cc0dd678d583ed816b46 | Python | 8,324 | 202 | import os
from os.path import join
import collections
import numpy as np
import pandas as pd
from itertools import chain
from sklearn.model_selection import train_test_split
from sklearn.impute import SimpleImputer, MissingIndicator
from sklearn.pipeline import make_union, Pipeline
from sklearn.ensemble import RandomF... |
cb703302aacbb2fd2e6e423f56ffdf78fd95f22f2b85976e546b9677d16b9519 | Python | 8,324 | 219 | import colorsys
import os
import time
import numpy as np
import torch
import torch.nn as nn
from PIL import ImageDraw, ImageFont
from torchvision.transforms import ToPILImage
from nets.yolo import YoloBody
from utils.utils import (cvtColor, get_anchors, get_classes, preprocess_input,
resize_i... |
01c2d92633f84ba42d40a726939552a203e1d0e33ae4948842b37cd67d036538 | Python | 8,325 | 154 | __author__ = 'duarte'
from modules.parameters import ParameterSet, ParameterSpace, extract_nestvalid_dict
from modules.input_architect import EncodingLayer, InputSignalSet, InputNoise, InputSignal
from modules.net_architect import Network
from modules.io import set_storage_locations
from modules.signals import iterate_... |
789d466d350d7ab3cf4e439489a0e3252348ab6654a05435625b4e63c8454de8 | Python | 8,325 | 276 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import keras
import keras.engine as engine
import keras.layers as layers
import keras.optimizers as optimizers
import unetsl
import unetsl.cli_interface
import unetsl.model
import unetsl.data
import random
import sys
import numpy
from keras.models import load_model
from ... |
184647ea61145ebbfaa96a2f6d940b728c87107cafaa5aaa955c00f408447683 | Python | 8,326 | 324 | # %% [markdown]
# ## Imports
import os
import time
from itertools import chain
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import rankdata
from graspy.cluster import AutoGMMCluster
from src.data import load_metagraph
from src.grap... |
bc748d953b2ae229e34b87ff84a68c717f8454c945b31bca3c7de5d2947f1598 | Python | 8,326 | 175 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
fb6a8c34911a416cfea2dbaffb77b53034fde4826ca161e7412bf9389109634d | Python | 8,327 | 201 | """
mayavi - 3D visualization tool; based on vtk
Rotate camera with mouse; ctrl/shift + mouse also moves camera in a different way
## Set size and background color
fig = mlab.figure(size=(720,720), bgcolor = (0.9, 0.9,0.9))
fig.scene._lift() # to save screenshots in jupyter notebook
view = mlab.view() -> get current... |
c39fc0e96095aa2e0009fd338bc968bda4ce905eb671ed8f3003326448830691 | Python | 8,330 | 213 | # Copyright 2022 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
2859fb9f8f589cf52dedd740365cecd340ea73c224fa472dd52b74f8fe21c6be | Python | 8,337 | 233 | """
Visualizing computational fluid dynamics on a car
===================================================
In this example we visualize a mesh drawn from the :class:`~neuralop.data.datasets.car_cfd_dataset.CarCFDDataset`.
This tutorial demonstrates how to work with unstructured mesh data from computational fluid dynami... |
8a4f9cbbb5e5822708121ce14d65066d97ac3982412330ffa38304d31635fca9 | Python | 8,339 | 182 | #!/usr/bin/env python3
"""
Based on
https://github.com/BIDS-Apps/example/blob/aa0d4808974d79c9fbe54d56d3b47bb2cf4e0a0d/run.py
"""
import argparse
import json
import os
import os.path as op
import sys
from glob import glob
import nibabel as nib
import numpy as np
import pandas as pd
from nilearn import masking
from nil... |
aaaba57db5874e6e0e789c61447eedf000fb2b73b6fbb9b00dcac9aeecb57940 | Python | 8,340 | 208 | """
File: perform_celltype_factorization.py
Created: 2020/04/07
Last Changed: 2020/07/15
Author: M.Vochteloo
Copyright (C) 2020 M.Vochteloo
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foun... |
15a2185c639ab43f926be08e8b1bef3c320cb40cc9e251eebaa54f28aa2192d2 | Python | 8,343 | 228 | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import torch.nn.functional as F
__all__ = ['Res2Net', 'res2net50_v1b', 'res2net101_v1b', 'res2net50_v1b_26w_4s']
model_urls = {
'res2net50_v1b_26w_4s': 'https://shanghuagao.oss-cn-beijing.aliyuncs.com/res2net/res2net50_v1b_26... |
92e503aec7624f25f9e68811761546da42403b3197217abc4ac106cacbc1f25b | Python | 8,348 | 209 | import logging
import unittest
from oaklib.implementations.ubergraph.ubergraph_implementation import UbergraphImplementation
from oaklib.datamodels.search import SearchConfiguration
from oaklib.datamodels.vocabulary import IS_A, PART_OF
from tests import OUTPUT_DIR, INPUT_DIR, VACUOLE, DIGIT, CYTOPLASM, CELLULAR_COMP... |
9a6059bd4004c7e1256f1f99bb5169e72226e18b5331b17342dff598957c2a59 | Python | 8,349 | 273 | """
This module provides the `Proteome` clasee. This class wraps the
indexed FASTA file for an organism's proteomic sequence. It supports
retrieving parts of the sequence and converting these parts into their
one-hot encodings.
"""
import numpy as np
import pyfaidx
from .sequence import Sequence
from .sequence import... |
c7e0707673019ac847d32571d4b027137683623b90c0accd108888294f279dd1 | Python | 8,350 | 240 | """Command-line interface."""
import importlib
import logging
from datetime import date
from datetime import timedelta
from pathlib import Path
from typing import List
from typing import TextIO
import click
from fi_parliament_tools import downloads
from fi_parliament_tools import mptable
from fi_parliament_tools.post... |
9f8c049ddf465e788163067a18d5bfc187c70a0486d70d3d4e38e7edd4415371 | Python | 8,354 | 245 |
# Blender modules
import bpy, bmesh
import vmv.mesh
####################################################################################################
# @convert_to_mesh_object
####################################################################################################
def convert_to_mesh_object(bmesh_obj... |
d2fe4fe8ec4cddb5262c0cc60070788c4361a1c5315979541b35bc44546c39e3 | Python | 8,355 | 228 | import torch.nn as nn
import math
import torch.utils.model_zoo as model_zoo
import torch
import torch.nn.functional as F
__all__ = ['Res2Net', 'res2net50_v1b', 'res2net101_v1b', 'res2net50_v1b_26w_4s']
model_urls = {
'res2net50_v1b_26w_4s': 'https://shanghuagao.oss-cn-beijing.aliyuncs.com/res2net/res2net50_v1b_26... |
e73ab8d5688bcecb59bf6dab05156d7d141169b22d92b98a097faec667f93a6f | Python | 8,355 | 209 | # Copyright 2020-21 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
497d3b98b04724df1e47b2985afd815fa7cd917a5dee64a97c055843b029bb74 | Python | 8,356 | 203 | import os
import glob
import pickle
import json
import itertools
import numpy as np
import pandas as pd
import utils2p
import flydf
import utils_Florian
import deepfly.signal_util
import deepfly.core
from deepfly.cv_util import triangulate_linear
from deepfly.procrustes import procrustes_seperate
import df3dPost... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.