repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
abedghanbari2/SkullStripperUNET | [
"35b99420bf27b2dd3ffe62fb360867b0e247d3a9"
] | [
"dataset.py"
] | [
"# Loading data and defining dataset class\nfrom torch.utils.data import Dataset\nimport torchvision.transforms.functional as F\nimport numpy as np\nimport SimpleITK as sitk\nfrom utils import cvt1to3channels, normalize_image\nimport random\nfrom PIL import Image\nfrom torchvision import transforms\nimport os\nfrom... | [
[
"numpy.uint8",
"numpy.unique"
]
] |
croepke/CarND-Capstone | [
"24ec5e121baadc96d087ac5ee9619b7ab86dffb3"
] | [
"ros/src/tl_detector/tl_detector.py"
] | [
"#!/usr/bin/env python\nimport rospy\nfrom std_msgs.msg import Int32\nfrom geometry_msgs.msg import PoseStamped, Pose\nfrom styx_msgs.msg import TrafficLightArray, TrafficLight\nfrom styx_msgs.msg import Lane\nfrom sensor_msgs.msg import Image\nfrom cv_bridge import CvBridge\nfrom light_classification.tl_classifier... | [
[
"scipy.spatial.KDTree"
]
] |
BGU-CS-VIL/DeepDPM | [
"46649f29513e3f69dcaea913b57c75b4b16a9d61"
] | [
"src/clustering_models/clusternet_modules/models/Classifiers.py"
] | [
"#\n# Created on March 2022\n#\n# Copyright (c) 2022 Meitar Ronen\n#\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass MLP_Classifier(nn.Module):\n def __init__(self, hparams, codes_dim=320, k=None, weights_fc1=None, weights_fc2=None, bias_fc1=None, bias_fc2=None,):\n supe... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.isnan",
"torch.ones",
"torch.cuda.is_available",
"torch.mul",
"torch.FloatTensor",
"torch.logical_not",
"torch.tensor",
"torch.zeros",
"torch.nonzero",
"torch.nn.Sequential",
"torch.nn.functional.dropout",
"torch.nn.ReL... |
davenquinn/Attitude | [
"f7cd15212ca7a2f9a0e367cf9769e382eeaea91e"
] | [
"attitude/display/error_comparison.py"
] | [
"import numpy as N\nfrom matplotlib.pyplot import subplots\nfrom scipy.stats import chi2\n\nfrom ..orientation import Orientation\nfrom ..error.axes import sampling_axes, noise_axes\nfrom ..geom.util import vector\nfrom .plot.cov_types import hyperbola, bootstrap_noise, augment, ci\nfrom .hyperbola import Hyperboli... | [
[
"numpy.linspace",
"numpy.abs",
"matplotlib.pyplot.subplots"
]
] |
bbrelje/openconcept | [
"b41bc831ed6aa2742ec35cacd3249395ee4527db"
] | [
"openconcept/components/tests/test_heat_exchanger.py"
] | [
"from __future__ import division\nimport unittest\nimport numpy as np\nfrom openmdao.utils.assert_utils import assert_rel_error, assert_check_partials\nfrom openmdao.api import IndepVarComp, Group, Problem\nfrom openconcept.components.heat_exchanger import OffsetStripFinGeometry, OffsetStripFinData, HydraulicDiamet... | [
[
"numpy.ones"
]
] |
dkkim93/SuperSuit | [
"eff7cc2990504f061c8aff3213f72588d2db2703"
] | [
"supersuit/aec_wrappers.py"
] | [
"from .base_aec_wrapper import BaseWrapper, PettingzooWrap\nfrom gym.spaces import Box, Space, Discrete\nfrom . import basic_transforms\nfrom .adv_transforms.frame_stack import stack_obs_space, stack_init, stack_obs\nfrom .action_transforms import homogenize_ops\nfrom .adv_transforms import agent_indicator as agent... | [
[
"numpy.minimum",
"numpy.zeros_like",
"numpy.maximum",
"numpy.clip"
]
] |
DesmonDay/DistGPUGraph | [
"19966502db48605091aa07c441668015bab70dbe"
] | [
"test_multi_cards.py"
] | [
"import warnings\nwarnings.filterwarnings('ignore')\n\nimport numpy as np\nimport paddle\nimport paddle.distributed as dist\n\nfrom gpu_shard_tool import ShardTool\nfrom gather_scatter_layer import GatherScatter\n\n\n\"\"\"\n2-Cards Example:\n\nGPU0:\nnode_info = {\"node_sidx\": 0, \"node_eidx\": 9}\nforward_meta_i... | [
[
"numpy.random.seed",
"numpy.random.randint",
"numpy.random.randn"
]
] |
adamdempsey90/QuadTreeAMR | [
"d48e51b31debdf087a0a8d43347b5a6b7e316421"
] | [
"qtamr/DataClass.py"
] | [
"import numpy as np\nimport h5py\n\nclass Quantity():\n def __init__(self,name,fname=None):\n self.name = name\n self.load(fname)\n def load(self,fname):\n if fname is None:\n self.avg = None\n self.std = None\n self.rms = None\n return\n ... | [
[
"numpy.isclose"
]
] |
hequn/MLLearning | [
"e2b9b405ade00e7a69da28454aa8172c9006f0d0",
"e2b9b405ade00e7a69da28454aa8172c9006f0d0",
"e2b9b405ade00e7a69da28454aa8172c9006f0d0"
] | [
"test/test11_feature_matcher/FlannBasedMatcher_SURF.py",
"test/test3_linear_regression.py",
"test/test4_tf_pb_reader.py"
] | [
"import numpy as np\nimport cv2\nfrom matplotlib import pyplot as plt\n\nimgname1 = '../cow_back1.jpg'\nimgname2 = '../cow_back2.jpg'\n\nsurf = cv2.xfeatures2d.SURF_create()\n\nFLANN_INDEX_KDTREE = 0\nindex_params = dict(algorithm=FLANN_INDEX_KDTREE, trees=5)\nsearch_params = dict(checks=50)\nflann = cv2.FlannBased... | [
[
"numpy.hstack"
],
[
"matplotlib.pyplot.ion",
"numpy.array",
"matplotlib.pyplot.contourf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.scatter",
"matplotli... |
johnblanco/predictor_electoral | [
"60c19d002630702e42179ea2661266371560bf6c"
] | [
"scripts/pca.py"
] | [
"import pandas as pd\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.decomposition import PCA\nfrom sklearn.neighbors import KNeighborsClassifier\nimport json\n\n\nQUESTIONS_COUNT = 26\n\nwith open(\"../predictor_pol/candidatos.json\", \"r\") as f:\n CAND_DATA = json.load(f)\n\n\ndef get_part... | [
[
"sklearn.model_selection.train_test_split",
"pandas.read_csv",
"sklearn.decomposition.PCA",
"sklearn.neighbors.KNeighborsClassifier"
]
] |
Xodarap/models | [
"08bb9eb5ad79e6bceffc71aeea6af809cc78694b"
] | [
"official/modeling/model_training_utils.py"
] | [
"# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.keras.metrics.Mean",
"tensorflow.io.gfile.GFile",
"tensorflow.range",
"tensorflow.train.latest_checkpoint",
"tensorflow.GradientTape",
"tensorflow.convert_to_tensor",
"tensorflow.summary.scalar",
"tensorflow.function",
"tensorflow.executing_eagerly",
"tensorflow... |
fexolm/modin | [
"292b8efe266a86c1a8b28893922917ecef7b813f"
] | [
"modin/pandas/io.py"
] | [
"# Licensed to Modin Development Team under one or more contributor license agreements.\n# See the NOTICE file distributed with this work for additional information regarding\n# copyright ownership. The Modin Development Team licenses this file to you under the\n# Apache License, Version 2.0 (the \"License\"); you... | [
[
"pandas.read_orc",
"pandas.read_sql",
"pandas.json_normalize"
]
] |
mathraim/deepmath | [
"1f0a75b26763d62b1d0cdcf1355cf7218ddcb09a"
] | [
"deepmath/layers/dense.py"
] | [
"import numpy as np\nfrom deepmath.base_classes.layer import Layer\nfrom deepmath.base_classes.optimizer import Optimizer\n\n\nclass Dense(Layer):\n \"\"\"\n child class of Layer that represents the Dense layer in the network\n\n ...\n\n Attributes\n ----------\n previous : Layer object\n ... | [
[
"numpy.sum",
"numpy.random.randn",
"numpy.zeros"
]
] |
fei-protocol/checkthechain | [
"ec838f3d0d44af228f45394d9ba8d8eb7f677520"
] | [
"src/ctc/cli/commands/data/blocks_command.py"
] | [
"from __future__ import annotations\n\nimport typing\n\nimport toolcli\nimport tooltime\n\nfrom ctc import evm\nfrom ctc import rpc\nfrom ctc import spec\n\nfrom ctc.cli import cli_utils\n\n\ndef get_command_spec() -> toolcli.CommandSpec:\n return {\n 'f': async_block_command,\n 'help': 'output inf... | [
[
"pandas.DataFrame"
]
] |
mingzhaochina/AH-RJMCMC | [
"d406c14b363ca59e5bc8d7700196d9b025070f52"
] | [
"RJMCMC_inversion.py"
] | [
"\nimport numpy as np\nimport sys\nimport os\n\n\"\"\"\nfrom numba import jit\n@jit\n\n\ndef function1(age):\n n = len(age)\n # age = midpoint_age.copy()\n a = np.array([ [ x * y for x in age ] for y in age ])\n \n@jit\n\nfrom numba import jit\n@jit(nopython =True)\n\"\"\"\ndef RJMCMC(Model_paramete... | [
[
"numpy.random.rand",
"numpy.min",
"numpy.exp",
"numpy.size",
"numpy.max",
"numpy.seterr",
"numpy.interp",
"numpy.random.randint",
"numpy.argmax",
"numpy.sqrt",
"numpy.append",
"numpy.mod",
"numpy.array",
"numpy.delete",
"numpy.zeros",
"numpy.random.r... |
IEM-Computer-Vision/jax | [
"d9d8bbb8c6f75a75d330561ad0ddc0008db92bed"
] | [
"jax/numpy/lax_numpy.py"
] | [
"# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ... | [
[
"numpy.not_equal",
"numpy.sign",
"numpy.where",
"numpy.size",
"numpy.broadcast_to",
"numpy.dtype",
"numpy.log",
"numpy.arange",
"numpy.ndim",
"numpy.equal",
"numpy.array",
"numpy.zeros",
"numpy.shape",
"numpy.diff",
"numpy.isscalar",
"numpy.version.v... |
mohataher/scikit-kinematics | [
"fa8c80c13981310666e22dcd35138be1af1b4318"
] | [
"skinematics/setup.py"
] | [
"def configuration(parent_package='',top_path=None):\n from numpy.distutils.misc_util import Configuration\n config = Configuration('skinematics', parent_package, top_path)\n\n '''\n # An example Fortran extension\n config.add_extension(\n 'fortran_stuff',\n sources=['fortran_st... | [
[
"numpy.distutils.misc_util.Configuration"
]
] |
neoshanarayanan/lammps_simulations | [
"04e55e3b74da588e70a08b6b9f1d79fc4dc0b7d4"
] | [
"examples/python/py_nve.py"
] | [
"from __future__ import print_function\nimport lammps\nimport ctypes\nimport traceback\nimport numpy as np\n\nclass LAMMPSFix(object):\n def __init__(self, ptr, group_name=\"all\"):\n self.lmp = lammps.lammps(ptr=ptr)\n self.group_name = group_name\n\nclass LAMMPSFixMove(LAMMPSFix):\n def __init... | [
[
"numpy.take"
]
] |
awesome-archive/FEAT | [
"940d525fcbf2a40528d284392a03e4b0193344a7"
] | [
"train_feat.py"
] | [
"import argparse\nimport os.path as osp\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nfrom torch.utils.data import DataLoader\n\nfrom feat.models.feat import FEAT \nfrom feat.dataloader.samplers import CategoriesSampler\nfrom feat.utils import pprint, set_gpu, ensure_path, Averager, Timer, c... | [
[
"torch.zeros",
"torch.optim.lr_scheduler.StepLR",
"numpy.zeros",
"torch.arange",
"torch.no_grad",
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available",
"torch.eye",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
scuervo91/pvtpy | [
"6fe42caee6a193e7a406b3461a397dada3c32445"
] | [
"pvtpy/fluids/oil.py"
] | [
"from pydantic import Field\nimport numpy as np\nimport pandas as pd\nfrom scipy.interpolate import interp1d\nfrom ..pvt import PVT\nfrom .base import FluidBase\nfrom ..black_oil import correlations as cor \nfrom ..units import Pressure\n#(\n# n2_correction, co2_correction, h2s_correction, pb, rs,\n# bo, rho_... | [
[
"numpy.max",
"numpy.concatenate",
"scipy.interpolate.interp1d",
"numpy.min",
"numpy.linspace"
]
] |
andrewkern/tskit | [
"acd2fe1de6fe8738e885f98fa6129c9a7a957cfc"
] | [
"python/tskit/util.py"
] | [
"# MIT License\n#\n# Copyright (c) 2018-2019 Tskit Developers\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to us... | [
[
"numpy.any",
"numpy.array",
"numpy.iinfo",
"numpy.dtype"
]
] |
tricomm/head-pose-estimation | [
"188cf134e872e42e6d9e19b1cfab2d266734a9ee"
] | [
"estimate_head_pose.py"
] | [
"\"\"\"Demo code shows how to estimate human head pose.\nCurrently, human face is detected by a detector from an OpenCV DNN module.\nThen the face box is modified a little to suits the need of landmark\ndetection. The facial landmark detection is done by a custom Convolutional\nNeural Network trained with TensorFlo... | [
[
"numpy.array",
"numpy.reshape"
]
] |
gismart/bi-utils | [
"09654c5d3b5c47dcbc8745f7f52b5a3c2ae9ce4e"
] | [
"tests/utils.py"
] | [
"import os\nimport pandas as pd\nfrom sklearn.model_selection import ParameterGrid\nfrom typing import Any, Dict\n\n\ndef data_path(filename: str) -> str:\n data_dir = os.path.join(os.path.dirname(__file__), \"data\")\n data_path = os.path.join(data_dir, filename)\n return data_path\n\n\ndef make_target_da... | [
[
"sklearn.model_selection.ParameterGrid",
"pandas.DataFrame"
]
] |
Joel-H-dot/scikit-learn | [
"07a4c98b0de2543aae48fe17e057c506a8cecea2"
] | [
"sklearn/model_selection/_search_successive_halving.py"
] | [
"from copy import deepcopy\r\nfrom math import ceil, floor, log\r\nfrom abc import abstractmethod\r\nfrom numbers import Integral\r\n\r\nimport numpy as np\r\nfrom ._search import _check_param_grid\r\nfrom ._search import BaseSearchCV\r\nfrom . import ParameterGrid, ParameterSampler\r\nfrom ..base import is_classif... | [
[
"numpy.max",
"numpy.array",
"numpy.asarray",
"numpy.argmax",
"numpy.argsort",
"numpy.unique",
"numpy.flatnonzero"
]
] |
ajsockol/ACT | [
"976002b50bade6cf1ad3d86ffabe3aed9d6e0bbb"
] | [
"act/qc/arm.py"
] | [
"\"\"\"\nact.qc.arm\n------------------------------\n\nFunctions specifically for working with QC/DQRs from\nthe Atmospheric Radiation Measurement Program (ARM)\n\n\"\"\"\n\nimport requests\nimport datetime as dt\nimport numpy as np\n\n\ndef add_dqr_to_qc(obj, variable=None, assessment='incorrect,suspect',\n ... | [
[
"numpy.datetime64"
]
] |
MI2DataLab/fooling-partial-dependence | [
"0bd7ea554769f390cdafeb4fc7ce3b8626112867"
] | [
"heart-gradient.py"
] | [
"# ---------------------------------\n# example: heart / NN / variable\n# > python heart-gradient.py\n# ---------------------------------\n\n\nimport tensorflow as tf\nimport argparse\nparser = argparse.ArgumentParser(description='main')\nparser.add_argument('--variable', default=\"age\", type=str, help='variable')... | [
[
"tensorflow.random.set_seed",
"numpy.random.seed",
"tensorflow.keras.Sequential",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.experimental.preprocessing.Normalization",
"pandas.read_csv",
"tensorflow.keras.optimizers.Adam",
"tensorflow.get_logger"
]
] |
onlyrico/determined | [
"c6f23186c3191bfe4b8caf8a091ad76a1e2298c2"
] | [
"harness/determined/keras/_tf_keras_trial.py"
] | [
"import inspect\nimport logging\nimport pathlib\nimport pickle\nimport random\nimport sys\nfrom abc import abstractmethod\nfrom typing import Any, Dict, List, Optional, Type, cast\n\nimport h5py\nimport numpy as np\nimport tensorflow as tf\nfrom packaging import version\nfrom tensorflow.keras.models import Model\nf... | [
[
"tensorflow.config.experimental.set_visible_devices",
"tensorflow.python.keras.callbacks.set_callback_parameters",
"tensorflow.python.keras.saving.hdf5_format.load_optimizer_weights_from_hdf5_group",
"numpy.random.seed",
"tensorflow.compat.v1.get_default_graph",
"tensorflow.compat.v1.Confi... |
Algorithmic-Alignment-Lab/openTAMP | [
"f0642028d551d0436b3a3dbc3bfb2f23a00adc14",
"f0642028d551d0436b3a3dbc3bfb2f23a00adc14",
"f0642028d551d0436b3a3dbc3bfb2f23a00adc14",
"f0642028d551d0436b3a3dbc3bfb2f23a00adc14",
"f0642028d551d0436b3a3dbc3bfb2f23a00adc14"
] | [
"opentamp/policy_hooks/namo/sort_prob.py",
"opentamp/policy_hooks/robosuite/arm_hyp.py",
"opentamp/policy_hooks/namo/hyperparams_v88.py",
"opentamp/core/util_classes/openrave_body.py",
"opentamp/robo_wiping.py"
] | [
"\"\"\"\nDefines utility functions for planning in the sorting domain\n\"\"\"\nimport copy\nfrom collections import OrderedDict\nimport itertools\nimport numpy as np\nimport random\nimport time\n\nfrom opentamp.core.internal_repr.plan import Plan\nfrom opentamp.core.util_classes.namo_predicates import dsafe, GRIP_V... | [
[
"numpy.sum",
"numpy.array",
"numpy.abs",
"numpy.zeros"
],
[
"numpy.ones"
],
[
"numpy.ones"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.linalg.norm",
"numpy.dot",
"numpy.isnan",
"numpy.minimum",
"numpy.sum",
"numpy.eye",
"numpy.sqrt",
... |
BrookInternSOMA/pix2pix-barcode | [
"e9a8a0709caa6271975072ea3417c118bb50dade"
] | [
"tools/process.py"
] | [
"from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport argparse\nimport os\nimport tempfile\nimport subprocess\nimport tensorflow as tf\nimport numpy as np\nimport tfimage as im\nimport threading\nimport time\nimport multiprocessing\n\nedge_pool = N... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.pad",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"numpy.ones",
"tensorflow.Session",
"tensorflow.local_variables_initializer"
]
] |
lucagrementieri/eegdrive | [
"65b122246e2a75c0c7c80db3e544f6a6741ceb53"
] | [
"eegdrive/models/random_conv.py"
] | [
"import itertools\nfrom typing import Tuple, List\n\nimport torch\nfrom torch import nn\nimport torch.nn.functional as F\n\n\nclass RandomConv1d(nn.Module):\n def __init__(\n self,\n channels: int,\n filters: int,\n sizes: Tuple[int, ...] = (7, 9, 11),\n max... | [
[
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.nn.init.normal_",
"torch.nn.init.uniform_",
"torch.nn.functional.pad"
]
] |
dougollerenshaw/mpl_figure_formatter | [
"63b6f11db57b400afa2db97b6336b74bb212a88b"
] | [
"figrid/__init__.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\n\n__version__ = '0.1.6'\n\ndef place_axes_on_grid(\n fig,\n dim=[1, 1],\n xspan=[0, 1],\n yspan=[0, 1],\n wspace=None,\n hspace=None,\n sharex=False,\n sharey=False,\... | [
[
"matplotlib.pyplot.Subplot",
"numpy.array",
"matplotlib.pyplot.setp",
"matplotlib.gridspec.GridSpec"
]
] |
ALSM-PhD/quip_classification | [
"7347bfaa5cf11ae2d7a528fbcc43322a12c795d3",
"7347bfaa5cf11ae2d7a528fbcc43322a12c795d3",
"7347bfaa5cf11ae2d7a528fbcc43322a12c795d3"
] | [
"u24_lymphocyte/third_party/treeano/sandbox/nodes/activation_transformation.py",
"u24_lymphocyte/download_heatmap/get_tumor_labeled_maps/get_tumor_pos_neg_map.py",
"u24_lymphocyte/third_party/treeano/utils.py"
] | [
"import numpy as np\nimport theano\nimport theano.tensor as T\nimport treeano\nimport treeano.nodes as tn\n\n\nfX = theano.config.floatX\n\n\n@treeano.register_node(\"concatenate_negation\")\nclass ConcatenateNegationNode(treeano.NodeImpl):\n\n \"\"\"\n concatenates a negated copy of the actviations on a spec... | [
[
"numpy.concatenate"
],
[
"numpy.transpose"
],
[
"numpy.array",
"numpy.dtype",
"numpy.zeros",
"numpy.maximum"
]
] |
crazywiden/fmlpy | [
"e813fa148a410a0681fee2a4577da7208aad04fc"
] | [
"tests/preprocess/bar_test.py"
] | [
"import sys\nimport os\nfrom os.path import dirname\nsys.path.append(dirname(dirname(dirname(os.getcwd()))))\nfrom fmlpy.preprocess import bars\nimport subprocess\nimport argparse\nimport pandas as pd\nimport numpy as np \n\ndef parser_args():\n descrip = \"time bars check\"\n parser = argparse.ArgumentParser... | [
[
"numpy.where",
"pandas.read_csv"
]
] |
tuaplicacionpropia/webbrowser | [
"2428dfeee1349cee32024cf16f8a3367a318be17"
] | [
"sbrowser/utils.py"
] | [
"#!/usr/bin/env python2.7\n#coding:utf-8\n\nimport os\nimport time\nimport datetime\nimport hjson\nimport numpy as np\nimport codecs\nimport shutil\n\n#click problem\n#https://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error\n#https://peter.sh/experiments/chromium-command-line-... | [
[
"numpy.zeros"
]
] |
Vlad116/paraphrase-identification-with-framebank | [
"4817523b1fa58e6b45a4ab123e254aa7bdb55f27"
] | [
"models/AI_BLSTM.py"
] | [
"# import sys\n# sys.path.append('C:\\\\Users\\\\User\\\\Desktop\\\\SRL_models\\\\utils')\nfrom models_utils import Dataset \nimport time\nimport torch\nfrom torch import nn\nfrom torch.nn import functional as func\nfrom torch.autograd import Variable\nfrom torch.nn.utils import rnn\nimport pickle\nimport numpy\nfr... | [
[
"torch.nn.Linear",
"torch.Size",
"torch.cat",
"torch.stack",
"numpy.asarray",
"torch.nn.CrossEntropyLoss",
"torch.from_numpy",
"torch.nn.utils.rnn.pad_packed_sequence",
"torch.nn.functional.softmax",
"torch.nn.Embedding",
"torch.reshape"
]
] |
rebeccadavidsson/uncertainty-toolbox | [
"89c42138d3028c8573a1a007ea8bef80ad2ed8e6"
] | [
"examples/viz_recalibrate.py"
] | [
"\"\"\"\nExamples of code for recalibration.\n\"\"\"\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import rc\n\nimport uncertainty_toolbox.data as udata\nimport uncertainty_toolbox.metrics as umetrics\nfrom uncertainty_toolbox.metrics_calibration import (\n get_proportion_lists_vectorized... | [
[
"numpy.random.seed",
"matplotlib.pyplot.rcParams.update"
]
] |
BoHuangLab/timeunet | [
"8fd34b18e9c4420db8172a402c243f7d03c853f1"
] | [
"Self-Supervised Training with Noise2Self/mask.py"
] | [
"#from https://github.com/czbiohub/noise2self/blob/master/mask.py\n\nimport numpy as np\nimport torch\n\nclass Masker:\n \"\"\"Object for masking and demasking\"\"\"\n\n def __init__(\n self, width=3, mode=\"zero\", infer_single_pass=False, include_mask_as_input=False\n ):\n self.grid_size = ... | [
[
"torch.zeros",
"numpy.array",
"torch.ones",
"torch.Tensor",
"torch.nn.functional.conv2d"
]
] |
makoto-sofue/vit-pytorch-lightning | [
"da8cace2ba06a2d1b277dec9a50ec9cd97b61230"
] | [
"vit_pytorch_lightning/main.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nfrom torchvision import transforms, datasets\n\n\nimport pytorch_lightning as pl\nfrom einops import rearrange, repeat\n\nfrom vit_pytorch_lightning import ViT\n\ndef CIFAR10dataset(batch_size=256, num_workers=4):\n transf... | [
[
"torch.manual_seed",
"torch.utils.data.random_split",
"torch.utils.data.DataLoader"
]
] |
zongwave/libxcam | [
"53e2b415f9f20ab315de149afdfee97574aeaad0"
] | [
"modules/dnn/feathernet/models/MobileLiteNet.py"
] | [
"'''\nThe code of class InvertedResidual and class MobileLiteNet was taken from\nhttps://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py\nand modified by Zhang Peng. The copyright notice for these codes is as follows:\n\nBSD 3-Clause License\n\nCopyright (c) Soumith Chintala 2016,\nAll rights res... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.Sigmoid",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU6",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.nn.AdaptiveAvgPool2d"
]
] |
git-pupil/SinGAN | [
"e1eece165c426e332b69a6da10ec81494a3e1820"
] | [
"SIFID/sifid_score.py"
] | [
"#!/usr/bin/env python3\n\"\"\"Calculates ***Single Image*** Frechet Inception Distance (SIFID) to evalulate Single-Image-GANs\nCode was adapted from:\nhttps://github.com/mseitzer/pytorch-fid.git\nWhich was adapted from the TensorFlow implementation of:\n\n \n https://github.com/bioi... | [
[
"numpy.empty",
"numpy.trace",
"numpy.cov",
"numpy.asarray",
"numpy.load",
"numpy.mean",
"numpy.save",
"numpy.eye",
"torch.from_numpy",
"numpy.diagonal",
"numpy.iscomplexobj",
"numpy.atleast_1d",
"numpy.isfinite",
"numpy.abs",
"numpy.atleast_2d"
]
] |
koreyoshildc/123 | [
"d6d9e7ebcecbf561861fbda0c8f1455af092317d"
] | [
"configs/c_512_5x5_32.py"
] | [
"import numpy as np\n\nfrom config import Config\nfrom data import BALANCE_WEIGHTS\nfrom layers import *\n\ncnf = {\n 'name': __name__.split('.')[-1],\n 'w': 448,\n 'h': 448,\n 'train_dir': 'data/train_medium',\n 'test_dir': 'data/test_medium',\n 'batch_size_train': 32,\n 'batch_size_test': 8,\... | [
[
"numpy.array"
]
] |
AbdulFMS/lanedet | [
"210709066886e4906c8d3ab4d9173785ef07c65d"
] | [
"lanedet/core/lane.py"
] | [
"from scipy.interpolate import InterpolatedUnivariateSpline\nimport numpy as np\n\n\nclass Lane:\n def __init__(self, points=None, invalid_value=-2., metadata=None):\n super(Lane, self).__init__()\n self.curr_iter = 0\n self.points = points\n self.invalid_value = invalid_value\n ... | [
[
"numpy.array"
]
] |
davidwagnerkc/TensorMONK | [
"3607836d3d6bfd0994e044536b2a51bc84b35f31"
] | [
"core/NeuralEssentials/makemodel.py"
] | [
"\"\"\" TensorMONK's :: NeuralEssentials \"\"\"\n\nimport os\nimport torch\nfrom .cudamodel import CudaModel\nis_cuda = torch.cuda.is_available()\n\n\nclass BaseModel:\n netEmbedding = None\n netLoss = None\n netAdversarial = None\n meterTop1 = []\n meterTop5 = ... | [
[
"torch.cuda.set_device",
"torch.save",
"torch.cuda.is_available",
"torch.load"
]
] |
krishnapalS/Resume-Parser | [
"191dc49a38de30b481191338edd5cec00f100bfe"
] | [
"keras_en_parser_and_analyzer/classifiers/cnn_lstm.py"
] | [
"from keras.callbacks import ModelCheckpoint\r\nfrom keras.layers import Embedding, SpatialDropout1D, Conv1D, MaxPooling1D, LSTM, Dense\r\nfrom keras.models import model_from_json, Sequential\r\nimport numpy as np\r\nfrom keras.preprocessing.sequence import pad_sequences\r\nfrom keras_en_parser_and_analyzer.library... | [
[
"sklearn.model_selection.train_test_split",
"numpy.load",
"numpy.argmax",
"numpy.save"
]
] |
machine-learning-and-perception-lab/RBSRICNN | [
"939bf477dc2a5fc1190d94e2dcde133a40721e76"
] | [
"test_demo_code/data_loader/synthetic_burst_test_set.py"
] | [
"import torch\nimport cv2\nimport numpy as np\nimport torchvision\nfrom torch.utils.data import DataLoader\nimport matplotlib.pyplot as plt\nfrom data_loader.dataset_utils import calculate_affine_matrices\n\n\nclass SyntheticBurstVal(torch.utils.data.Dataset):\n \"\"\" Synthetic burst validation set. The validat... | [
[
"torch.zeros",
"numpy.array",
"torch.stack",
"numpy.zeros",
"torch.utils.data.DataLoader"
]
] |
Palaniyappan-S/Facial-Expression-Recognition-Classifier-Model | [
"d51330e28a40201d5ecf1ef646c3c404ee829421"
] | [
"Facial_Recognition_Models/Using_CNN/Indian_Celebrity_Recognition/app.py"
] | [
"import numpy as np\nimport os\nfrom keras.models import load_model\nfrom keras.preprocessing import image\nimport tensorflow as tf\nglobal graph\ngraph = tf.compat.v1.get_default_graph()\nfrom flask import Flask , request, render_template\nfrom werkzeug.utils import secure_filename\nfrom gevent.pywsgi import WSGIS... | [
[
"tensorflow.compat.v1.get_default_graph",
"numpy.expand_dims"
]
] |
BirchKwok/spinesTS | [
"b88ec333f41f58979e0570177d1fdc364d976056"
] | [
"spinesTS/utils/_set_seed.py"
] | [
"import os\nimport numpy as np\nimport random\n\n\ndef seed_everything(seed=None):\n import tensorflow as tf\n random.seed(seed)\n np.random.seed(seed)\n tf.random.set_seed(seed)\n os.environ['PYTHONHASHSEED'] = str(seed)\n"
] | [
[
"numpy.random.seed",
"tensorflow.random.set_seed"
]
] |
akiyamalab/SPDRank | [
"7b5f4314f9af5b15179c20ab890e2aad7d322981"
] | [
"pubchem2svmlight.py"
] | [
"# -*- coding: utf-8 -*-\nimport csv\nimport argparse\nfrom collections import OrderedDict\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem, DataStructs\nimport numpy as np\n\n\ndef get_fingerprint(mol, fingerprint=\"Morgan\"):\n if fingerprint == \"Morgan\":\n fp = AllChem.GetMorganFingerprintAsBi... | [
[
"numpy.array",
"numpy.nonzero"
]
] |
medhini/habitat-api | [
"f0d4cdaacb12be43e58bf0b87f43074240faf99b"
] | [
"habitat/utils/geometry_utils.py"
] | [
"#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport numpy as np\nimport quaternion\n\nEPSILON = 1e-8\n\n\ndef angle_between_quaternions(q1: np.quaternion,... | [
[
"numpy.quaternion",
"numpy.linalg.norm",
"numpy.stack",
"numpy.sqrt",
"numpy.conjugate",
"numpy.linalg.svd",
"numpy.abs",
"numpy.cross"
]
] |
ooohtv/tensorflow | [
"393717b02fc8638feac262965231889fbbb7045f"
] | [
"tensorflow/python/eager/benchmarks_test.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.python.eager.context.graph_mode",
"numpy.dot",
"tensorflow.python.eager.context.context",
"tensorflow.python.ops.math_ops.matmul",
"tensorflow.python.eager.backprop.gradients_function",
"tensorflow.python.pywrap_tensorflow.TFE_Py_FastPathExecute",
"tensorflow.python.pywrap_... |
likyoo/ZCls | [
"568621aca3a8b090c93345f0858d52c5757f2f0e"
] | [
"tests/test_model/test_recognizer/test_regvgg.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"\n@date: 2021/2/2 下午5:46\n@file: test_regvgg.py\n@author: zj\n@description: \n\"\"\"\n\nimport torch\n\nfrom zcls.config import cfg\nfrom zcls.config.key_word import KEY_OUTPUT\nfrom zcls.model.recognizers.build import build_recognizer\nfrom zcls.model.recognizers.vgg.repvgg import... | [
[
"torch.device",
"torch.allclose",
"torch.randn",
"torch.sum"
]
] |
HariWu1995/WaveNet4Vietnamese | [
"151b29f553cf8b17585f1d7c8374a035e9e958e3"
] | [
"preprocess_vn.py"
] | [
"#!/usr/bin/python2\n# -*- coding: utf-8 -*-\n\nimport os\nos.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'\n\nimport glob, csv, librosa, os, subprocess, time\nimport numpy as np\nimport pandas as pd\n\nimport data_vn\n\ntry:\n from StringIO import StringIO\nexcept ImportError:\n from io import StringIO\n\n__author__... | [
[
"pandas.read_table",
"numpy.save"
]
] |
yuchenlin/ParaGEN | [
"e6d7f3e934011f8e533ce3f0c27c2a04e199c409"
] | [
"onmt/modules/CopyGenerator.py"
] | [
"import torch.nn as nn\nimport torch.nn.functional as F\nimport torch\nimport torch.cuda\n\nimport onmt\nimport onmt.io\nfrom onmt.Utils import aeq\n\n\nclass CopyGenerator(nn.Module):\n \"\"\"Generator module that additionally considers copying\n words directly from the source.\n\n The main idea is that w... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.nn.functional.softmax"
]
] |
Time0o/focusfusion | [
"86a6906404cb33ad4287f68cf0fbbe5c64683d9c"
] | [
"setup.py"
] | [
"#!/usr/bin/env python3\n\nimport os\n\nimport numpy as np\nfrom setuptools import find_packages, setup\nfrom Cython.Build import cythonize\n\n\nDISTNAME = 'focusfusion'\nVERSION = '0.0.1'\nDESCRIPTION = 'Multifocus image fusion algorithm collection'\nURL = 'https://github.com/Time0o/focusfusion'\nLICENSE = 'MIT'\n... | [
[
"numpy.get_include"
]
] |
vermashresth/ray | [
"9aaaa508cacb90a5be714478970b2191aaa43170"
] | [
"python/ray/tune/examples/pbt_tune_cifar10_with_keras.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Train keras CNN on the CIFAR10 small images dataset.\n\nThe model comes from: https://zhuanlan.zhihu.com/p/29214791,\nand it gets to about 87% validation accuracy in 100 epochs.\n\nNote that the script requires a machine with 4 GPUs. You\ncan set {\"gpu\": 0} t... | [
[
"tensorflow.python.keras.layers.MaxPooling2D",
"tensorflow.keras.utils.to_categorical",
"tensorflow.python.keras.layers.Input",
"tensorflow.python.keras.models.load_model",
"tensorflow.python.keras.layers.Flatten",
"numpy.random.uniform",
"tensorflow.python.keras.datasets.cifar10.load_... |
MinliangLin/TSD | [
"d84ddc049d6b18c3a2408c90d2b7dd63b4e2d3a1"
] | [
"mmdet/ops/roi_pool/roi_pool.py"
] | [
"import torch\nimport torch.nn as nn\nfrom torch.autograd import Function\nfrom torch.autograd.function import once_differentiable\nfrom torch.nn.modules.utils import _pair\n\nfrom . import roi_pool_cuda\n\n\nclass RoIPoolFunction(Function):\n @staticmethod\n def forward(ctx, features, rois, out_size, spatial... | [
[
"torch.nn.modules.utils._pair"
]
] |
chidioguejiofor/flask_boilerplate | [
"62e9b016e9d471906a71c376f1a4836e05b2f1ed"
] | [
"api/utils/id_generator.py"
] | [
"import numpy as np\nimport time\n\n\n# Logic of this was copied from https://gist.github.com/risent/4cab3878d995bec7d1c2\nclass IDGenerator:\n\n PUSH_CHARS = ('-0123456789'\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'\n '_abcdefghijklmnopqrstuvwxyz')\n last_push_time = 0\n last_rand_ch... | [
[
"numpy.where",
"numpy.random.randint",
"numpy.empty",
"numpy.arange"
]
] |
InterDigitalInc/pccAI | [
"9033c4799ae1440a2307b0224c86c0e43d930a34"
] | [
"pccai/utils/convert_image.py"
] | [
"# Copyright (c) 2010-2022, InterDigital\n# All rights reserved. \n\n# See LICENSE under the root folder.\n\n\n# Convert a LiDAR point cloud to a range image based on spherical coordinate conversion\n\nimport numpy as np\n\n\ndef cart2spherical(input_xyz):\n \"\"\"Conversion from Cartisian coordinates to spheric... | [
[
"numpy.sin",
"numpy.arcsin",
"numpy.round",
"numpy.ones",
"numpy.stack",
"numpy.arange",
"numpy.arctan2",
"numpy.sqrt",
"numpy.cos",
"numpy.meshgrid"
]
] |
ileefmans/stock-sentiment | [
"6f6e8a662bd27f704bb9c35cc9b5f3a0b7739099"
] | [
"tests/test_data.py"
] | [
"import unittest\nimport utils\nimport pandas as pd\n\nclass test_Stock(unittest.TestCase):\n\n\tdef setUp(self):\n\t\to = [1,1,1]\n\t\th = [4,4,4]\n\t\tl = [0.5, 0.5, 0.5]\n\t\tc = [2,2,2]\n\t\tv = [250, 250, 300]\n\t\tt = [556733, 5733677, 5983000]\n\t\ts = ['ok', 'ok', 'ok']\n\n\t\tdf = {'o': o, 'h': h, 'l': l, ... | [
[
"pandas.DataFrame"
]
] |
lixusign/euler | [
"c8ce1968367aec2807cc542fcdb5958e3b1b9295"
] | [
"tf_euler/python/euler_ops/neighbor_ops.py"
] | [
"# Copyright 2018 Alibaba Group Holding Limited. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle... | [
[
"tensorflow.SparseTensor",
"tensorflow.size",
"tensorflow.unique",
"tensorflow.reshape",
"tensorflow.sparse_reorder",
"tensorflow.stack",
"tensorflow.cast"
]
] |
YelpModelers/YelpAnalysis | [
"a29fa265bb30f1839604e79125ce26bdbbe4b1f1"
] | [
"join_business_tables.py"
] | [
"import numpy as np\nimport pandas as pd\n\nclean_business = pd.read_csv('data/vegas_food_businesses_cleaned.csv')\nclean_reviews = pd.read_csv('data/review_checkin_final.csv')\nclean_users = pd.read_csv('data/vegas_business_user_info.csv')\n\nclean_business.drop('Unnamed: 0', axis=1, inplace=True) \n\n# Rename rev... | [
[
"pandas.read_csv",
"pandas.merge"
]
] |
SLEEP-CO/inside | [
"6f860420644b50b78981158a59ceed8cdbd209bf"
] | [
"inside/layers.py"
] | [
"# -*- coding: utf-8 -*-\n#\n# Copyright (C) 2020 Grzegorz Jacenków.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n# use this file except in compliance with the License. You may obtain a copy of\n# the License at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Unless require... | [
[
"tensorflow.shape",
"tensorflow.matmul",
"tensorflow.transpose",
"tensorflow.keras.backend.epsilon",
"tensorflow.keras.backend.arange",
"tensorflow.keras.regularizers.l2",
"tensorflow.nn.tanh",
"tensorflow.keras.backend.shape",
"tensorflow.cast"
]
] |
jellygit/Python-FinanceData | [
"4c69473d35fb6dd23bb387ad56fec2bae3b025de"
] | [
"stock_value.py"
] | [
"#!/bin/env python\nimport os\nimport sys\nimport datetime as dt\nimport pandas as pd\nimport sqlite3\nimport matplotlib.ticker as mtick\nimport matplotlib as mpl\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as dates\nimport multiprocessing \nfrom multiprocessing import Pool\nimport logging\nfrom multi... | [
[
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.rc",
"matplotlib.ticker.PercentFormatter",
"pandas.read_sql"
]
] |
cmhc-lab/viswordrec-baseline | [
"b12a4179b4d9e9eb5b5e10aa8d45715e991cb86f"
] | [
"training_datasets/construct_epasana-10kwords.py"
] | [
"# encoding: utf-8\n\"\"\"\nConstruct a dataset containing 256x256 pixel images of rendered words. Uses the\n118 words used in the \"epasana\" study + 82 other frequently used Finnish words.\n\"\"\"\nimport argparse\nimport numpy as np\nimport pandas as pd\nfrom os import makedirs\nfrom tqdm import tqdm\nimport web... | [
[
"numpy.random.RandomState",
"pandas.DataFrame",
"pandas.concat",
"numpy.linspace",
"pandas.read_csv"
]
] |
nno/PyMVPA | [
"a125596bf81b8e9848768852f697bd3cff9674c4",
"a125596bf81b8e9848768852f697bd3cff9674c4"
] | [
"mvpa2/tests/test_searchlight.py",
"mvpa2/tests/test_mdp.py"
] | [
"# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##\n#\n# See COPYING file distributed along with the PyMVPA package for the\n# copyright and license terms.\n#\n### ###... | [
[
"numpy.mean",
"numpy.max",
"numpy.random.normal",
"numpy.arange",
"numpy.random.randint",
"numpy.asscalar",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"numpy.all",
"numpy.power",
"numpy.corrcoef",
"numpy.hstack",
"numpy.sum",
"numpy.ones",
"numpy.... |
huliang2016/torch2trt_dynamic | [
"aa55f354a742d26272eae93934d0cff7cd946cbf"
] | [
"torch2trt/converters/getitem.py"
] | [
"from torch2trt.torch2trt import *\nfrom torch2trt.module_test import add_module_test\nimport torch\nfrom .size import get_intwarper_trt, IntWarper\nfrom collections.abc import Iterable\n\n\ndef slice_to_trt(dim_size, dim_slice):\n \n start = 0 if dim_slice.start is None else dim_slice.start\n stop = dim_s... | [
[
"torch.device"
]
] |
steckdenis/stable-baselines3 | [
"248a1174c7ebce67afaddb872fc7cb2c9a6d5720"
] | [
"stable_baselines3/bdpi/bdpi.py"
] | [
"from typing import Any, Dict, Optional, Tuple, Type, Union, List\n\nimport gym\nimport torch as th\nimport torch.multiprocessing as mp\nimport random\n\nfrom stable_baselines3.common import logger\nfrom stable_baselines3.common.buffers import ReplayBuffer\nfrom stable_baselines3.common.off_policy_algorithm import ... | [
[
"torch.min",
"torch.nn.MSELoss",
"torch.arange",
"torch.no_grad",
"torch.multiprocessing.get_context",
"torch.zeros_like",
"torch.multiprocessing.set_sharing_strategy"
]
] |
almogtavor/spark | [
"80f6fe2f6de16cef706bcb4ea2f9233131c5e767"
] | [
"python/pyspark/pandas/tests/indexes/test_datetime.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"pandas.date_range",
"pandas.DatetimeIndex",
"pandas.Index"
]
] |
lihebi/DAG-EQ | [
"a7acd258d80548dd895db06cc0dbff3f3a8c9c04"
] | [
"python/baseline_notears.py"
] | [
"#!/usr/bin/env python3\n\nimport h5py\nimport pandas as pd\nimport tempfile\nimport numpy as np\nimport random\n\nfrom notears.linear import notears_linear\nfrom notears.nonlinear import NotearsMLP, notears_nonlinear\n\nfrom notears import utils as ut\n\ndef test_notears():\n # read X\n os.chdir('julia/src')... | [
[
"numpy.set_printoptions",
"numpy.savetxt"
]
] |
jashanbhullar/multi-label-metrics | [
"a62daaf773aca7c62da28a9da91daf856bb1c7ef"
] | [
"multilabel/evaluate.py"
] | [
"#multilabel metrices\n#import important libraries from python - code written in python3\nfrom __future__ import division\nimport numpy as np\nimport warnings\n\n#sample input matrix format - true labels and predicted labels\n#y_true = np.array([[1,0,1,1],[0,1,0,0],[0,0,0,0],[0,1,1,0]])\n#y_pred = np.array([[0,0,1,... | [
[
"numpy.concatenate",
"numpy.logical_not",
"numpy.delete",
"numpy.logical_xor",
"numpy.array_equal",
"numpy.errstate",
"numpy.true_divide",
"numpy.mean",
"numpy.logical_and",
"numpy.isfinite",
"numpy.append"
]
] |
sun-pyo/OcCo | [
"e2e12dbaa8f9b98fb8c42fc32682f49e99be302f"
] | [
"OcCo_Torch/train_svm.py"
] | [
"# Copyright (c) 2020. Hanchen Wang, hw501@cam.ac.uk\n# Ref: https://scikit-learn.org/stable/modules/svm.html\n# Ref: https://scikit-learn.org/stable/modules/classes.html#module-sklearn.model_selection\n\nimport os, sys, torch, argparse, datetime, importlib, numpy as np\nsys.path.append('utils')\nsys.path.append... | [
[
"numpy.concatenate",
"numpy.array",
"torch.no_grad",
"sklearn.svm.SVC",
"sklearn.metrics.accuracy_score",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load",
"sklearn.model_selection.GridSearchCV",
"numpy.logspace",
"torch.nn.DataParallel"
]
] |
cjohnchen/tensorflow | [
"e3aa49701d60a006d09786f5a240530ee5f47e25"
] | [
"tensorflow/contrib/tpu/python/tpu/tpu_estimator.py"
] | [
"# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.product",
"tensorflow.python.ops.array_ops.identity",
"tensorflow.contrib.tpu.ops.gen_tpu_ordinal_selector_op.tpu_ordinal_selector",
"tensorflow.python.ops.array_ops.ones",
"tensorflow.contrib.tpu.python.tpu.tpu.core",
"tensorflow.python.ops.summary_ops_v2.summary_writer_initializer... |
shanayghag/AV-Janatahack-Independence-Day-2020-ML-Hackathon | [
"410c549488b0e2ceece067a9e1581e182a11e885"
] | [
"roberta-dual-input/model.py"
] | [
"import torch\nimport transformers\n\n\nclass RobertaMultiheadClass(torch.nn.Module):\n def __init__(self):\n super(RobertaMultiheadClass, self).__init__()\n self.roberta = transformers.RobertaModel.from_pretrained(\n 'roberta-base')\n self.drop = torch.nn.Dropout(0.3)\n se... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat"
]
] |
shoumo95/AMPL | [
"1d536a5c67631d98388f794768b22034bde15137"
] | [
"atomsci/ddm/pipeline/transformations.py"
] | [
"\"\"\"\nClasses providing different methods of transforming response data and/or features in datasets, beyond those\nprovided by DeepChem.\n\"\"\"\n\nimport logging\nimport os\nimport sys\n\nimport numpy as np\nimport pandas as pd\nimport umap\n\nimport pdb\n\nimport deepchem as dc\nfrom deepchem.trans.transformer... | [
[
"numpy.array",
"numpy.isnan",
"numpy.ones_like",
"numpy.nan_to_num",
"numpy.reshape",
"sklearn.preprocessing.RobustScaler",
"numpy.where",
"numpy.sqrt",
"numpy.maximum"
]
] |
IngvarLa/rdkit | [
"7f73da78a2768d65ac1e2d1e856c96ce792ee894"
] | [
"rdkit/Chem/PandasTools.py"
] | [
"'''\nImporting pandasTools enables several features that allow for using RDKit molecules as columns of a\nPandas dataframe.\nIf the dataframe is containing a molecule format in a column (e.g. smiles), like in this example:\n\n>>> from rdkit.Chem import PandasTools\n>>> import pandas as pd\n>>> import os\n>>> from ... | [
[
"pandas.DataFrame",
"pandas.option_context",
"numpy.issubdtype"
]
] |
SSubhnil/RacingLMPC | [
"6ac55da9afda74a6e833e7c5eb1cb0d069035e4b"
] | [
"src/fnc/SysModel.py"
] | [
"import numpy as np\nimport pdb\nimport datetime\nfrom Utilities import Curvature, getAngle\n\nclass Simulator():\n \"\"\"Vehicle simulator\n Attributes:\n Sim: given a Controller object run closed-loop simulation and write the data in the ClosedLoopData object\n \"\"\"\n def __init__(self, map, ... | [
[
"numpy.sin",
"numpy.zeros",
"numpy.random.randn",
"numpy.arctan",
"numpy.arctan2",
"numpy.cos",
"numpy.floor"
]
] |
Andromedanita/descqa | [
"33421b57c10b86875da14f186506fb844ee64055"
] | [
"descqa/shear_test.py"
] | [
"from __future__ import unicode_literals, absolute_import, division\nimport os\nimport time\n\nimport numpy as np\nfrom scipy.interpolate import interp1d\nfrom scipy.integrate import quad\nfrom sklearn.cluster import k_means\nimport treecorr\nimport pyccl as ccl\n\nimport camb\nimport camb.correlations\nimport astr... | [
[
"numpy.max",
"numpy.histogram",
"scipy.interpolate.interp1d",
"numpy.matrix",
"numpy.zeros",
"numpy.min",
"numpy.exp",
"numpy.mean",
"numpy.stack",
"numpy.arange",
"numpy.vstack",
"numpy.cos",
"numpy.sqrt",
"numpy.linspace",
"sklearn.cluster.k_means",
... |
Ram81/habitat-challenge | [
"01f2744d9acb0b659a69763ae338f08a74b7d185",
"01f2744d9acb0b659a69763ae338f08a74b7d185"
] | [
"src/policy.py",
"il_agent.py"
] | [
"import abc\n\nimport math\nimport sys\nfrom typing import Dict, Iterable, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom gym import Space\nfrom .models.resnet_encoders import (\n TorchVisionResNet50,\n VlnResnetDepthEncoder,\n ResnetRGBEncoder,\n)\nfrom .models.rnn_s... | [
[
"torch.nn.Linear",
"torch.device",
"torch.cat",
"torch.cos",
"torch.sin",
"torch.nn.init.constant_",
"torch.nn.ReLU",
"torch.cuda.is_available",
"torch.nn.init.orthogonal_",
"torch.nn.Embedding"
],
[
"torch.zeros",
"numpy.random.seed",
"torch.no_grad",
"... |
lubatang/uTensor | [
"aedbc9bb5dc2e7532b744a9c6fe713c1d22bdb0b"
] | [
"reference/models/qntMatMulDeqnt/uint8uint8int32.py"
] | [
"from tensorflow.python.ops import gen_math_ops\nfrom tensorflow.python.ops import gen_array_ops\nimport tensorflow as tf\nimport numpy as np\n\n#Where this source lies...\n#from tensorflow.python.ops import gen_math_ops\n#ipython3: gen_math_ops?? \n#file: gen_math_op.py -> def quantized_mat_mul -> _op_def_lib.appl... | [
[
"tensorflow.abs",
"tensorflow.reduce_min",
"numpy.random.rand",
"tensorflow.bitcast",
"tensorflow.python.ops.gen_math_ops.requantize",
"tensorflow.subtract",
"tensorflow.Session",
"tensorflow.matmul",
"tensorflow.python.ops.gen_math_ops.quantized_mat_mul",
"tensorflow.pytho... |
xuezhong/Paddle | [
"be9ec5208160bfed02e767bdb23db5aba9cf5eb0",
"be9ec5208160bfed02e767bdb23db5aba9cf5eb0",
"be9ec5208160bfed02e767bdb23db5aba9cf5eb0"
] | [
"python/paddle/fluid/tests/unittests/test_profiler.py",
"python/paddle/fluid/contrib/quantize/quantize_transpiler.py",
"python/paddle/fluid/tests/unittests/test_fuse_elewise_add_act_pass.py"
] | [
"# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless ... | [
[
"numpy.random.random",
"numpy.array",
"numpy.random.randint"
],
[
"numpy.divide",
"numpy.array",
"numpy.add",
"numpy.zeros",
"numpy.round",
"numpy.multiply",
"numpy.subtract",
"numpy.abs"
],
[
"numpy.random.seed",
"numpy.random.random",
"numpy.ones"
... |
fidelechevarria/DeepAero | [
"db3c41e4991a6a345c6461110b8754f8c96c3cbb"
] | [
"sympy_test.py"
] | [
"from sympy import symbols, hessian, Function, N\nimport numpy as np\n\nx, y = symbols('x y')\nf = symbols('f', cls=Function)\n\nf = (1/2)*np.power(x, 2) + 5*np.power(y, 2) + (2/3)*np.power((x-2), 4) + 8*np.power((y+1), 4)\n\nH = hessian(f, [x, y]).subs([(x,1), (y,1)])\nprint(np.array(H))\nprint(N(H.condition_numbe... | [
[
"numpy.array",
"numpy.power"
]
] |
muneebalam/scrapenhl2 | [
"a9867f03d002773da852fc150f2976adc2ba8c25"
] | [
"scrapenhl2/scrape/teams.py"
] | [
"\"\"\"\nThis module contains method related to team logs.\n\"\"\"\n\nimport os.path\n\nimport feather\nimport pandas as pd\nimport pyarrow\nfrom tqdm import tqdm\n\nfrom scrapenhl2.scrape import organization, parse_pbp, parse_toi, schedules, team_info, general_helpers as helpers, \\\n scrape_toi, manipulate_sch... | [
[
"pandas.to_numeric",
"pandas.concat"
]
] |
YuBeomGon/object_detection | [
"4d204dfb12a829b55e09546526ed5237ece3167d"
] | [
"convert_tflite.py"
] | [
"import argparse\nimport tensorflow as tf\n\n\ndef convert_tflite(saved_model_dir_path, out_path):\n \"\"\" Convert exported graph to tflite model\n Args:\n saved_model_dir_path: exported graph directory path\n out_path: converted tflite output file path\n Returns:\n None\n \"\"\"\n... | [
[
"tensorflow.lite.TFLiteConverter.from_saved_model"
]
] |
ldzzz/ches2018 | [
"e83e655fdd3af6daa82109d07016f1597b5db02f"
] | [
"sources/attribution.py"
] | [
"import numpy as np\n\n\nfrom matplotlib import pyplot as plt\n\ndef occlusion(traces, window, model, batch_size=100):\n t = np.copy(traces);\n Z0 = model.predict(t, batch_size=batch_size);\n t = t.transpose(); t[window] = 0; t = t.transpose();\n Z = model.predict(t,batch_size=batch_size);\n diff = Z - Z0;\n ... | [
[
"numpy.copy",
"numpy.mean"
]
] |
tjkreutz/socialsent-py3 | [
"852f27252062b1ebca3e4c089a224b7947d95633"
] | [
"socialsent/representations/embedding.py"
] | [
"import heapq\n\nimport numpy as np\nfrom sklearn import preprocessing\n\nfrom socialsent.util import load_pickle, lines\n\nclass Embedding:\n \"\"\"\n Base class for all embeddings. SGNS can be directly instantiated with it.\n \"\"\"\n\n def __init__(self, vecs, vocab, normalize=True, **kwargs):\n ... | [
[
"numpy.zeros",
"numpy.load",
"sklearn.preprocessing.normalize",
"numpy.power",
"numpy.vstack"
]
] |
joamilab/inpe-mestrado-cintia2 | [
"711b247f7ef264ff1b5fb2167237ffe5efedc34d"
] | [
"preprocessing.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Oct 3 10:56:30 2018\nLast Modified: 16/04/2020\n@author: joamila\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nimport os\nfrom scipy import interpolate, signal\n\n#Interpola todos os espectros, cada um em 1000 pontos\n#Interpolate all t... | [
[
"scipy.interpolate.interp1d",
"scipy.signal.savgol_filter",
"pandas.DataFrame",
"numpy.arange",
"pandas.Series",
"pandas.read_csv"
]
] |
NWPU-903PR/MTDDI | [
"ee4b7f9641aa55681757136f86bae540b046f40b"
] | [
"main.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom operator import itemgetter\nfrom itertools import combinations\nimport time\nimport os\nimport pandas as pd\nimport random\nimport copy\nimport scipy.io as sio\nimport tensorflow as tf\nimport numpy as np\nimport networkx as nx\nimport sc... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.exp",
"sklearn.metrics.f1_score",
"tensorflow.global_variables_initializer",
"numpy.nan_to_num",
"sklearn.metrics.precision_recall_curve",
"sklearn.metrics.accuracy_score",
"scipy.sparse.csr_matrix",
"tensorflow.sparse_placeholder",
... |
Inquisitive-ME/mlrose | [
"eb13f64a01856e8c62f13233c5241984363d4171"
] | [
"mlrose_hiive/algorithms/hc.py"
] | [
"\"\"\" Functions to implement the randomized optimization and search algorithms.\n\"\"\"\n\n# Author: Genevieve Hayes (modified by Andrew Rollings)\n# License: BSD 3 clause\n\nimport numpy as np\nimport itertools\n\nfrom mlrose_hiive.decorators import short_name\n\n\n@short_name('hc')\ndef hill_climb(problem, max_... | [
[
"numpy.random.seed",
"numpy.asarray"
]
] |
jr-garcia/Engendro3D | [
"93a6a6c26be2b9a8c1520e9d83516c39532ab1ed"
] | [
"e3d/commonValues.py"
] | [
"from numpy import array, arctan2, arcsin\nfrom bullet.bullet import Vector3, Quaternion, Transform\nfrom cycgkit.cgtypes import quat, mat4, vec3\n\nradian = 0.0174532925\nFOVconst = 57.295780490442972\n\ndefaultMass = 1.0\ndefaultGravity = 9.8\n\n\nclass eVec3(vec3):\n def __init__(self, *args):\n super(... | [
[
"numpy.arcsin",
"numpy.array",
"numpy.arctan2"
]
] |
anonymised-submission/TestingDistributionalShifts | [
"a78e33302f47d3b49cd5abf92914424abcc6950a"
] | [
"experiment-cit/experiment-cit.py"
] | [
"import numpy as np\nfrom multiprocessing import Pool, cpu_count\nimport statsmodels.api as sm\nfrom scipy.stats import norm\nfrom statsmodels.gam.api import GLMGam, BSplines\nfrom tqdm import tqdm\nfrom itertools import product\nimport pandas as pd\nimport torch\nfrom statsmodels.stats.proportion import proportion... | [
[
"numpy.concatenate",
"numpy.random.normal",
"numpy.sin",
"numpy.isnan",
"numpy.random.seed",
"numpy.nansum",
"numpy.random.uniform",
"torch.tensor",
"numpy.sqrt",
"numpy.linspace"
]
] |
zafercavdar/muse-online-learning | [
"a2e37ea0cf891c334f7477ee4b5648c3da1503da"
] | [
"muselsl/viewer_v2.py"
] | [
"# -*- coding: utf-8 -*-\n# vispy: gallery 2\n# Copyright (c) 2015, Vispy Development Team.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\n\"\"\"\nMultiple real-time digital signals with GLSL-based clipping.\n\"\"\"\n\nimport math\n\nimport numpy as np\nfrom pylsl import StreamInlet, ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.tile",
"numpy.sign",
"numpy.tanh",
"scipy.signal.lfilter",
"numpy.arange",
"numpy.repeat",
"scipy.signal.lfilter_zi",
"numpy.vstack"
]
] |
yeladlouni/MatchZoo | [
"575eaf787d648ce4b0519a16a087408eff9cf7a8"
] | [
"matchzoo/datasets/snli/load_data.py"
] | [
"\"\"\"SNLI data loader.\"\"\"\n\nimport typing\nfrom pathlib import Path\n\nimport pandas as pd\nimport keras\n\nimport matchzoo\n\n_url = \"https://nlp.stanford.edu/projects/snli/snli_1.0.zip\"\n\n\ndef load_data(\n stage: str = 'train',\n task: str = 'classification',\n target_label: str = 'entailment',... | [
[
"pandas.DataFrame",
"pandas.read_csv"
]
] |
keroro824/mistral | [
"eaad0117c4250a6bdce17e48b757a2259df2fa04"
] | [
"src/models/mistral_gpt2.py"
] | [
"\"\"\"\nmistral_gpt2.py\n\nCustom Implementation of the GPT-2 LM-Head Model (and auxiliary classes) with support for adaptive/custom number of\ngradient checkpoints (for fine-grained tweaking of memory footprint vs. speed).\n\nReference: https://github.com/huggingface/transformers/blob/master/src/transformers/mode... | [
[
"torch.cuda.amp.autocast",
"torch.nn.Softmax",
"torch.arange",
"torch.no_grad",
"torch.ones",
"torch.cuda.current_device",
"torch.cuda.set_device",
"torch.baddbmm",
"torch.matmul"
]
] |
chccc1994/PaddleOCR | [
"03e768b26ff769a8af1adfec062c472fe54bb640",
"03e768b26ff769a8af1adfec062c472fe54bb640"
] | [
"ppocr/data/imaug/copy_paste.py",
"ppocr/modeling/backbones/rec_resnet_fpn.py"
] | [
"# copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"numpy.array",
"numpy.sin",
"numpy.random.randint",
"numpy.cos",
"numpy.clip",
"numpy.deg2rad"
],
[
"numpy.sum"
]
] |
hvdthong/ConfidNet | [
"50b24f754937527ebb7a0b352aeb310ba953938b"
] | [
"confidnet/utils/metrics.py"
] | [
"import numpy as np\nfrom sklearn.metrics import average_precision_score\nfrom sklearn.metrics import roc_auc_score\n\n\ndef _fast_hist(label_true, label_pred, n_class):\n mask = (label_true >= 0) & (label_true < n_class)\n hist = np.bincount(\n n_class * label_true[mask].astype(int) + label_pred[mask]... | [
[
"numpy.zeros",
"numpy.round",
"numpy.nanmean",
"sklearn.metrics.average_precision_score",
"numpy.diag",
"sklearn.metrics.roc_auc_score",
"numpy.unique"
]
] |
JSoothe/gluon-cv | [
"bca14b75c0e8b6b1cb74447499770e0a337c1f0c"
] | [
"gluoncv/nn/gn.py"
] | [
"# pylint: disable= arguments-differ,missing-docstring\n\"\"\"Basic neural network layers.\"\"\"\n__all__ = ['GroupNorm']\nimport numpy as np\n\nfrom mxnet.gluon.block import HybridBlock\nfrom mxnet import autograd\n\nclass GroupNorm(HybridBlock):\n \"\"\"GroupNorm normalization layer (Wu and He, 2014).\n\n P... | [
[
"numpy.dtype"
]
] |
ollmer/clickbait | [
"3dd54e6b6c804b97d9d955c2f4bea7bfbcadbfc7"
] | [
"train.py"
] | [
"import argparse\n\nimport torch as t\nfrom tensorboardX import SummaryWriter\nfrom torch.optim import Adam as Optimizer\n\nfrom data.dataloader import Dataloader\nfrom model import Model\n\nif __name__ == '__main__':\n\n parser = argparse.ArgumentParser(description='clickbait')\n parser.add_argument('--num-i... | [
[
"torch.no_grad",
"torch.cuda.is_available",
"torch.set_num_threads"
]
] |
lynli/nnUNet | [
"850a0a817ed11ab7e8d470800d926c24edb0018f",
"850a0a817ed11ab7e8d470800d926c24edb0018f",
"850a0a817ed11ab7e8d470800d926c24edb0018f"
] | [
"nnunet/experiment_planning/common_utils.py",
"nnunet/dataset_conversion/add_distance_maps.py",
"nnunet/utilities/nd_softmax.py"
] | [
"# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# ... | [
[
"numpy.array",
"numpy.log"
],
[
"numpy.copy",
"numpy.savez_compressed",
"numpy.vstack",
"scipy.ndimage.distance_transform_edt"
],
[
"torch.exp"
]
] |
CrazyXiao/machine-learning | [
"8e1e8cb9cf6f4e1c403873168f2bacbd84a106bd"
] | [
"code/keras/cnn_mnist.py"
] | [
"\"\"\"\n 卷积神经网络\n\n\"\"\"\n\nfrom keras.datasets import mnist\nimport matplotlib.pyplot as plt\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Activation, Conv2D, MaxPool2D, Flatten\nfrom keras.optimizers import Adam\nfrom keras.utils import np_utils\n\n# 加载数据\n(x_train, y_train),(x_test, ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.title"
]
] |
rashley-iqt/Magnolia | [
"123d0fdbe81eb7bb6d76cbe9db6f793fa3105e8a",
"123d0fdbe81eb7bb6d76cbe9db6f793fa3105e8a"
] | [
"magnolia/python/training/separation/Lab41/separate_mix.py",
"magnolia/python/analysis/comparison_plot.py"
] | [
"# Generic imports\nimport os\nimport json\nimport numpy as np\nimport pandas as pd\nimport librosa as lr\nimport tqdm\n\n# Import Lab41's separation model\nfrom magnolia.dnnseparate.L41model import L41Model\n\n# Import utilities for using the model\nfrom magnolia.utils.postprocessing import convert_preprocessing_p... | [
[
"pandas.read_csv",
"numpy.mean"
],
[
"matplotlib.use",
"pandas.np.digitize",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"numpy.std",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"matplotl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.