repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
pierricklee/tensorflow
[ "c6a61d7b19a9242b06f40120ab42f0fdb0b5c462", "c6a61d7b19a9242b06f40120ab42f0fdb0b5c462" ]
[ "tensorflow/python/ipu/ipu_estimator.py", "tensorflow/compiler/plugin/poplar/tests/size_speed_tests/combined_weights_test.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.python.ipu.loops.repeat", "tensorflow.python.ipu.ipu_compiler.compile", "tensorflow.python.estimator.model_fn._validate_estimator_spec_loss", "tensorflow.python.distribute.distribution_strategy_context.get_strategy", "tensorflow.python.framework.ops.device", "tensorflow.compile...
opencv/openvino_training_extensions
[ "f5d809741e192a2345558efc75899a475019cf98" ]
[ "external/mmdetection/tests/ote_params_validation/test_ote_runner_params_validation.py" ]
[ "# Copyright (C) 2021-2022 Intel Corporation\n# SPDX-License-Identifier: Apache-2.0\n#\n\nfrom logging import Logger\n\nimport pytest\nimport torch.nn as nn\nfrom detection_tasks.extension.utils.runner import (\n EpochRunnerWithCancel,\n IterBasedRunnerWithCancel,\n IterLoader,\n)\nfrom ote_sdk.test_suite....
[ [ "torch.utils.data.dataloader.DataLoader" ] ]
fstrnad/pyDRLinWESM
[ "1d41340fb1888ec90f700c726fd7239e3cef3eae" ]
[ "c_global/partially_observable_cG.py" ]
[ "\"\"\"\nThis is the implementation of a partially observable environment. \nThe internal environment is still deterministic, however does not capture the full state information.\nWhich state information is provided can be chosen arbitrarily.\n@author: Felix Strnad\n\n\"\"\"\n\nfrom c_global.cG_LAGTPKS_Environment ...
[ [ "numpy.array" ] ]
amir1m/dga-detection
[ "001df4e352a99d345ca3b928d5e946e3b5499829" ]
[ "dga_ktrain.py" ]
[ "SEED = 42\nimport numpy as np\nnp.random.seed(SEED)\nimport pandas as pd\nfrom sklearn.model_selection import train_test_split\n\nimport ktrain\nfrom ktrain import text\n\n\ndga_df = pd.read_csv(\"data/legit-dga_domains.csv\")\n\ndga_df.head()\ndga_df['class'].value_counts()\ndga_df['subclass'].value_counts()\n\n...
[ [ "numpy.random.seed", "pandas.read_csv", "sklearn.model_selection.train_test_split" ] ]
StarwalkerZYX/mask-rcnn-pytorch
[ "8599c06740d7508c09f8a8d84eafb893577c6e4c" ]
[ "maskrcnn.py" ]
[ "from backbones.resnet_fpn import ResNetFPN\nfrom backbones.resnet import ResNet\nfrom backbones.vgg16 import VGG16\nfrom heads.common import HeadCommon\nfrom heads.cls_bbox import ClsBBoxHead\nfrom heads.mask import MaskHead\nfrom tools.detect_utils import calc_iou, bbox_corner2center, bbox_center2corner\nfrom pro...
[ [ "torch.nonzero", "torch.cat", "torch.sqrt", "torch.nn.functional.smooth_l1_loss", "torch.floor", "torch.nn.functional.upsample", "torch.max", "torch.autograd.Variable", "torch.clamp", "torch.nn.functional.nll_loss", "torch.log", "torch.exp", "torch.nn.functional...
mbbessa/scipy
[ "ee5d1dd7084c615e46d046dea7ef58bda0dab2d8", "ee5d1dd7084c615e46d046dea7ef58bda0dab2d8" ]
[ "scipy/optimize/tests/test_trustregion.py", "scipy/integrate/_ivp/ivp.py" ]
[ "\"\"\"\nUnit tests for trust-region optimization routines.\n\nTo run it in its simplest form::\n nosetests test_optimize.py\n\n\"\"\"\nimport itertools\nfrom copy import deepcopy\nimport numpy as np\nfrom numpy.testing import assert_, assert_equal, assert_allclose\nfrom scipy.optimize import (minimize, rosen, ros...
[ [ "numpy.testing.assert_allclose", "numpy.array", "scipy.optimize.minimize", "numpy.testing.assert_equal" ], [ "numpy.array", "numpy.asarray", "numpy.searchsorted", "numpy.nonzero", "numpy.diff", "numpy.any", "numpy.argsort", "numpy.hstack", "numpy.vstack" ]...
avilcheslopez/geopm
[ "35ad0af3f17f42baa009c97ed45eca24333daf33" ]
[ "indicators/indicators.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) 2015 - 2022, Intel Corporation\n# SPDX-License-Identifier: BSD-3-Clause\n#\n\nimport datetime as dt\nimport subprocess\nimport json\nimport os\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport time\nimport sys\n\nclass Query:\n def __init__(sel...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.xticks", "matplotlib.pyplot.close", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.dates.DateFormatter", "matplotlib.dates.MonthLocator", "matplotlib....
bcottman/paso
[ "c3deab78081d9d7f5a4aca6848979667743cf5be" ]
[ "tests/pre/test_cleaners.py" ]
[ "# !/usr/bin/env python\n# -*- coding: utf-8 -*-\n__coverage__ = 0.86\n__author__ = \"Bruce_H_Cottman\"\n__license__ = \"MIT License\" \"\"\nimport warnings\n\nwarnings.filterwarnings(\"ignore\")\nimport pytest\nimport numpy as np\nimport pandas as pd\nfrom sklearn.datasets import make_classification\n\n# paso impo...
[ [ "numpy.linspace" ] ]
lzw-pku/IRNet
[ "0cbad02e4a6c8638af12c14856df84d143f9299d" ]
[ "src/utils.py" ]
[ "# Copyright (c) Microsoft Corporation.\r\n# Licensed under the MIT license.\r\n\r\n# -*- coding: utf-8 -*-\r\n\"\"\"\r\n# @Time : 2019/5/25\r\n# @Author : Jiaqi&Zecheng\r\n# @File : utils.py\r\n# @Software: PyCharm\r\n\"\"\"\r\n\r\nimport json\r\nimport time\r\n\r\nimport copy\r\nimport numpy as np\r\nimpor...
[ [ "torch.mean" ] ]
BaluJr/energytk
[ "e9b06bcb43a40010ccc40a534a7067ee520fb3a7" ]
[ "nilmtk/stats/tests/test_locategoodsections.py" ]
[ "#!/usr/bin/python\nfrom __future__ import print_function, division\nimport unittest\nfrom os.path import join\nimport numpy as np\nimport pandas as pd\nfrom datetime import timedelta\nfrom nilmtk.stats import GoodSections\nfrom nilmtk.stats.goodsectionsresults import GoodSectionsResults\nfrom nilmtk import TimeFra...
[ [ "pandas.DataFrame", "pandas.Timestamp" ] ]
omikabir/whatsApp
[ "8c586a0a6eb9b721d021c96773c213c352337dea" ]
[ "sqlLibs/obs/o_sql_1.py" ]
[ "import pandas as pd\nimport os\n#from mysql import *\nfrom sqlalchemy import create_engine\nfrom datetime import *\n\ndef create_db_table(server, conn, tablename, cols, cols_datatype = False):\n st = \"\"\n finalstr = ''\n x = \"\"\n cur = conn.cursor()\n try:\n cur.execute('select 1 from ' ...
[ [ "pandas.read_sql" ] ]
ZHANGHeng19931123/MutualGuide
[ "acf317f48fa5af63d3aa41cd8ebe5586d9bdf033" ]
[ "data/coco.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport os\nimport pickle\nimport os.path\nimport torch\nimport torch.utils.data as data\nimport cv2\nimport numpy as np\nimport json\nfrom .data_augment import preproc_for_train\n\nfrom pycocotools.coco import COCO\nfrom pycocotools.cocoeval import COCOeval\n\nCOCOroot...
[ [ "numpy.max", "numpy.isclose", "numpy.zeros", "numpy.mean", "numpy.where" ] ]
OpenGeophysics/matrixutils
[ "20ed7ebc06b28499e98bc0ce725abe714a8df957" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\nfrom __future__ import print_function\n\"\"\"matrixutils\n\nUtilities for working with matrices as linear operators\n\"\"\"\n\nfrom setuptools import find_packages\n\ntry:\n from numpy.distutils.core import setup\nexcept Exception:\n raise Exception(\n \"Install requires numpy. ...
[ [ "numpy.distutils.core.setup", "numpy.distutils.misc_util.Configuration" ] ]
butsugiri/fairseq-1
[ "e9014fb4245d8408ff763a4f67b8a2365c8b6f3e" ]
[ "fairseq/models/transformer.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\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 math\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional ...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.nn.init.normal_", "torch.nn.functional.linear", "torch.empty", "torch.Tensor", "torch.nn.E...
nanditab35/R2CNN.pytorch
[ "8532caf9d379c7666df2d990f78046ba81da88ac" ]
[ "maskrcnn_benchmark/structures/quad_bounding_box.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\nimport torch\n\n# transpose\nFLIP_LEFT_RIGHT = 0\nFLIP_TOP_BOTTOM = 1\n\n\nclass QuadBoxList(object):\n \"\"\"\n This class represents a set of bounding boxes.\n The bounding boxes are represented as a Nx4 Tensor.\n In order to un...
[ [ "torch.zeros", "torch.device", "torch.min", "torch.max", "torch.as_tensor" ] ]
kyper999/Theano
[ "72823c46089c0e6f3de82e0981081e6e667b7edd" ]
[ "theano/sandbox/tests/test_multinomial_wo_replacement.py" ]
[ "from __future__ import absolute_import, print_function, division\nimport numpy as np\nimport os\nfrom theano import config, function, tensor\nfrom theano.compat import PY3\nfrom theano.misc.pkl_utils import CompatUnpickler\nfrom theano.sandbox import multinomial\nfrom theano.sandbox.rng_mrg import MRG_RandomStream...
[ [ "numpy.random.rand", "numpy.asarray", "numpy.zeros", "numpy.random.seed", "numpy.random.randint", "numpy.squeeze", "numpy.unique" ] ]
YcShentu/CoralSegmentation
[ "6ae30c61f7efa1caef9d191d29a7668296f75f8d" ]
[ "config.py" ]
[ "import argparse\nimport os\nimport torch\n\n\nclass BaseHyperparameters:\n def __init__(self):\n self.parser = argparse.ArgumentParser()\n self.opt = None\n\n def initalize(self):\n # set directory for inputs and outputs\n self.parser.add_argument('--data_dir', type=str, default='...
[ [ "torch.cuda.is_available" ] ]
mgmarino/arrow
[ "96a252290714000c3c9136955c850e2c287e4a51" ]
[ "python/pyarrow/tests/test_types.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "numpy.float64", "numpy.int64", "numpy.bool_" ] ]
blab/cartography
[ "36ef6408e7bdb73b59003166ad7725662fd8fbe6" ]
[ "seasonal-flu-nextstrain/scripts/cross_validation.py" ]
[ "\"\"\"Exhastuve grid search for parameters for TSNE and UMAP\"\"\"\nimport argparse\nimport Bio.SeqIO\nfrom collections import OrderedDict\nimport itertools\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\nimport matplotlib.gridspec as gridspec\nimport re\nimport numpy as np\nimport pandas as pd\nimport...
[ [ "numpy.array", "matplotlib.style.use", "scipy.spatial.distance.pdist", "sklearn.preprocessing.StandardScaler", "pandas.DataFrame.from_dict", "pandas.DataFrame", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "scipy.spatial.distance.squareform", "sklearn.model_select...
Neural-Diffusion-Research/normalized-autoencoders
[ "0c77f7e29289e336c0fe5e941aaec8baa4a4fb82" ]
[ "models/nae.py" ]
[ "import numpy as np\nimport torch\nfrom torch import nn\nfrom torchvision.utils import make_grid \nfrom models.ae import AE\nfrom models.modules import IsotropicLaplace, DummyDistribution\nfrom models.energybased import SampleBuffer, SampleBufferV2\nfrom models.langevin import sample_langevin, sample_langevin_v2\n\...
[ [ "torch.rand", "torch.cat", "numpy.random.rand", "numpy.log", "torch.nn.utils.clip_grad_norm_", "torch.no_grad", "numpy.prod", "torch.tensor", "torch.exp", "torch.randn" ] ]
drunkcoding/model-inference
[ "02d2240bc7052fa32223a80fa63625fe681db102" ]
[ "init_inference.py" ]
[ "# Copyright 2020-2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# notice, ...
[ [ "numpy.concatenate", "numpy.array", "numpy.count_nonzero", "numpy.sum", "numpy.min", "numpy.where", "torch.utils.data.DataLoader" ] ]
kingablgh/PySprint
[ "c3e76fbf1287d18d78699145f5301593aff47ba0" ]
[ "pysprint/tests/test_spp_features.py" ]
[ "import pytest\n\nimport numpy as np\n\nfrom pysprint.core.methods import SPPMethod\nfrom pysprint.core.bases import Dataset\n\n\n@pytest.fixture()\ndef construct_ifg_sequence():\n x = np.arange(1000)\n y = np.sin(x)\n\n # setting multiple SPP\n d1 = Dataset(x, y)\n d1.set_SPP_data(10, [40, 45])\n\n ...
[ [ "numpy.testing.assert_almost_equal", "numpy.array", "numpy.sin", "numpy.arange" ] ]
kianmeng/bezier
[ "de7365258ed693539891e90906a763acf01195a6" ]
[ "src/python/bezier/triangle.py" ]
[ "# 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 to in writing, software\n# distr...
[ [ "numpy.zeros", "numpy.round", "numpy.linalg.det", "numpy.allclose", "numpy.sqrt" ] ]
liuyuqi123/highway-env
[ "a0dd65efb5cbd9737d04cce2688abd5d9ddbd8fc" ]
[ "highway_env/envs/lane_keeping_env.py" ]
[ "from __future__ import division, print_function, absolute_import\n\nimport copy\n\nimport numpy as np\nfrom gym import spaces\nfrom gym.envs.registration import register\n\nfrom highway_env.envs.common.abstract import AbstractEnv\nfrom highway_env.road.lane import LineType, SineLane, StraightLane\nfrom highway_env...
[ [ "numpy.array", "numpy.put" ] ]
JoeWolf92/DMD-PyCalibration
[ "30969a85a335e24bc184d8eec9e81174e22b9c4a" ]
[ "ShapeRecognition.py" ]
[ "# import the necessary packages\nimport cv2\nimport numpy as np\n\nclass ShapeDetector:\n def __init__(self, filename, shapeColour, calibrationThreshold):\n # Initiate image containing shapes to be identified\n if shapeColour:\n self.shapeColour = 1\n else:\n self.shap...
[ [ "numpy.max", "numpy.int0" ] ]
ma3252788/detection_template
[ "0079e8e40c59c1b0c9b868e9a361bd0cc232a583" ]
[ "network/YoloV2V3/yolo/region_layer.py" ]
[ "import math\nimport numpy as np\nimport sys\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom .utils import bbox_iou, multi_bbox_ious, convert2cpu\n\nclass RegionLayer(nn.Module):\n def __init__(self, num_classes=0, anchors=[1.0], num_anchors=1, device=None):\n supe...
[ [ "torch.zeros", "torch.nn.MSELoss", "torch.min", "torch.max", "torch.IntTensor", "torch.FloatTensor", "torch.linspace", "torch.ones", "torch.nn.CrossEntropyLoss" ] ]
MaurizioFD/recsys-challenge-2020-twitter
[ "567f0db40be7db3d21c360f2ca6cdf2addc7c698", "567f0db40be7db3d21c360f2ca6cdf2addc7c698" ]
[ "Utils/NN/TorchModels.py", "BERT/Utils.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.nn import BCEWithLogitsLoss\nfrom transformers import DistilBertModel\n\nfrom Utils.Eval.Metrics import ComputeMetrics as CoMe\n\n\nclass FFNNMulti(nn.Module):\n def __init__(self, input_size, hidden_size_1, hidden_size_2, hidden_dropout_prob_1, hidden_dropout_prob...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.Dropout", "torch.nn.ReLU", "torch.nn.BCEWithLogitsLoss" ], [ "numpy.array" ] ]
maksymx/ml_dl_ds_cv_snippets
[ "ebb4ec5e97f52e55e97f3c8c71cf375da7a30dc5" ]
[ "apache_spark/sparkflow_test.py" ]
[ "import tensorflow as tf\nfrom pyspark.ml.feature import VectorAssembler, OneHotEncoder\nfrom pyspark.ml.pipeline import Pipeline\nfrom sparkflow.graph_utils import build_graph\nfrom sparkflow.tensorflow_async import SparkAsyncDL\n\n\n# simple tensorflow network\ndef small_model():\n x = tf.placeholder(tf.float3...
[ [ "tensorflow.argmax", "tensorflow.placeholder", "tensorflow.losses.softmax_cross_entropy", "tensorflow.layers.dense" ] ]
VincentLeeMax/pytorch
[ "5e6f29661254e5ebc97fac3d829e5d455cda5864" ]
[ "torch/distributed/fsdp/flatten_params_wrapper.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\n# Copyright (c) Tongzhou Wang\n# Licensed under the MIT License.\n\nfrom itertools import accumulate\nfrom typing import (\n Any,...
[ [ "torch.nn.Parameter" ] ]
Iwo-K/genespector
[ "58881e3cb12ddbb78fae4f12ce35c5ada34b8a36" ]
[ "genespector/app.py" ]
[ "# Importing modules\nimport dash\nfrom dash import html\nfrom dash import dcc\nimport pandas as pd\nimport plotly.graph_objs as go\nimport numpy as np\nfrom .import_fun import import_adata\nimport sys\nfrom .layout import make_layout\nimport scanpy as sc\nfrom pathlib import Path\nfrom anndata import AnnData\n\n# ...
[ [ "numpy.array" ] ]
sahilsngh/hackthon.py
[ "12c75d6fe30527e7f15aab3ca4bb50d5abe9ff1d", "12c75d6fe30527e7f15aab3ca4bb50d5abe9ff1d" ]
[ "regression_model_1.py", "self_created_regression_model_1.py" ]
[ "''' This model is trained on SciLearn in python by Sahil Chauhan.\r\n In this model python uses its pandas library to extract the data_frame.\r\n The data_frame consist of more than 50k entries over time of features\r\n Diamond and also consist of its price in Rupeees (was in USD).\r\n The data_frame i...
[ [ "sklearn.preprocessing.scale", "pandas.read_csv", "sklearn.svm.SVR", "sklearn.utils.shuffle" ], [ "matplotlib.pyplot.scatter", "numpy.array", "matplotlib.pyplot.plot", "matplotlib.pyplot.show" ] ]
fwfichtner/rasterio
[ "6857bb00a63c53d0b32103fbf6cc0da859199163" ]
[ "rasterio/merge.py" ]
[ "\"\"\"Copy valid pixels from input files to an output file.\"\"\"\n\nfrom contextlib import contextmanager\nfrom pathlib import Path\nimport logging\nimport math\nimport warnings\n\nimport numpy as np\n\nimport rasterio\nfrom rasterio import windows\nfrom rasterio.enums import Resampling\nfrom rasterio.compat impo...
[ [ "numpy.isnan", "numpy.iterable", "numpy.zeros", "numpy.minimum", "numpy.logical_and", "numpy.finfo", "numpy.iinfo", "numpy.dtype", "numpy.maximum" ] ]
OnurBahadir/slm_simulation
[ "b0cdc5b120f1f9a428e39071953be76fb4d30ef9" ]
[ "slmpy.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Sun Dec 06 20:14:02 2015\r\n\r\n@author: Sebastien Popoff\r\n\"\"\"\r\n\r\n\r\nimport wx\r\nimport threading\r\nimport numpy as np\r\n\r\n\r\n\r\n\r\n\r\nEVT_NEW_IMAGE = wx.PyEventBinder(wx.NewEventType(), 0)\r\n\r\nclass ImageEvent(wx.PyCommandEvent):\r\n def __i...
[ [ "numpy.concatenate" ] ]
pfnet-research/KDD-Cup-AutoML-5
[ "54202eb6aa414316a70faa8e07a68e1c8ca7bd1b" ]
[ "optable_submission/optable_package/optable/learning/optuna_hyper_params_searcher.py" ]
[ "import gc\n\nimport lightgbm as lgb\nimport optuna\nimport numpy as np\n\nfrom optable.learning import learner\n\n\nclass OptunaHyperParamsSearcher(learner.Learner):\n def __init__(self, mode, timer):\n self.__params = None\n self.__mode = mode\n self.__timer = timer\n self.__seed = ...
[ [ "numpy.linspace", "numpy.sqrt" ] ]
MKegler/pyNSL
[ "43ba95b3fa072b8af35de3999bce586d055acde2" ]
[ "demo.py" ]
[ "\"\"\"\nDemo usage of the pyNSL package.\n\nMikolaj Kegler, January 2021\n\"\"\"\nimport matplotlib.pyplot as plt\nimport soundfile as sf\nimport pyNSL\n\n# Load sample audio (for plotting)\naudio, fs = sf.read('./SampleData/SX95.WAV')\n\n# Set up parameters\nparas = [8, 8, -2, -1]\n# Window size: 8 ms\n# Integrat...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots" ] ]
VilkaMini/tc-235-files
[ "63ef7625082eb56d5c18544f34c0ede460479f32" ]
[ "model.py" ]
[ "from sklearn.datasets import load_boston\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearRegression\nimport pickle\n\ndata = load_boston()\n\nX_train, X_test, y_train, y_test = train_test_split(data.data, data.target)\n\nclf = LinearRegression()\nclf.fit(X_train, y_tra...
[ [ "sklearn.model_selection.train_test_split", "sklearn.linear_model.LinearRegression", "sklearn.datasets.load_boston" ] ]
robotika/osgar
[ "6f4f584d5553ab62c08a1c7bb493fefdc9033173" ]
[ "osgar/tools/log2video.py" ]
[ "#!/usr/bin/python\n\"\"\"\n Convert logfile to AVI video\n\"\"\"\nimport pathlib\nfrom datetime import timedelta\n\ntry:\n import cv2\nexcept ImportError:\n print('\\nERROR: Please install OpenCV\\n pip install opencv-python\\n')\n\ntry:\n import numpy as np\nexcept ImportError:\n print('\\nERROR: ...
[ [ "numpy.concatenate", "numpy.fromstring", "numpy.minimum" ] ]
Shamazo/NickDB
[ "a8189ab672e1e2af64c3c22028a94a7994b7fe8e" ]
[ "tests/data_generation_scripts/indexing.py" ]
[ "#!/usr/bin/python\nimport sys, string\nfrom random import choice\nimport random\nfrom string import ascii_lowercase\nfrom scipy.stats import beta, uniform\nimport numpy as np\nimport struct\nimport pandas as pd\nimport math\n\nimport data_gen_utils\n\n#\n# Example usage: \n# python milestone3.py 10000 42 /db/tes...
[ [ "numpy.random.seed", "numpy.random.uniform", "numpy.random.randint" ] ]
turbomam/sheets_and_friends
[ "5a0e41f86cc9188bc9ff86cdf6f4e54ad72bdb55", "5a0e41f86cc9188bc9ff86cdf6f4e54ad72bdb55" ]
[ "sheets_and_friends/column_update.py", "sheets_and_friends/converters/commands.py" ]
[ "import os.path\n\nimport pandas as pd\n\nfrom pathlib import Path\n\nold_file = \"data/nmdc_test_data_valid.tsv\"\n\nextension_val = \".tsv\"\nsuffix_val = \"_lowercased\"\npath_prefix = \"artifacts\"\n\nbasename = Path(old_file).stem\nwith_extension = basename + suffix_val + extension_val\nwith_path = os.path.joi...
[ [ "pandas.read_csv" ], [ "pandas.DataFrame", "pandas.read_csv", "pandas.concat" ] ]
kla55/dataprep
[ "75542cda64570f1fe3c4ac61e670cc0ce2febaa3" ]
[ "dataprep/tests/eda/test_create_report.py" ]
[ "\"\"\"\n module for testing create_report(df) function.\n\"\"\"\nimport logging\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom ...eda import create_report\n\nLOGGER = logging.getLogger(__name__)\n\n\n@pytest.fixture(scope=\"module\") # type: ignore\ndef simpledf() -> pd.DataFrame:\n df = pd.D...
[ [ "pandas.to_datetime", "numpy.random.choice", "numpy.random.rand", "numpy.zeros", "numpy.random.shuffle", "numpy.arange" ] ]
karmarv/tensorrtx
[ "bcce74246c71d381192c577d346cb2aa67af05b7" ]
[ "yolov5/yolov5_trt_api.py" ]
[ "\"\"\"\nAn example that uses TensorRT's Python api to make inferences.\n\"\"\"\nimport ctypes\nimport os\nimport shutil\nimport random\nimport sys\nimport threading\nimport time\nimport cv2\nimport numpy as np\nimport pycuda.autoinit\nimport pycuda.driver as cuda\nimport tensorrt as trt\nimport torch\nimport torch...
[ [ "numpy.zeros_like", "numpy.copyto", "numpy.empty", "numpy.reshape", "numpy.zeros", "numpy.ascontiguousarray", "numpy.transpose", "torch.zeros_like", "torch.Tensor", "numpy.expand_dims" ] ]
cgbriggs99/QCFractal
[ "5f00dd06bb34ca912c4055f0cbac60863ea89c7f" ]
[ "qcfractal/services/torsiondrive_service.py" ]
[ "\"\"\"\nWraps geometric procedures\n\"\"\"\n\nimport io\nimport copy\nimport json\nimport contextlib\nfrom typing import Any, Dict, List\n\nimport numpy as np\n\nfrom ..extras import find_module\nfrom ..interface.models import TorsionDriveRecord\nfrom .service_util import BaseService, TaskManager\n\n__all__ = [\"T...
[ [ "numpy.argmin" ] ]
johanloones/regularization-code-along
[ "d8db7d2c084a242b3e62935181d5f4b44935ea36" ]
[ "code.py" ]
[ "# --------------\n## Load the data\nimport pandas as pd\nsales_data=pd.read_csv(path)\nsales_data.head()\n## Split the data and preprocess\n#Split it into train and test sets using the source column.\ntrain=sales_data[sales_data.source=='train'].copy()\ntest=sales_data[sales_data.source=='test'].copy()\n\ntrain.dr...
[ [ "sklearn.metrics.mean_squared_error", "sklearn.linear_model.Lasso", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "sklearn.metrics.r2_score", "matplotlib.pyplot.title", "sklearn.linear_model.Ridge", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", ...
dgiot/dgiot
[ "c9f2f78af71692ba532e4806621b611db2afe0c9" ]
[ "apps/dgiot_evidence/priv/python/drawxnqx.py" ]
[ "import matplotlib.pyplot as plt\nfrom pylab import mpl\nimport math\nimport numpy as np\nfrom mpl_toolkits.axisartist.parasite_axes import HostAxes, ParasiteAxes\nimport time\nimport sys\nimport base64\nimport json\n\n\"\"\"完成拟合曲线参数计算前相应变量的计算\"\"\"\n\n\ndef polynomial_fitting(data_x, data_y):\n size = len(data_...
[ [ "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.linspace" ] ]
tkgsn/P3GM
[ "443550b7781b7ab3c920893923056a8faef44994" ]
[ "privacy/tensorflow_privacy/privacy/analysis/tree_aggregation_accountant.py" ]
[ "# Copyright 2018 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.isinf", "numpy.isscalar" ] ]
yamsam/G2Net-GoGoGo
[ "064037982d80656cb35442ffe1cd59390aeb5dc2" ]
[ "1D_Model/src/dataset.py" ]
[ "import pickle5 as pickle\nfrom torch.utils.data import Dataset\nimport torch\nimport random\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import StratifiedKFold\nfrom .util import id_2_path_wave\n\n\nclass DataRetriever(Dataset):\n def __init__(self, paths, targets, synthetic=None, Conf...
[ [ "numpy.pad", "sklearn.model_selection.StratifiedKFold", "numpy.random.choice", "torch.FloatTensor", "numpy.load", "torch.tensor", "pandas.concat", "numpy.random.random", "pandas.read_csv" ] ]
maamdaad/Set2GraphPaper
[ "883a87f41192e926b45916542cb3c7e24e0be20b" ]
[ "models/set_to_graph_mlp.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass SetToGraphMLP(torch.nn.Module):\n def __init__(self, params, in_features=2, max_nodes=80):\n super().__init__()\n self.max_nodes = max_nodes\n last = in_features * max_nodes\n layers = []\n for p in params:\n layers.app...
[ [ "torch.nn.Sequential", "torch.nn.ReLU", "torch.nn.Linear", "torch.zeros" ] ]
santomon/taskonomy
[ "4b22087a2686172b21b61589831061e7a386fe36" ]
[ "code/assets/transfers/config_prototype_data_check_no_image_trans.py" ]
[ "from __future__ import absolute_import, division, print_function\n\nimport functools\nimport numpy as np\nimport os\nimport sys\nimport tensorflow as tf\n\nsys.path.insert( 1, os.path.realpath( '../../models' ) )\nsys.path.insert( 1, os.path.realpath( '../../lib' ) )\n\nimport data.load_ops as load_ops\nfrom dat...
[ [ "numpy.int32", "tensorflow.Variable", "tensorflow.assign_add", "tensorflow.variable_scope", "numpy.int64", "tensorflow.train.piecewise_constant" ] ]
UTexas-PSAAP/Parla.py
[ "3d92a156be41983e32576940ef6baffd78d4eb84" ]
[ "tests/test_automove.py" ]
[ "import scipy as sp\nfrom parla import Parla, parray\n\nfrom parla.cuda import gpu\nfrom parla.cpu import cpu\nfrom parla.tasks import TaskSpace, spawn\n\n\nimport numpy as np\n\n\ndef main():\n @spawn(placement=cpu)\n async def test_blocked_cholesky():\n n = 2\n np.random.seed(10)\n # Co...
[ [ "numpy.random.seed", "numpy.array" ] ]
mcindoe/regimedetection
[ "e07355aba56d8394f2e28d1ee886dd2c1dbf0a86" ]
[ "src/kernels.py" ]
[ "from math import exp\nfrom typing import Callable\nfrom typing import Union\n\nimport numpy as np\n\nfrom regimedetection.src.metrics import euclidean_distance\nfrom regimedetection.src.metrics import squared_euclidean_distance\n\n\ndef make_rbf_kernel(sigma: float) -> Callable[[np.ndarray, np.ndarray], np.ndarray...
[ [ "numpy.AxisError", "numpy.dot", "numpy.exp" ] ]
Engineering-Course/Tacotron-2
[ "022c103b940b4f50b6775fa6eed52717be21f8f9" ]
[ "GL_synthesis_tool.py" ]
[ "import numpy as np\nfrom datasets.audio import *\nimport os\nfrom hparams import hparams\n\n# n_sample = 0 #Change n_steps here\n# mel_folder = 'logs-Tacotron/mel-spectrograms' #Or change file path\n# mel_file = 'mel-prediction-step-{}.npy'.format(n_sample) #Or file name (for other generated mels)\nout_dir = 'wav_...
[ [ "numpy.load" ] ]
OmarWagih1/colour
[ "bdc880a2783ff523dafb19f1233212dd03a639bd", "bdc880a2783ff523dafb19f1233212dd03a639bd" ]
[ "colour/examples/plotting/examples_blindness.py", "colour/models/rgb/transfer_functions/pivoted_log.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nShowcases corresponding colour blindness plotting examples.\n\"\"\"\n\nimport numpy as np\nimport os\n\nimport colour\nfrom colour.plotting import (colour_style, plot_cvd_simulation_Machado2009,\n plot_image)\nfrom colour.utilities.verbose import message...
[ [ "numpy.array" ], [ "numpy.log10" ] ]
kampta/multiview-shapes
[ "a79eb4b492be8c2c279e2c69b13d5a19dff1621b" ]
[ "evaluate_recon_cd.py" ]
[ "import numpy as np\nfrom scipy.spatial import cKDTree as KDTree\nimport math\nimport argparse \n\n\n# ref: https://github.com/facebookresearch/DeepSDF/blob/master/deep_sdf/metrics/chamfer.py\n# takes one pair of reconstructed and gt point cloud and return the cd\ndef compute_cd(gt_points, gen_points):\n\n # one...
[ [ "numpy.square", "scipy.spatial.cKDTree", "numpy.load", "numpy.random.shuffle" ] ]
anushkrishnav/QVR
[ "09867a701e6f158b3f4624bb3cda4d34b55dc040" ]
[ "simulator/initializer.py" ]
[ "import numpy as np\nfrom math import radians, cos, sin, asin, sqrt\n\n\nclass Initializer:\n def __init__(self, n):\n self.n = n\n\n def generate_instance(self, xc, yc):\n\n n = self.n\n\n instance = np.zeros([n, n])\n for ii in range(0, n):\n for jj in range(ii + 1, n)...
[ [ "numpy.zeros" ] ]
kyrs/NCC-experiments
[ "71112f0e4118ba206d22635675fe8c1ebaed5ccb" ]
[ "NCC-NN-training.py" ]
[ "\"\"\"\r\n__Author__ : Kumar Shubham \r\n__desc__ : file for training an NCC model based on the data which has been genereated\r\n\"\"\"\r\nimport tensorflow as tf \r\nimport json\r\nimport os \r\nfrom collections import Counter\r\nimport random\r\nimport numpy as np \r\nimport pickle\r\nclass NCCTrain(object):\...
[ [ "numpy.mean", "tensorflow.control_dependencies", "tensorflow.global_variables_initializer", "numpy.concatenate", "tensorflow.concat", "tensorflow.get_default_graph", "tensorflow.summary.histogram", "tensorflow.train.Saver", "tensorflow.layers.batch_normalization", "tensorfl...
adbelniak/sentence-transformers
[ "a36e6f126cf0e333e1b00eb7cfcef2863f8919ad" ]
[ "sentence_transformers/SentenceTransformer.py" ]
[ "import json\nimport logging\nimport os\nimport shutil\nfrom collections import OrderedDict\nfrom typing import List, Dict, Tuple, Iterable, Type, Union, Callable\nfrom zipfile import ZipFile\nimport requests\nimport numpy as np\nfrom numpy import ndarray\nimport transformers\nimport torch\nfrom torch import nn, Te...
[ [ "numpy.concatenate", "torch.device", "torch.nn.functional.normalize", "torch.stack", "torch.cuda.amp.autocast", "torch.is_tensor", "torch.no_grad", "torch.hub._get_torch_home", "torch.cuda.device_count", "torch.multiprocessing.get_context", "torch.cuda.is_available", ...
prasys/embedding-as-service
[ "b1691cbf1ea1df39c109ace18562c8dc332750ec" ]
[ "server/embedding_as_service/text/xlnet/models/function_builder.py" ]
[ "\"\"\"doc.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport tensorflow as tf\nfrom embedding_as_service.text.xlnet.models import modeling\nimport xlnet\n\n\ndef construct_scalar_host_call(\n monitor_dict,\n model_dir,\n...
[ [ "tensorflow.tpu.bfloat16_scope", "tensorflow.reshape", "tensorflow.tile", "tensorflow.nn.softmax", "tensorflow.one_hot", "tensorflow.einsum", "tensorflow.cast", "tensorflow.shape", "tensorflow.concat", "tensorflow.transpose", "tensorflow.variable_scope", "tensorflow...
jessilyn/DBDP-1
[ "99357dac197ceeb8c240ead804dd2c8bd3e3fc93" ]
[ "DigitalBiomarkers-Preprocessing/Signal-Alignment/downsample/downsample_with_shapedtw.py" ]
[ "import pandas as pd\nimport math\nimport linecache\nimport numpy as np\nfrom scipy import stats\nfrom parameter_cal import cf\nfrom dtw import dtw\nimport os\nfrom scipy.misc import *\nfrom sdtw.config import sub_len, nBlocks\nfrom sdtw.utils import cal_descriptor, samplingSequences, norm\nfrom parameter_cal.utils...
[ [ "scipy.stats.zscore", "pandas.DataFrame" ] ]
kommunium/dip-lab
[ "2c8e08a994fb34b87da55da48a7b72b7c13d9c81" ]
[ "lab6/Q6_1_4.py" ]
[ "import numpy as np\nfrom PIL import Image\nfrom matplotlib import pyplot as plt\n\n# %% Q6_1_4 alpha-trimmed mean filter\n\nQ6_1_4 = np.asarray(Image.open(\"Q6_1_4.tiff\"))\nplt.show()\n\n\ndef alpha_filter(img_raw, n: int = 3, d=0.1):\n m = (n - 1) // 2\n trimmed = max(int(d * n ** 2), 1)\n row, col = im...
[ [ "matplotlib.pyplot.subplot", "numpy.pad", "matplotlib.pyplot.savefig", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.sort", "matplotlib.pyplot.show", "matplotlib.pyplot.imshow" ] ]
returncode13/tensorflow
[ "314d9cd9b607460f8bfea80fc828b1521ca18443" ]
[ "tensorflow/tensorboard/backend/server.py" ]
[ "# Copyright 2015 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.platform.tf_logging.info", "tensorflow.python.summary.impl.gcs.IsGCSPath", "tensorflow.python.summary.impl.gcs.CheckIsSupported" ] ]
alexanu/gs-quant
[ "d31ae3204d5421861897bac49383bc213d5497a2" ]
[ "gs_quant/timeseries/datetime.py" ]
[ "# Copyright 2018 Goldman Sachs.\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to in wr...
[ [ "numpy.isnan" ] ]
borchero/leviathan
[ "7430fa4a515fe5ea7afbaad108226b4cd9111d8c" ]
[ "pycave/clustering/kmeans/metrics.py" ]
[ "import random\nfrom typing import Any, Callable, Optional\nimport torch\nfrom torchmetrics import Metric\n\n\nclass CentroidAggregator(Metric):\n \"\"\"\n The centroid aggregator aggregates kmeans centroids over batches and processes.\n \"\"\"\n\n def __init__(\n self,\n num_clusters: int...
[ [ "torch.zeros", "torch.rand", "torch.cat", "torch.arange", "torch.finfo", "torch.empty" ] ]
voidful/TFk
[ "5ba46a5ef12bdbbd0215a2eadb036b443c382f3f" ]
[ "tfkit/train.py" ]
[ "import argparse\nimport sys\nimport os\nfrom datetime import timedelta\nimport time\nfrom itertools import zip_longest\n\nimport torch\nfrom torch.utils import data\nfrom tqdm.auto import tqdm\nfrom transformers import get_linear_schedule_with_warmup\nimport nlp2\nimport tfkit\nimport tfkit.utility.tok as tok\nfro...
[ [ "torch.no_grad", "torch.nn.DataParallel" ] ]
abelrguezr/Deep-SAD-PyTorch
[ "268ca21570a4a8dadc331a9dbf26ccade36ae5d9" ]
[ "src/networks/layers/temporal.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.utils import weight_norm\n\n# Code from https://github.com/locuslab/TCN\n\nclass Chomp1d(nn.Module):\n def __init__(self, chomp_size):\n super(Chomp1d, self).__init__()\n self.chomp_size = chomp_size\n\n def forward(self, x):\n return x[...
[ [ "torch.nn.ReLU", "torch.nn.Dropout", "torch.nn.Sequential", "torch.nn.Conv1d" ] ]
jto-d/iexfinance
[ "8bf958f269638b6f8d2dbdd857c0ef2ba324cdd4" ]
[ "iexfinance/tests/test_utils.py" ]
[ "import datetime as dt\n\nimport pandas as pd\nimport pytest\n\nfrom iexfinance.utils import _handle_lists, _sanitize_dates\n\n\n@pytest.fixture(params=[1, \"test\"], ids=[\"int\", \"string\"])\ndef single(request):\n return request.param\n\n\n@pytest.fixture(\n params=[\n [1, 2, 3],\n (1, 2, 3)...
[ [ "pandas.to_datetime", "pandas.DataFrame", "pandas.Timestamp", "pandas.Series" ] ]
eliberis/tensorflow
[ "9aea03e98d2ef5416dff09f721d6d519ea83e74f" ]
[ "tensorflow/python/data/kernel_tests/data_service_ops_test.py" ]
[ "# Copyright 2020 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.data.experimental.service.server_lib.WorkerServer", "tensorflow.python.data.ops.dataset_ops.Options", "tensorflow.python.ops.math_ops.equal", "tensorflow.python.framework.combinations.combine", "tensorflow.python.data.experimental.ops.data_service_ops.distribute", "tenso...
myforkedrepositories/Chibchas
[ "b8c187d3a84ea80c2488f14d3be340d7c79cf798" ]
[ "chibchas/tools.py" ]
[ "import pickle\nfrom datetime import datetime\nimport re\nimport time\nimport getpass\nimport os\nimport sys\n\n#requirements\nimport json\nimport pandas as pd\nimport helium as h\nfrom selenium.common.exceptions import NoSuchElementException\n\n\npd.set_option(\"max_rows\",100)\n#pd.set_option(\"display.max_column...
[ [ "pandas.set_option", "pandas.DataFrame", "pandas.read_excel", "pandas.ExcelWriter", "pandas.read_html" ] ]
ewmoore/numpy
[ "665a00aec896344cfb12599add600f27a5f519d3" ]
[ "numpy/fft/helper.py" ]
[ "\"\"\"\nDiscrete Fourier Transforms - helper.py\n\"\"\"\n# Created by Pearu Peterson, September 2002\n\n__all__ = ['fftshift', 'ifftshift', 'fftfreq', 'rfftfreq']\n\nfrom numpy.core import asarray, concatenate, arange, take, \\\n integer, empty\nimport numpy.core.numerictypes as nt\nimport types\n\ndef fftshift...
[ [ "numpy.core.take", "numpy.core.empty", "numpy.core.asarray", "numpy.core.arange" ] ]
theogruner/SimuRLacra
[ "4893514ccdeb10a736c55de9aa7753fd51c5afec", "4893514ccdeb10a736c55de9aa7753fd51c5afec", "4893514ccdeb10a736c55de9aa7753fd51c5afec", "4893514ccdeb10a736c55de9aa7753fd51c5afec", "4893514ccdeb10a736c55de9aa7753fd51c5afec", "4893514ccdeb10a736c55de9aa7753fd51c5afec" ]
[ "Pyrado/pyrado/plotting/categorical.py", "Pyrado/pyrado/algorithms/stopping_criteria/rollout_based_criteria.py", "Pyrado/pyrado/policies/feed_forward/time.py", "Pyrado/scripts/evaluation/eval_ucbog.py", "Pyrado/scripts/training/2dg_npdr.py", "Pyrado/pyrado/sampling/cvar_sampler.py" ]
[ "# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and\n# Technical University of Darmstadt.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# 1. Redistributions...
[ [ "pandas.DataFrame", "numpy.array", "matplotlib.pyplot.gcf" ], [ "numpy.max", "numpy.quantile", "numpy.asarray", "numpy.min", "numpy.mean" ], [ "torch.get_default_dtype", "torch.atleast_1d" ], [ "matplotlib.pyplot.show", "matplotlib.pyplot.subplots", ...
lunayach/control-tasks
[ "f333b03d7dc31f89ae56c82e22a9ea588547590f" ]
[ "control-tasks/task.py" ]
[ "\"\"\"Contains classes describing linguistic tasks of interest on annotated data.\"\"\"\n\nfrom collections import Counter, OrderedDict\n\nimport numpy as np\nimport sys\nimport torch\nimport math\nimport itertools\n\nPTB_TRAIN_EMPIRICAL_POS_DISTRIBUTION = [0.00003789361998, 0.00006105083219, 0.0001021022538, 0.00...
[ [ "torch.zeros", "numpy.random.choice", "numpy.random.shuffle", "numpy.random.seed" ] ]
negevh/IML.HUJI
[ "0968ddda47a840c390af7ccce0edfb91288f217b" ]
[ "IMLearn/metalearners/adaboost.py" ]
[ "import numpy as np\nfrom typing import Callable, NoReturn\n\nfrom IMLearn import BaseEstimator\nfrom IMLearn.metrics import misclassification_error\n\n\nclass AdaBoost(BaseEstimator):\n \"\"\"\n AdaBoost class for boosting a specified weak learner\n\n Attributes\n ----------\n self.wl_: Callable[[],...
[ [ "numpy.log", "numpy.zeros", "numpy.sum", "numpy.ones", "numpy.exp", "numpy.sign" ] ]
mlopezantequera/pytorch-metric-learning
[ "1fb343124d15fd2f63d535df26aa1463daf4ceee", "1fb343124d15fd2f63d535df26aa1463daf4ceee" ]
[ "src/pytorch_metric_learning/utils/distributed.py", "src/pytorch_metric_learning/losses/proxy_anchor_loss.py" ]
[ "import torch\nfrom torch.nn.parallel import DistributedDataParallel as DDP\n\nfrom ..utils import common_functions as c_f\n\n\n# modified from https://github.com/allenai/allennlp\ndef is_distributed():\n return torch.distributed.is_available() and torch.distributed.is_initialized()\n\n\n# modified from https://...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.distributed.is_available", "torch.nn.parallel.DistributedDataParallel", "torch.distributed.is_initialized", "torch.ones_like", "torch.distributed.get_rank" ], [ "torch.nn.functional.one_hot", "torch.Tensor", "torch...
weissercn/MLTools
[ "bd784798b846f76e00a3bbb0fb1acf6a1317be12", "75dc566947437249ad077939941839126eb20016" ]
[ "Dalitz/gaussian_samples/legendre/plot_distribution.py", "Dalitz_simplified/optimisation/dt/plot_optimisation_values.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\n#2D double gauss scatter\nfeatures=np.loadtxt(\"gauss_data/data_double_high2Dgauss_10000_0.25_0.75_0.1_0.0_0.txt\",dtype='d')\nplt.figure()\nplt.plot(features[:,0], features[:,1],'.')\nplt.xlim(0,1)\nplt.ylim(0,1)\nplt.savefig(\"double_gauss_noCPV.png\")\n\n#1...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "matplotlib.pyplot.plot", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.hist", "numpy.loadtxt" ], [ "numpy.argmin", "matplotlib.pyplot.figure", "numpy.loadtx...
Questions1/Rong360_2nd
[ "342b20dc3fb1a1b41d683532c6c22757309e0bb5" ]
[ "handle_dat_edge.py" ]
[ "\nimport os\nimport numpy as np\nimport pandas as pd\nfrom data_preprocess import time_pass\n\n\n@time_pass\ndef handle_dat_edge(data_all):\n \"\"\"\n 把dat_edge个每一条记录的info拆开,然后输出,方便后续的计算\n 为了简化计算,忽略时间信息,把所有的月份的联系记录汇总起来\n \"\"\"\n def cal_multi_3(string):\n s = string.split(',')\n month...
[ [ "pandas.DataFrame", "numpy.array", "pandas.concat" ] ]
cmlab-mira/template
[ "ae462f6eed9f3aa71d130c281c01c22fe0124a7b" ]
[ "src/runner/trainers/base_trainer.py" ]
[ "import importlib\nimport logging\nimport math\nimport random\nimport torch\nimport numpy as np\nfrom torch.optim.lr_scheduler import (\n CyclicLR, OneCycleLR, CosineAnnealingWarmRestarts, ReduceLROnPlateau\n)\nfrom tqdm import tqdm\n\nfrom src.runner.utils import EpochLog\n\nLOGGER = logging.getLogger(__name__....
[ [ "torch.cuda.get_rng_state_all", "torch.get_rng_state", "torch.cuda.set_rng_state_all", "torch.no_grad", "torch.set_rng_state", "torch.load", "numpy.random.get_state", "numpy.random.set_state" ] ]
azmiozgen/models
[ "7bbece2d9296380b42757030899109116a533b9f", "9331a6545ba1665d79fd8d79809b2f00fe8d5263" ]
[ "research/object_detection/meta_architectures/rfcn_meta_arch.py", "research/object_detection/utils/visualization_utils.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.concat", "tensorflow.expand_dims" ], [ "numpy.ones_like", "tensorflow.ones_like", "numpy.sort", "numpy.cumsum", "numpy.histogram", "numpy.uint8", "tensorflow.concat", "numpy.logical_and", "numpy.arange", "matplotlib.use", "numpy.array", "tens...
chris-torrence/arduino-at28c64
[ "3bb23ee0db8b27bd6272c5aa7d0c69556d3ce388" ]
[ "convert_roms_arduino.py" ]
[ "# Read in an Apple II character generator ROM,\n# make an image of the characters,\n# then write out the bytes as an Arduino header file\n# Chris Torrence, May 2016\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom time import localtime, strftime\n\ndef drawCharacters(data):\n \"\"\"\n Create a characte...
[ [ "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "numpy.ndarray", "matplotlib.pyplot.show", "matplotlib.pyplot.xticks", "matplotlib.pyplot.imshow" ] ]
zekearneodo/spikeextractors
[ "d30aa85e69d0331fffdb58a03a2bb628f93b405e" ]
[ "spikeextractors/extractors/shybridextractors/shybridextractors.py" ]
[ "import os\nfrom pathlib import Path\nimport numpy as np\nfrom spikeextractors import RecordingExtractor, SortingExtractor\nfrom spikeextractors.extractors.bindatrecordingextractor import BinDatRecordingExtractor\nfrom spikeextractors.extraction_tools import save_to_probe_file, load_probe_file, check_get_unit_spike...
[ [ "numpy.concatenate", "numpy.empty", "numpy.savetxt", "numpy.ones", "numpy.where" ] ]
konsdt/KOARCH
[ "07c4d6b1030604eda1ef3fe674167a20eb2c905c" ]
[ "Use_Cases/VPS_Popcorn_Production/Kubernetes/src/L3_PC_Evaluation.py" ]
[ "import os\nfrom time import sleep\nimport traceback\nimport pandas as pd\n\nfrom Use_Cases.VPS_Popcorn_Production.Kubernetes.src.classes.CognitionPC import CognitionPC\n\npd.set_option(\"display.max_columns\", None)\npd.options.display.float_format = \"{:.3f}\".format\n\ndebugging = False\n\nif debugging is True:\...
[ [ "pandas.set_option" ] ]
Abtiotm/DQN
[ "b646c65de0e5e76036c03ea7a4cf71f5b714c34c" ]
[ "networks/network.py" ]
[ "import tensorflow as tf\n\nfrom .layers import *\n\nclass Network(object):\n def __init__(self, sess, name):\n self.sess = sess\n self.copy_op = None\n self.name = name\n self.var = {}\n\n def build_output_ops(self, input_layer, network_output_type, \n value_hidden_sizes, advantage_hidden_sizes,...
[ [ "tensorflow.gather_nd", "tensorflow.argmax", "tensorflow.group", "tensorflow.reduce_max", "tensorflow.variable_scope", "tensorflow.placeholder", "tensorflow.reduce_mean" ] ]
xgcm/xhistogram
[ "e01291bb2668611a1bf7bcfa6829d195331aa6dc" ]
[ "xhistogram/test/test_chunking.py" ]
[ "import numpy as np\nimport pytest\n\nfrom .fixtures import example_dataarray\nfrom ..xarray import histogram\n\n\n@pytest.mark.parametrize(\"weights\", [False, True])\n@pytest.mark.parametrize(\"chunksize\", [1, 2, 3, 10])\n@pytest.mark.parametrize(\"shape\", [(10,), (10, 4)])\ndef test_chunked_weights(chunksize, ...
[ [ "numpy.histogram", "numpy.linspace", "numpy.testing.assert_allclose" ] ]
yqliaohk/baseclasses
[ "dac8fbaddeb2f67b031ffc38353cbe8334b9bd03" ]
[ "baseclasses/testing/pyRegTest.py" ]
[ "try:\n from mpi4py import MPI\nexcept ImportError:\n # parallel functions will throw errors\n MPI = None\nimport numpy\nimport os\nimport sys\nimport json\nfrom collections import deque\nfrom contextlib import contextmanager\nfrom ..utils import CaseInsensitiveDict, CaseInsensitiveSet, Error\n\n\ndef getT...
[ [ "numpy.testing.assert_allclose", "numpy.array", "numpy.ascontiguousarray", "numpy.sum", "numpy.sqrt", "numpy.append" ] ]
hechmik/word_mover_distance
[ "567b9f4fec3e03ea8bacd65e96868f08cbbd476e" ]
[ "word_mover_distance/model.py" ]
[ "from typing import List\nimport logging\nfrom gensim.corpora import Dictionary\nimport numpy as np\nfrom pyemd import emd\n\n\ndef nbow(document, vocab_len, dictionary):\n d = np.zeros(vocab_len, dtype=np.double)\n nbow = dictionary.doc2bow(document) # Word frequencies.\n doc_len = len(document)\n for...
[ [ "numpy.sum", "numpy.asarray", "numpy.zeros" ] ]
Bartvelp/DeepMicrobes_clone
[ "97d59214061b0334f7608467c401868f0b4da681" ]
[ "models/input_pipeline.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\n\n\ndef input_function_train_kmer(input_tfrec, repeat_count, batch_size, cpus):\n \"\"\"Parses tfrecord and returns dataset for training/eval.\n\n Args:\n input_tf...
[ [ "tensorflow.data.Dataset.list_files", "tensorflow.FixedLenSequenceFeature", "tensorflow.contrib.data.parallel_interleave", "tensorflow.TensorShape", "tensorflow.VarLenFeature", "tensorflow.sparse_tensor_to_dense", "tensorflow.contrib.data.shuffle_and_repeat", "tensorflow.parse_sing...
VIVelev/Flappy-AI
[ "eb79e313308e582c4ddb506d089cbf059bd02364" ]
[ "NeuroEvolution/Chromosome.py" ]
[ "import numpy as np\nimport random as rnd\nfrom .nn import NeuralNetwork\n\n__all__ = [\n \"Chromosome\",\n]\n\nclass Chromosome(object):\n def __init__(self, n_hidden_layers=1, n_nodes=[6], n_inputs=2, n_classes=2):\n self.genotype = NeuralNetwork(\n n_hidden_layers=n_hidden_layers,\n ...
[ [ "numpy.add", "numpy.random.randn" ] ]
wyf94/TrafficCount
[ "d16398fb9afbc5dcfcc36face7c3ce72be2a1211", "d16398fb9afbc5dcfcc36face7c3ce72be2a1211" ]
[ "src/traffic_count/detector/utils/loss.py", "src/traffic_count/detector/utils/general.py" ]
[ "# Loss functions\n\nimport torch\nimport torch.nn as nn\n\nfrom traffic_count.detector.utils.general import bbox_iou\nfrom traffic_count.detector.utils.torch_utils import is_parallel\n\n\ndef smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues/238#issuecomment-598028441\n # return positive, neg...
[ [ "torch.zeros", "torch.sigmoid", "torch.cat", "torch.arange", "torch.max", "torch.ones", "torch.abs", "torch.full_like", "torch.tensor", "torch.nn.BCEWithLogitsLoss", "torch.ones_like", "torch.zeros_like", "torch.exp" ], [ "torch.cat", "numpy.set_prin...
nmoisseeva/cedarPlumes
[ "0eb1787b6419ac808919d9a118f7b03967832258" ]
[ "python/plume.py" ]
[ "#nmoisseeva@eoas.ubc.ca\n#March 2019\n\nimport numpy as np\nimport os.path\nimport glob\n\n#input values for plume analysis\n#--------------------------------\nwrfdir = '../complete/'\nfigdir = './figs/'\nlvl = np.arange(0,3201,40) #vertical levels in m\ndx = 40. #horizontal grid spa...
[ [ "numpy.array", "numpy.arange" ] ]
jeffknupp/pandas
[ "7d0a98e9bfb6c59d5f1738927732ddb80013b581" ]
[ "pandas/core/categorical.py" ]
[ "# pylint: disable=E1101,W0232\n\nimport numpy as np\nfrom warnings import warn\nimport types\n\nfrom pandas import compat\nfrom pandas.compat import u, lzip\nfrom pandas._libs import lib, algos as libalgos\n\nfrom pandas.core.dtypes.generic import (\n ABCSeries, ABCIndexClass, ABCCategoricalIndex)\nfrom pandas....
[ [ "numpy.array_equal", "pandas.core.dtypes.missing.isnull", "pandas.core.dtypes.common._ensure_int64", "pandas.compat.u", "pandas.core.algorithms.factorize", "pandas.core.algorithms._get_data_algo", "pandas.core.dtypes.dtypes.CategoricalDtype", "pandas.core.reshape.concat.concat", ...
RingBDStack/PPGCN
[ "dd0614c2a000f694d382117952f290d24e1f75b3" ]
[ "KIES/adj_matrix.py" ]
[ "import numpy as np\r\nimport os\r\n\r\n\r\nmete_path_size = 13\r\n\r\n# adj_data = np.zeros([mete_path_size,node_size,node_size]).astype(float)\r\n# for i in range(mete_path_size):\r\ndef d_matrix_pro(adj_data):\r\n d_matrix = np.sum(adj_data,1)\r\n d_h = np.power(d_matrix,-0.5)\r\n t = []\r\n for i in...
[ [ "numpy.array", "numpy.dot", "numpy.sum", "numpy.load", "numpy.save", "numpy.eye", "numpy.power" ] ]
hdu-jinminghu/TS-VIS-master
[ "c717722f86ee6996afc052ec946fbaefc1b5d3dc" ]
[ "tsvis/logger/x2num.py" ]
[ "# -*- coding: UTF-8 -*-\n\"\"\"\n Copyright 2021 Tianshu AI Platform. 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/LICENS...
[ [ "numpy.isinf", "numpy.array", "numpy.isnan", "numpy.sum", "numpy.isscalar" ] ]
MadsJensen/RP_scripts
[ "b3f7afb27b6346ee209e4bfcd7d52049d69d2eaf", "b3f7afb27b6346ee209e4bfcd7d52049d69d2eaf" ]
[ "perm_test_classifier_transitivity_post.py", "graph_pagerank_ada.py" ]
[ "import numpy as np\nimport bct\nfrom sklearn.externals import joblib\nfrom my_settings import *\n\nfrom sklearn.ensemble import AdaBoostClassifier\nfrom sklearn.cross_validation import (StratifiedShuffleSplit, cross_val_score,\n permutation_test_score)\nfrom sklearn.grid_search...
[ [ "sklearn.cross_validation.StratifiedShuffleSplit", "sklearn.cross_validation.permutation_test_score", "numpy.empty", "numpy.asarray", "numpy.load", "numpy.save", "sklearn.externals.joblib.load", "numpy.vstack" ], [ "sklearn.cross_validation.StratifiedKFold", "numpy.empt...
yeyekurong/Guoqiang_PTD-Net
[ "825c6e9b11c7152067e9d0875dff21137965222c" ]
[ "Enhancement_models/target_loss/roi_data_layer/roidb.py" ]
[ "\"\"\"Transform a roidb into a trainable roidb by adding a bunch of metadata.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport datasets\nimport numpy as np\nfrom model.utils.config import cfg\nfrom datasets.factory import get_imdb\nimpo...
[ [ "numpy.where", "numpy.array", "numpy.argsort" ] ]
sty61010/shifts
[ "d3bb3086d8f2581f74644585701f4b1db4338483" ]
[ "sdc/ysdc_dataset_api/evaluation/utils.py" ]
[ "from collections import defaultdict\nfrom typing import Dict, Sequence, Tuple\n\nimport numpy as np\n\nfrom ..dataset import MotionPredictionDataset\nfrom ..proto import (ObjectPrediction, Submission, Trajectory, Vector3,\n WeightedTrajectory)\nfrom ..utils.map import repeated_points_to_array\n...
[ [ "numpy.empty", "numpy.argsort" ] ]
jessezbj/autodist
[ "67b3ac2614beece8b1f64a889cf5a3436950d587" ]
[ "autodist/graph_item.py" ]
[ "# Copyright 2020 Petuum, Inc. 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 required by ap...
[ [ "tensorflow.python.framework.ops.Graph", "tensorflow.core.framework.variable_pb2.VariableDef", "tensorflow.python.ops.resource_variable_ops._from_proto_fn", "tensorflow.core.framework.graph_pb2.GraphDef", "tensorflow.core.protobuf.saver_pb2.SaverDef", "tensorflow.python.framework.importer....
apnatvar/ML-AI-Deep-Learning
[ "1e780b58c36b29c538a6b48342e90d1176c5677f" ]
[ "ML/sixthnn.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nimport tensorflow as tf\r\nfrom tensorflow.keras import layers\r\nfrom matplotlib import pyplot as plt\r\nimport seaborn as sns\r\n\r\npd.options.display.max_rows = 10\r\npd.options.display.float_format = \"{:.1f}\".format\r\n\r\nprint(\"Modules Imported\")\r\n\r\ntrain...
[ [ "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "pandas.read_csv", "tensorflow.keras.layers.DenseFeatures", "tensorflow.feature_column.numeric_column", "pandas.DataFrame", "tensorflow.keras.optimizers.Adam", "numpy.array", "tensorflow.feature_column.indic...
atifadib/stock-sentiment
[ "3ed95c5f4f12f84670b743ddbe748197e1c9c27a" ]
[ "stock.py" ]
[ "import requests\r\nimport sys\r\nimport numpy as np\r\nimport tweepy\r\nimport os\r\n\r\nfrom keras.models import Sequential\r\nfrom keras.layers import Dense\r\nfrom textblob import TextBlob\r\n\r\nglobal user\r\nconsumer_key = \"lMikOtj0ma5TIHpA19RwtOI4I\"\r\ncomsumer_secret = \"l0BEwFO5Uf3n7r5jsixQdXa1Q3yGahECJ...
[ [ "numpy.array" ] ]
GibranBenitez/Real-time-GesRec
[ "81803a59a5d58e271e7b80cd193d51ab0088ec7d" ]
[ "datasets/egogesture.py" ]
[ "import torch\nimport torch.utils.data as data\nfrom PIL import Image\nfrom spatial_transforms import *\nimport os\nimport math\nimport functools\nimport json\nimport copy\nfrom numpy.random import randint\nimport numpy as np\nimport random\nimport glob\n\nimport pdb\n\n\ndef pil_loader(path, modality):\n # open...
[ [ "torch.cat" ] ]
samskalicky/tvm
[ "96a76e3100fa9aff447d59f2d3344a32f36d788c" ]
[ "tests/python/frontend/pytorch/test_forward.py" ]
[ "# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements. See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership. The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); y...
[ [ "torch.nn.Linear", "torch.round", "torch.cat", "torch.nn.SELU", "torch.nn.CELU", "torch.isnan", "torch.logical_xor", "torch.nn.BatchNorm2d", "torch.nn.LeakyReLU", "torch.nn.MaxPool3d", "numpy.mean", "torch.ones", "torch.cuda.is_available", "torch.jit.trace",...
priyamayur/GenomicIslandPrediction
[ "1fc5e10fa18b5bf00b48d21953e7bc1d4a139ed1" ]
[ "treasureisland/Predictor.py" ]
[ "from treasureisland.IdentifyGI import IdentifyGI\nimport pickle\nimport pandas as pd\nfrom Bio import SeqIO\nimport os\nfrom . import models\nfrom importlib import resources\nimport time\n\n\nclass Predictor:\n\n def __init__(self, input_file_path, output_file_path=\"output\"):\n self.input_file_path = i...
[ [ "pandas.DataFrame" ] ]
khalidcawl/salary_predictor_canada
[ "4a7aad5791061e7fe5f1a770c61c9b97d98d5767" ]
[ "src/salary_prediction_model.py" ]
[ "# author: Khalid Abdilahi\n# date: 2021-11-28\n\n\"\"\"Builds multiple regression model to predict salary based on features\n\nUsage: src/salary_prediction_model.py --train=<train> --out_dir=<out_dir> --test=<test>\n \nOptions:\n--train=<train> Path (including filename) to training data (which needs to be sav...
[ [ "sklearn.impute.SimpleImputer", "sklearn.compose.make_column_transformer", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.savefig", "pandas.DataFrame", "numpy.logspace", "sklearn.model_selection.RandomizedSearchCV", "sklearn.linear_model....