repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
unademo/UNet_Nested4Tiny_Objects_Keypoints | [
"cdf1b499c526949ca2ae927b70a217cefc18dd08"
] | [
"tools/optimizers/adamw.py"
] | [
"# * Optimizer: Adamw\n# Referenced the 3rd-party codes.\n\n#-*- coding: utf-8 -*\nimport math\nimport torch\nfrom torch.optim.optimizer import Optimizer\n\n\nclass AdamW(Optimizer):\n \"\"\"Implements Adam algorithm.\n\n Arguments:\n params (iterable): iterable of parameters to optimize or dicts def... | [
[
"torch.zeros_like",
"torch.mul",
"torch.max"
]
] |
jorkro/wirecaml | [
"819c24a127eb026b83ae41eb3c8c1ac8f77f25b8"
] | [
"wirecaml/model/train.py"
] | [
"import operator\nimport os\n\nimport itertools\nfrom sklearn import svm\nfrom sklearn import tree\nfrom sklearn.dummy import DummyClassifier\nfrom sklearn.ensemble import RandomForestClassifier, BaggingClassifier\nfrom sklearn.feature_selection import SelectKBest, chi2\nfrom sklearn.linear_model import LogisticReg... | [
[
"sklearn.ensemble.BaggingClassifier",
"sklearn.ensemble.RandomForestClassifier",
"sklearn.svm.SVC",
"sklearn.linear_model.LogisticRegression",
"sklearn.naive_bayes.BernoulliNB",
"sklearn.dummy.DummyClassifier",
"sklearn.tree.DecisionTreeClassifier",
"sklearn.feature_selection.Selec... |
BradleyBrown19/HiDT | [
"2a9827e8ebd59e6b8caa093dc2cb8664f4042849"
] | [
"HiDT/discriminators.py"
] | [
"# AUTOGENERATED! DO NOT EDIT! File to edit: Discrminators.ipynb (unless otherwise specified).\n\n__all__ = ['ProjectionDiscriminator', 'UnconditionalDiscriminator']\n\n# Cell\n#hide\nfrom fastai import *\nfrom fastai.vision import *\nfrom fastai.callbacks import *\nfrom fastai.utils.mem import *\nfrom fastai.visio... | [
[
"torch.nn.Linear",
"torch.nn.init.xavier_uniform_",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.sum"
]
] |
Eitan-Leviev/IML.HUJI | [
"e351f496091e9901ec00941774345ed38cddd3d0"
] | [
"exercises/city_temperature_prediction.py"
] | [
"import math\n\nimport IMLearn.learners.regressors.linear_regression\nfrom IMLearn.learners.regressors import PolynomialFitting\nfrom IMLearn.utils import split_train_test\n\nimport numpy as np\nimport pandas as pd\nimport plotly.graph_objects as go\nimport plotly.express as px\nimport plotly.io as pio\npio.templat... | [
[
"numpy.random.seed",
"pandas.read_csv",
"pandas.to_datetime"
]
] |
GongZhengxin/dnnbrain | [
"cd5fa253316783af26a6e307520293a159cc1605"
] | [
"dnnbrain/dnn/base.py"
] | [
"import os\nimport cv2\nimport copy\nimport time\nimport torch\nimport numpy as np\n\nfrom PIL import Image\nfrom os.path import join as pjoin\nfrom copy import deepcopy\nfrom sklearn.decomposition import PCA\nfrom sklearn.linear_model import LinearRegression, LogisticRegression, Lasso\nfrom sklearn.svm import SVC\... | [
[
"sklearn.metrics.confusion_matrix",
"torch.cat",
"sklearn.linear_model.LinearRegression",
"numpy.median",
"scipy.stats.pearsonr",
"numpy.mean",
"sklearn.model_selection.cross_val_score",
"numpy.max",
"numpy.histogram",
"numpy.zeros_like",
"numpy.linalg.norm",
"sklea... |
deisler134/image_foreground_edge_cognition | [
"09ed610112c936eb5b7ef9a64674d76d2ce0c118"
] | [
"train_encoder_decoder.py"
] | [
"import argparse\n\nimport keras\nimport tensorflow as tf\nfrom keras.callbacks import ModelCheckpoint, EarlyStopping, ReduceLROnPlateau\nfrom keras.utils import multi_gpu_model\n\nimport migrate\nfrom config import patience, batch_size, epochs, num_train_samples, num_valid_samples\nfrom data_generator import train... | [
[
"tensorflow.device"
]
] |
Gourisankar805/STDF_READER_NEW | [
"63dccf7197cc6492aa362a0d92f63e8c18dc249d"
] | [
"Backup/excel_sheet_selector.py"
] | [
"from PyQt5 import QtCore, QtGui, QtWidgets\nfrom PyQt5.QtCore import QAbstractTableModel, Qt\nimport pandas as pd\nfrom pandas import DataFrame as DF\nclass table_view_model(QAbstractTableModel):\n\n def __init__(self, data):\n QAbstractTableModel.__init__(self)\n self._data = data\n\n def rowC... | [
[
"pandas.DataFrame"
]
] |
adam-lewis-gcorp/jax | [
"86c48ccb7c116d207d235b319912c2de8b7ce41a"
] | [
"jax/interpreters/xla.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.array",
"numpy.asarray",
"numpy.zeros",
"numpy.take",
"numpy.get_printoptions",
"numpy.dtype",
"numpy.array2string"
]
] |
semaralawa/Maix_Toolbox | [
"e3359828289d11345ae238691fa94dc5c7c8802c"
] | [
"pbtxt2pb.py"
] | [
"#!/usr/bin/python3\nimport tensorflow as tf\nfrom tensorflow.python.platform import gfile\nfrom google.protobuf import text_format\nimport sys\n \ndef convert_pbtxt_to_pb(filename):\n with tf.gfile.FastGFile(filename, 'r') as f:\n graph_def = tf.GraphDef() \n file_content... | [
[
"tensorflow.GraphDef",
"tensorflow.gfile.FastGFile",
"tensorflow.train.write_graph"
]
] |
ryu577/algorithms | [
"b42301c3279af1d225ea85e951ef0164c1f0ab8f"
] | [
"algorith/arrays/num_systems/dynamic_base.py"
] | [
"import numpy as np\n\n\ndef to_binary(n, dim):\n \"\"\"\n Obtains the binary representation of an integer.\n args:\n n: The integer to be converted to binary. The integer shouldn't\n be so large that more than dim(the next arg) bits are required\n to encode it.... | [
[
"numpy.zeros"
]
] |
ryanrussell/pandas-ta | [
"720bbcf0196d363d621beeced8fba711990d075d"
] | [
"pandas_ta/momentum/kst.py"
] | [
"# -*- coding: utf-8 -*-\nfrom pandas import DataFrame\nfrom .roc import roc\nfrom pandas_ta.utils import get_drift, get_offset, verify_series\n\n\ndef kst(close, roc1=None, roc2=None, roc3=None, roc4=None, sma1=None, sma2=None, sma3=None, sma4=None, signal=None, drift=None, offset=None, **kwargs):\n \"\"\"Indic... | [
[
"pandas.DataFrame"
]
] |
kosmitive/univariate-distributions | [
"4c854e90bfd4acaa511c1786c96f0610d7aea037"
] | [
"src/continuous/logistic.py"
] | [
"import math as m\nimport numpy as np\n\nfrom src.continuous.uniform import UniformDist\nfrom src.prob_distribution import ProbDist\nfrom src.spaces.spaces1d_leafs import ContinuousSpace\n\n\nclass LogisticDist(ProbDist):\n \"\"\"Simple Logistic distribution.\"\"\"\n\n def __init__(self, loc = 0, scale = 1):\... | [
[
"numpy.subtract",
"numpy.exp",
"numpy.log"
]
] |
urobots-io/anno | [
"8e240185e6fc0908687b15a39c892814a6bddee6"
] | [
"python/urobots_annopy/urobots/annopy/value.py"
] | [
"\"\"\"\nAnno values.\n\nGeneral conventions:\n\n- The original marker value from the textual representation is converted to an internal format convenient for algorithms.\n The reverse conversion is done by tostring() method. It will return an equivalent representation, which is may differ from\n the original one... | [
[
"numpy.max",
"numpy.array",
"numpy.sin",
"numpy.dot",
"numpy.linalg.norm",
"numpy.round",
"numpy.ones",
"numpy.min",
"numpy.arctan2",
"numpy.cos",
"numpy.linalg.inv"
]
] |
KarimAED/pennylane | [
"d201dd52def0dfa44efd485e06ea06defda22dc0"
] | [
"tests/transforms/test_tape_expand.py"
] | [
"# Copyright 2018-2021 Xanadu Quantum Technologies Inc.\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... | [
[
"numpy.allclose",
"numpy.array",
"numpy.isclose"
]
] |
pgmpablo157321/inference | [
"6b957d07cd4ad89f46c37834e912c6e4d0ba0182"
] | [
"vision/classification_and_detection/python/coco.py"
] | [
"\"\"\"\nimplementation of imagenet dataset\n\"\"\"\n\n# pylint: disable=unused-argument,missing-docstring\n\nimport json\nimport logging\nimport os\nimport time\n\nimport cv2\nimport numpy as np\nfrom pycocotools.cocoeval import COCOeval\nimport pycoco\nimport dataset\n\nlogging.basicConfig(level=logging.INFO)\nlo... | [
[
"numpy.array",
"numpy.load",
"numpy.save"
]
] |
radandreicristian/metrics | [
"8048c77229f47d82d1adc391407f9cd2f5a8e9fa"
] | [
"torchmetrics/image/fid.py"
] | [
"# Copyright The PyTorch Lightning team.\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 applicable law... | [
[
"torch.trace",
"torch.isfinite",
"torch.from_numpy",
"scipy.linalg.sqrtm",
"scipy.linalg.solve_sylvester"
]
] |
kgresearch/models | [
"09565ab4e12e6e015c8d2c901d455176099773ed"
] | [
"PaddleCV/3d_vision/SMOKE/deploy/infer.py"
] | [
"# Copyright (c) 2021 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 req... | [
[
"numpy.array",
"numpy.linalg.inv"
]
] |
mrjeffs/mne-python | [
"ba60d0e0e56abe4ec64c3679a2d1e664e96c17e4"
] | [
"mne/epochs.py"
] | [
"\"\"\"Tools for working with epoched data\"\"\"\n\n# Authors: Alexandre Gramfort <gramfort@nmr.mgh.harvard.edu>\n# Matti Hamalainen <msh@nmr.mgh.harvard.edu>\n# Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de>\n# Denis Engemann <d.engemann@fz-juelich.de>\n# Mainak Jas <mainak... | [
[
"numpy.dot",
"numpy.argmin",
"numpy.tile",
"numpy.min",
"numpy.mean",
"numpy.where",
"numpy.sort",
"numpy.concatenate",
"numpy.max",
"numpy.zeros_like",
"numpy.empty",
"numpy.interp",
"numpy.nonzero",
"numpy.arange",
"numpy.sqrt",
"numpy.atleast_2d",... |
yagui/phy | [
"6ffe05a559bd0302e98ec60d5958ace719544713"
] | [
"phy/apps/tests/test_base.py"
] | [
"# -*- coding: utf-8 -*-\n\n\"\"\"Integration tests for the GUIs.\"\"\"\n\n#------------------------------------------------------------------------------\n# Imports\n#------------------------------------------------------------------------------\n\nfrom itertools import cycle, islice\nimport logging\nimport os\nfr... | [
[
"numpy.random.normal",
"numpy.zeros_like",
"numpy.zeros",
"numpy.random.seed",
"numpy.ones",
"numpy.diff",
"numpy.arange"
]
] |
robo-corg/incubator-tvm | [
"4ddfdb4b15d05a5bf85a984837967d004efee5dd",
"4ddfdb4b15d05a5bf85a984837967d004efee5dd"
] | [
"tests/python/relay/test_pass_alpha_equal.py",
"tests/python/unittest/test_codegen_extern.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.ones"
],
[
"numpy.random.uniform",
"numpy.zeros"
]
] |
AugggRush/newPLC | [
"4fe5e35eef73382cb295c3d64cb63a841be97dd2"
] | [
"glow.py"
] | [
"# *****************************************************************************\n# Copyright (c) 2018, NVIDIA CORPORATION. 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# * Redis... | [
[
"torch.sigmoid",
"torch.cat",
"torch.nn.ConvTranspose1d",
"torch.nn.ModuleList",
"torch.nn.Conv1d",
"torch.IntTensor",
"torch.autograd.Variable",
"torch.nn.utils.remove_weight_norm",
"torch.FloatTensor",
"torch.det",
"torch.nn.functional.conv1d",
"torch.logdet",
... |
pedrocg42/awesome-cv-projects | [
"928c48aa305d1cd0cd67412659a87ecc6fb6f8b0"
] | [
"pose_estimation/real_time_tf_comparison.py"
] | [
"\"\"\"The purpose of this script is to compare the performance and\naccuracy of possible object detection models for real time inference\nin a normal computer cpu. We are going to compare several models \nselected from the object detection collection of TF hub \n(https://tfhub.dev/tensorflow/collections/object_det... | [
[
"numpy.zeros",
"tensorflow.expand_dims",
"tensorflow.squeeze",
"tensorflow.image.resize",
"tensorflow.saved_model.load"
]
] |
feiwang3311/baseline | [
"c2147a2b241f57da5b0925510364bb825bb24588"
] | [
"baselines/a2c/policies.py"
] | [
"import numpy as np\nimport tensorflow as tf\nfrom baselines.a2c.utils import conv, fc, conv_to_fc, batch_to_seq, seq_to_batch, lstm, lnlstm, sample, check_shape\nfrom baselines.common.distributions import make_pdtype\nimport baselines.common.tf_util as U\nimport gym\n\nclass LnLstmPolicy(object):\n def __init__... | [
[
"numpy.zeros",
"tensorflow.variable_scope",
"tensorflow.placeholder",
"numpy.sqrt",
"tensorflow.cast"
]
] |
gsamp/mbrl-lib | [
"adaaf26729a5ffd7eaaf961c003eb7021e8aa451"
] | [
"mbrl/algorithms/mbpo.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\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.\nimport os\nfrom typing import Optional, Tuple, cast\n\nimport gym\nimport hydra.utils\nimport numpy as np\nimport... | [
[
"numpy.logical_not",
"torch.device",
"numpy.ceil",
"numpy.zeros",
"torch.Generator",
"numpy.random.default_rng",
"numpy.float32"
]
] |
qianzhang1212/Seam-Carving | [
"3d11177b7466c20e3df1db549339ffa0d7172853"
] | [
"website/seamcarving/seam_carving.py"
] | [
"import numpy as np\nimport cv2\n\n\nclass SeamCarver:\n def __init__(self, filename, out_height, out_width, protect_mask='', object_mask=''):\n # initialize parameter\n self.filename = filename\n self.out_height = out_height\n self.out_width = out_width\n\n # read in image and... | [
[
"numpy.array",
"numpy.delete",
"numpy.zeros",
"numpy.argmin",
"numpy.copy",
"numpy.where",
"numpy.amax",
"numpy.amin",
"numpy.average",
"numpy.fliplr"
]
] |
zenglongGH/spresense | [
"b17578aac9faa417b6f1a6d7ebf8f37c57c5ea68"
] | [
"externals/cmsis/CMSIS_5/CMSIS/NN/Scripts/NNFunctions/fully_connected_opt_weight_generation.py"
] | [
"#!/usr/bin/env python\n\nimport numpy as np\n\ndef convert_to_x4_q7_weights(weights):\n [r, h, w, c] = weights.shape\n weights = np.reshape(weights, (r, h*w*c))\n num_of_rows = r\n num_of_cols = h*w*c\n new_weights = np.copy(weights)\n new_weights = np.reshape(new_weights, (r*h*w*c))\n counter... | [
[
"numpy.copy",
"numpy.random.randint",
"numpy.reshape",
"numpy.zeros"
]
] |
buq2/cpp_embedded_python | [
"6b6faf0a5f0ecf9b5ec0e21a89143498b52765cc"
] | [
"ex7_threaded2.py"
] | [
"print('Python module loaded')\n\nimport numpy as np\n\ndef sum(i, j):\n return np.array(i) + np.array(j).tolist() # using numpy arrays as return types would require eigen"
] | [
[
"numpy.array"
]
] |
VladFlorianBiz/botty | [
"fb334017c2d99da6c7616a0ed146da50e5b529b0"
] | [
"src/template_finder.py"
] | [
"import cv2\nfrom screen import Screen\nfrom typing import Tuple, Union, List\nfrom dataclasses import dataclass\nimport numpy as np\nfrom logger import Logger\nimport time\nimport os\nfrom config import Config\nfrom utils.misc import load_template, list_files_in_folder, alpha_to_mask\n\n\n@dataclass\nclass Templat... | [
[
"numpy.average",
"numpy.nan_to_num"
]
] |
HasnainRaz/Tensorflow-input-pipeline | [
"5ba347f5a9d374885ef31cdbe29c9f0fc72ae8b9"
] | [
"dataloader.py"
] | [
"from typing import List, Tuple\n\nimport tensorflow as tf\nimport random\n\nAUTOTUNE = tf.data.experimental.AUTOTUNE\n\n\nclass DataLoader(object):\n \"\"\"A TensorFlow Dataset API based loader for semantic segmentation problems.\"\"\"\n\n def __init__(self, image_paths: List[str], mask_paths: List[str], ima... | [
[
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.image.random_flip_left_right",
"tensorflow.io.read_file",
"tensorflow.py_function",
"tensorflow.stack",
"tensorflow.identity",
"tensorflow.image.decode_jpeg",
"tensorflow.cast",
"tensorflow.shape",
"tensorflow.concat... |
bhoang/GamestonkTerminal | [
"ab4de1dd70fba866930150e440a03e461a6ca6a8"
] | [
"gamestonk_terminal/forex/forex_controller.py"
] | [
"\"\"\"Forex Controller.\"\"\"\n__docformat__ = \"numpy\"\n\nimport argparse\nimport logging\nimport os\nfrom datetime import datetime, timedelta\nfrom typing import List\n\nimport pandas as pd\nfrom prompt_toolkit.completion import NestedCompleter\n\nfrom gamestonk_terminal import feature_flags as gtff\nfrom games... | [
[
"pandas.DataFrame"
]
] |
Tbabm/PerRec | [
"1f711d70df8354156b37857719db0559876be08c"
] | [
"perrec/common/tests/test_similarities.py"
] | [
"# encoding=utf-8\n\nimport unittest\nfrom ..similarities import *\nfrom .. import similarities as sims\nfrom numpy.testing import assert_allclose\n\nclass TestSimilarities(unittest.TestCase):\n def setUp(self):\n self.X = [\n [1, 0, 1, 0],\n [1, 1, 0, 1],\n [0, 1, 0, 0]\n... | [
[
"numpy.testing.assert_allclose"
]
] |
amirhertz/pointgmm | [
"6575739f5ded0d9d059b9bbac37497e2a8a51d5a"
] | [
"process_data/mesh_loader.py"
] | [
"from torch.utils.data import Dataset, DataLoader, Subset\nfrom zipfile import BadZipFile\nimport os\nfrom process_data import files_utils, mesh_utils, points_utils\nimport options\nfrom constants import DATASET\nfrom custom_types import *\nimport json\n\n\nclass MeshDataset(Dataset):\n\n @property\n def tran... | [
[
"torch.utils.data.Subset",
"torch.utils.data.DataLoader"
]
] |
picca/fabio | [
"11350e445a6def4d02c6860aea3ae7f36652af6a"
] | [
"fabio/utils/setup.py"
] | [
"# coding: utf-8\n# /*##########################################################################\n# Copyright (C) 2016 European Synchrotron Radiation Facility\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\"),... | [
[
"numpy.distutils.core.setup",
"numpy.distutils.misc_util.Configuration"
]
] |
Spritea/pytorch-semseg-89f4-two-titan | [
"656f99ad75a59c25ace2888ea98e93dc209c9afd"
] | [
"ptsemseg/models/MV2_5_1.py"
] | [
"import torch.nn as nn\nimport torch.utils.model_zoo as model_zoo\n\nimport torch\nfrom torch.nn import functional as F\n\nmodels_urls = {\n '101_voc': 'https://cloudstor.aarnet.edu.au/plus/s/Owmttk9bdPROwc6/download',\n '18_imagenet': 'https://download.pytorch.org/models/resnet18-5c106cde.pth',\n '34_imag... | [
[
"torch.cat",
"torch.nn.Dropout",
"torch.nn.functional.upsample",
"torch.nn.MaxPool2d",
"torch.nn.Sequential",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.Conv2d",
"torch.load",
"torch.nn.AdaptiveAvgPool2d"
]
] |
dfo-mpo/ais_pilot | [
"152e2be431247e05e94b75d6b52f2f649920957c"
] | [
"src/map_callSign_country.py"
] | [
"#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport pandas as pd\n\n\nstatic = pd.read_csv(\"CCG_AIS_Static_Data_2018-05-01.csv\")\n\n\ncs_countries = pd.read_csv(\"CallSignSeriesRanges-1cc49d48-935c-4514-9ba2-3aabef92c7aa.csv\")\n\n\ncs_countries[cs_countries['Series'].str.contains(\"VGdd\")].shape[0]\... | [
[
"pandas.read_csv"
]
] |
data301-2021-winter1/group15-project | [
"c4d7b7ddb0ab1f6f9de5039de4e354f24a6527c5"
] | [
"notebooks/project_functions3.py"
] | [
"import pandas as pd\nimport numpy as np\n\ndef unprocessed(csv_file):\n df = pd.read_csv('../data/raw/mars-weather.csv')\n return df\n\ndef load_and_process(csv_file):\n df = pd.read_csv('../data/raw/mars-weather.csv')\n df1=(df.copy().drop(['atmo_opacity','wind_speed','id'], axis=1)\n .rename(c... | [
[
"pandas.read_csv",
"numpy.select"
]
] |
YangJianyu-bupt/privmdr | [
"c4b68c87aeeb811ae8c42db511704fd3cc258a3c"
] | [
"HDG.py"
] | [
"import numpy as np\nimport math\nimport grid_generate as GridGen\nimport estimate_method as EstMeth\nimport frequency_oracle as FreOra\nimport itertools\nimport choose_granularity\n\n\nclass AG_Uniform_Grid_1_2_way_optimal:\n def __init__(self, args = None):\n self.args = args\n self.group_attribu... | [
[
"numpy.sum",
"numpy.copy",
"numpy.abs",
"numpy.zeros"
]
] |
Ceres-Navigation/ceres | [
"2ab8431e85e783fcdd21a53ccc62fd09ce687dce"
] | [
"examples/simple_orbit.py"
] | [
"import numpy as np\n\nfrom ceres.constants import muSun, AU, SPD\nfrom ceres.orbits import TwoBody\n\n# Orbital elements for CERES (from SBDB):\na = 2.766043062222408*AU\ne = 0.07850100198908602\ni = np.deg2rad(10.58769305845201)\nperi = np.deg2rad(73.63703979153577)\nRAAN = np.deg2rad(80.26859547732911)\nM = np.d... | [
[
"numpy.deg2rad",
"numpy.array"
]
] |
SauravMaheshkar/SMCPy | [
"69d2df140d3c851714e3bc8370b2ad9bdc3567fd",
"69d2df140d3c851714e3bc8370b2ad9bdc3567fd"
] | [
"tests/unit/test_smc_sampler.py",
"examples/simple_example/run_example_known_std.py"
] | [
"import numpy as np\nimport pytest\n\nfrom smcpy import SMCSampler\n\n\n@pytest.fixture\ndef phi_sequence():\n return np.linspace(0, 1, 11)\n\n\n@pytest.fixture\ndef step_list(phi_sequence, mocker):\n num_particles = 5\n step_list = []\n for phi in phi_sequence[1:]:\n particles = mocker.Mock()\n ... | [
[
"numpy.array",
"numpy.zeros",
"numpy.log",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.linspace"
],
[
"numpy.random.normal",
"numpy.array",
"scipy.stats.uniform",
"numpy.random.seed",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyp... |
openforcefield/smirnoff-plugins | [
"0dbb92e1f75ca72bbf35d3c1062375393fbb73b8"
] | [
"smirnoff_plugins/tests/conftest.py"
] | [
"import math\n\nimport numpy\nimport pytest\nfrom openff.toolkit.topology import Molecule, Topology\nfrom openff.toolkit.typing.engines.smirnoff import ForceField, ParameterList\nfrom simtk import unit\n\n\n@pytest.fixture()\ndef buckingham_water_force_field() -> ForceField:\n \"\"\"Create a buckingham water mod... | [
[
"numpy.eye"
]
] |
danilopeixoto/torchvision-yolov3 | [
"30062f37322e94198773546651ff7a81e166f5b8"
] | [
"torchvision_yolov3/yolov3.py"
] | [
"import torch\nimport torch.nn as nn\nfrom collections import OrderedDict\n\nfrom .utils import load_state_dict_from_url\nfrom .backbone_utils import darknet_backbone\nfrom .transform import YOLOTransform\nfrom .loss import YOLOLoss\n\n\n__all__ = [\n \"YOLOv3\", \"yolov3_darknet53\",\n]\n\n\nclass YOLOv3(nn.Mod... | [
[
"torch.cat",
"torch.nn.BatchNorm2d",
"torch.nn.LeakyReLU",
"torch.nn.Upsample",
"torch.nn.Conv2d"
]
] |
ChokJohn/SpeechX | [
"f7f4963020cb8628868bd7f8f32b3563602840cd"
] | [
"egs/librimix/TransMask/train.py"
] | [
"import os\nimport argparse\nimport json\n\nimport torch\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.data import DataLoader\nimport pytorch_lightning as pl\nfrom pytorch_lightning.callbacks import ModelCheckpoint, EarlyStopping\n\n# from asteroid import TransMask\nfrom asteroid import ... | [
[
"torch.optim.lr_scheduler.ReduceLROnPlateau",
"torch.cuda.is_available",
"torch.utils.data.DataLoader",
"torch.load"
]
] |
dannyolesh/Image_classifier_project | [
"cb4927c1c5640eac69eb119aaacbc1c4e84ed0d3"
] | [
"predict_functions.py"
] | [
"# predict functions for predict.py\n# Danny Olesh 22.11.2021\n# Resources used:\n# Study learning notes and code from the course\n# https://pytorch.org/\n# Udacity deeplearning pytorch help\n# Self study and experiminationion using ATOM in Anaconda3 environment\n# Edited code snippets for certain Network definiti... | [
[
"torch.no_grad",
"torch.exp"
]
] |
tramnguyen72/ssd_keras_object_detection | [
"93795b6f43b9c22bb5da7755659ea03aa7abaee6"
] | [
"keras_layers/keras_layer_AnchorBoxes.py"
] | [
"'''\nA custom Keras layer to generate anchor boxes.\n\nCopyright (C) 2018 Pierluigi Ferrari\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros_like",
"tensorflow.keras.backend.constant",
"numpy.zeros",
"tensorflow.keras.backend.common.image_dim_ordering",
"tensorflow.keras.backend.image_data_format",
"numpy.tile",
"numpy.any",
"tensorflow.keras.layers.InputSpec",
... |
Um3sobi/sigver_wiwd | [
"3e509df4cebc5d8dbb083373a017e7d0cea4f0be"
] | [
"lasagne_to_tf.py"
] | [
"\"\"\" Some useful functions to port a model from lasagne to tensorflow.\n\n * Lasagne uses the format BCHW, while tensorflow uses BHWC \n (B = batch_size, C = channels, H = height, W = width)\n * By default, lasagne uses convolution, while tensorflow implements\n cross-correlation (convolution is ... | [
[
"numpy.transpose"
]
] |
williamd4112/baselines | [
"d9af95518e41e6e58feba9d70529e1dcabb044c8"
] | [
"baselines/common/vec_env/vec_normalize.py"
] | [
"from . import VecEnvWrapper\nfrom baselines.common.running_mean_std import RunningMeanStd\nimport numpy as np\n\n\nclass VecNormalize(VecEnvWrapper):\n \"\"\"\n A vectorized wrapper that normalizes the observations\n and returns from an environment.\n \"\"\"\n\n def __init__(self, venv, ob=True, ret... | [
[
"numpy.sqrt",
"numpy.zeros"
]
] |
mlsys-seo/ooo-backprop | [
"772446f2df1154c890d4d12860c1981600d639cc"
] | [
"tensorflow/tensorflow/python/ops/nn_grad.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.ops.math_ops.divide",
"tensorflow.python.ops.gen_nn_ops.relu6_grad",
"tensorflow.python.ops.gen_nn_ops.conv2d_backprop_filter",
"tensorflow.python.ops.math_ops.reduce_sum",
"tensorflow.python.ops.gen_nn_ops.selu_grad",
"tensorflow.python.ops.math_ops.sigmoid",
"tenso... |
als0052/pyNastran | [
"8493323c30475d1fc3238eed7480bfe9015ce233"
] | [
"pyNastran/bdf/bdf_interface/pybdf.py"
] | [
"# coding: utf-8\n\"\"\"\nMain BDF class. Defines:\n - BDFInputPy\n\n\"\"\"\nimport os\nfrom collections import defaultdict\nfrom itertools import count\nfrom typing import List, Tuple, Optional, Union, Any, cast\nfrom io import StringIO\n\nimport numpy as np\nfrom cpylog import get_logger2\nfrom pyNastran.nptypi... | [
[
"numpy.arange",
"numpy.empty",
"numpy.asarray",
"numpy.vstack"
]
] |
bio-hpc/metascreener | [
"6900497629f601c4b6c0c37da26de58ffa221988"
] | [
"MetaScreener/external_sw/mgltools/lib/python2.7/site-packages/pycollada-0.4-py2.7.egg/collada/polylist.py"
] | [
"####################################################################\n# #\n# THIS FILE IS PART OF THE pycollada LIBRARY SOURCE CODE. #\n# USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS #\n# GOVERNED BY A BSD-STYLE SOURCE LI... | [
[
"numpy.max",
"numpy.repeat",
"numpy.array",
"numpy.asmatrix",
"numpy.isnan",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.swapaxes",
"numpy.arange",
"numpy.cumsum",
"numpy.dstack",
"numpy.fromstring"
]
] |
henrytseng/scikit-learn | [
"75c58c39eb9eed15ba6c96c52b6adcd95f045294"
] | [
"sklearn/feature_extraction/image.py"
] | [
"\"\"\"\nThe :mod:`sklearn.feature_extraction.image` submodule gathers utilities to\nextract features from images.\n\"\"\"\n\n# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>\n# Gael Varoquaux <gael.varoquaux@normalesup.org>\n# Olivier Grisel\n# Vlad Niculae\n# Licens... | [
[
"numpy.array",
"numpy.lib.stride_tricks.as_strided",
"numpy.empty",
"numpy.reshape",
"numpy.zeros",
"numpy.asarray",
"numpy.flatnonzero",
"numpy.sum",
"numpy.ones",
"numpy.atleast_3d",
"numpy.arange",
"numpy.abs",
"numpy.hstack",
"numpy.in1d"
]
] |
symoon94/YOLO-keras | [
"56c1f136023040291d0eb3c970b6e3942e6fa158",
"80f263700d8251376e59a7908dd1ae8408e5eb01"
] | [
"common/backbones/imagenet_training/train_imagenet.py",
"yolo3/models/yolo3_mobilenetv2.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# train backbone network with imagenet dataset\n#\n\nimport os, sys, argparse\nimport numpy as np\nfrom multiprocessing import cpu_count\n\nimport tensorflow.keras.backend as K\nfrom tensorflow.keras.optimizers import Adam, SGD, RMSprop\nfrom tensorflow.keras.pre... | [
[
"tensorflow.keras.callbacks.TensorBoard",
"tensorflow.keras.preprocessing.image.ImageDataGenerator",
"tensorflow.keras.optimizers.SGD",
"numpy.asarray",
"tensorflow.keras.callbacks.TerminateOnNaN",
"tensorflow.keras.utils.multi_gpu_model",
"tensorflow.keras.callbacks.LearningRateSchedu... |
ZitongYu/pidinet | [
"e4fae3534775556beebe10f811c99cb18086a396"
] | [
"utils.py"
] | [
"\"\"\"\nUtility functions for training\n\nAuthor: Zhuo Su, Wenzhe Liu\nDate: Aug 22, 2020\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\nfrom __future__ import print_function\nfrom __future__ import division\n\nimport os\nimport shutil\nimport math\nimport time\nimport ... | [
[
"torch.sum",
"torch.save",
"torch.nn.functional.binary_cross_entropy",
"torch.load"
]
] |
tango4j/pytorch_xvectors | [
"b4f63fa8b074967ca05b16160ad7de9579df4e74"
] | [
"models.py"
] | [
"#!/bin/python3.6\n\n\"\"\"\n Date Created: Feb 10 2020\n\n This file contains the model descriptions, including original x-vector\n architecture. The first two models are in active developement. All others\n are provided below\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nfrom torch.nn import functio... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LSTM",
"torch.nn.Conv1d",
"torch.FloatTensor",
"torch.nn.Conv2d",
"torch.nn.BatchNorm1d",
"torch.cuda.is_available",
"torch.cuda.FloatTensor",
"torch.randn"
]
] |
heba14101998/logistic-regression-implemewntation | [
"2078ad18bbc94f40947c4ef356d2570a143c82b4"
] | [
"logistic_regression.py"
] | [
"import numpy as np\n\nclass LogisticRegression:\n def __init__(self, lr=0.001, n_iters = 1000):\n self.lr = lr\n self.n_iters = n_iters \n self.weights = None\n self.bias = None\n \n \n def fit (self, X, y):\n \n n_samples, n_features = X.shape\n... | [
[
"numpy.array",
"numpy.dot",
"numpy.sum",
"numpy.random.randn",
"numpy.exp"
]
] |
zmoitier/accoster | [
"648b9edf7e73848eacb60af0885be4d30fdbbafc"
] | [
"claudius/coordinates.py"
] | [
"\"\"\"Change coordinates\"\"\"\nfrom numpy import arccos, arctan2, hypot, sqrt\n\n\ndef to_polar(coo_x, coo_y):\n \"\"\"\n r, θ = to_polar(x, y)\n\n Change Cartesian coordinates to Polar coordinates.\n\n Parameters\n ----------\n x : array_like\n first Cartesian coordinate\n y : array_l... | [
[
"numpy.arctan2",
"numpy.arccos",
"numpy.hypot",
"numpy.sqrt"
]
] |
KODeKarnage/tods | [
"40e79269f14b60e090028188f1ed8380d518270f"
] | [
"tods/feature_analysis/DiscreteCosineTransform.py"
] | [
"import os\nimport typing\nimport pandas as pd \nimport numpy as np\n\nfrom d3m import container, utils\nfrom d3m.base import utils as base_utils\nfrom d3m.metadata import base as metadata_base, hyperparams\nfrom d3m.primitive_interfaces import base, transformer\n\nimport common_primitives\nimport logging\nimport m... | [
[
"scipy.fft.dct",
"scipy.sparse.issparse",
"pandas.Series"
]
] |
jramapuram/variational_saccading | [
"88edf6096e00841f5d5a01fd2ca0d46caaef73a1"
] | [
"models/relational_network.py"
] | [
"import argparse\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nfrom torch.autograd import Variable\n\nfrom helpers.utils import to_data, expand_dims, \\\n int_type, float_type, long_type, add_weight_norm\nfrom helpers.layers import build_conv_encoder, build... | [
[
"torch.cat",
"torch.nn.SELU"
]
] |
mdecourse/urdf2webots | [
"c00d17970585c86b6db93591ce0183dcaeb9f662"
] | [
"urdf2webots/parserURDF.py"
] | [
"\"\"\"Import modules.\"\"\"\nimport math\nimport os\nimport sys\nimport struct\nimport numpy\ntry:\n from PIL import Image\nexcept ImportError as e:\n if sys.platform == 'linux2':\n sys.stderr.write(\"PIL module not found, please install it with:\\n\")\n sys.stderr.write(\"apt-get install pytho... | [
[
"numpy.array",
"numpy.size"
]
] |
healthcAIr/LuVoX | [
"afed83366cb067aff776e546cbe3d9b749223458"
] | [
"dcmtools.py"
] | [
"#!/usr/bin/env python3\n\"\"\"DCMTools for loading (compressed) DICOM studies and series.\n\nThis module provides various methods to load compressed archives or\na single directory, which can contain (multiple) DICOM studies / series.\n\n\"\"\"\nfrom __future__ import print_function\nimport tarfile\nimport os\nimp... | [
[
"numpy.divide",
"numpy.max",
"numpy.array",
"numpy.roll",
"numpy.float32",
"numpy.stack",
"numpy.abs"
]
] |
JustKowalski/sound_separation | [
"001d5d0be0b15f534cad6a5a8d31f45702505ba5"
] | [
"models/dcase2020_fuss_baseline/train/inference_graph.py"
] | [
"# Copyright 2020 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 ... | [
[
"tensorflow.compat.v1.train.export_meta_graph",
"tensorflow.compat.v1.train.write_graph",
"tensorflow.compat.v1.Graph",
"tensorflow.compat.v1.train.Saver",
"tensorflow.compat.v1.enable_eager_execution"
]
] |
SkyFlyboy/myfaiseq | [
"a87cafda718c7706e6f1694f0d39fc589ed2b264"
] | [
"fairseq/tasks/multilingual_translation.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\nfrom collections import OrderedDict\nimport logging\nimport os\n\nimport contextlib\nimport torch\n\nfrom fairseq import metrics, op... | [
[
"torch.no_grad"
]
] |
filipe-research/tutorial_noisylabels | [
"60264e23126a7ee471ad4909ca2701f465c2116f"
] | [
"codes/loss.py"
] | [
"#code from https://github.com/HanxunH/Active-Passive-Losses\nimport torch\nimport torch.nn.functional as F\nimport numpy as np\nimport mlconfig\nmlconfig.register(torch.nn.CrossEntropyLoss)\n\nif torch.cuda.is_available():\n torch.backends.cudnn.benchmark = True\n if torch.cuda.device_count() > 1:\n d... | [
[
"torch.nn.NLLLoss",
"torch.device",
"numpy.array",
"torch.nn.functional.one_hot",
"torch.autograd.Variable",
"torch.FloatTensor",
"torch.clamp",
"torch.cuda.device_count",
"torch.nn.functional.log_softmax",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"... |
rusty1s/embedded_gcnn | [
"06db3799e794d6ebcd9db023ebd8b0937587df94",
"06db3799e794d6ebcd9db023ebd8b0937587df94"
] | [
"lib/tf/convert_test.py",
"lib/tf/bspline.py"
] | [
"import scipy.sparse as sp\nimport tensorflow as tf\n\nfrom .convert import sparse_to_tensor\n\n\nclass SparseTest(tf.test.TestCase):\n def test_sparse_to_tensor(self):\n value = [[0, 1, 0], [1, 0, 2], [0, 2, 0]]\n value = sp.coo_matrix(value)\n\n with self.test_session():\n self.... | [
[
"tensorflow.sparse_tensor_to_dense",
"scipy.sparse.coo_matrix",
"tensorflow.sparse_placeholder"
],
[
"tensorflow.sparse_maximum",
"tensorflow.as_dtype",
"tensorflow.ones_like",
"tensorflow.constant",
"tensorflow.zeros_like",
"tensorflow.sparse_minimum",
"tensorflow.logi... |
yippp/Musier | [
"b943cb9d464c2518ed5515643e6b177adb10bf54"
] | [
"Database/analysis.py"
] | [
"from Midi import Midi\nimport os\nimport matplotlib.pyplot as plt\n\n\ndef delete_repetition(note_list):\n new_list = [note_list[0]]\n for i in range(1, len(note_list)):\n if note_list[i - 1][0] != note_list[i][0]:\n new_list.append(note_list[i])\n return new_list\n\n\ndef get_pattern(fi... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.title",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
alexm622/bookshelf-reader | [
"ac0da815943edf9adfcd8d8e904bbdd8b678ad92"
] | [
"workspace/model_main_tf2.py"
] | [
"# Lint as: python3\n# 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... | [
[
"tensorflow.compat.v2.tpu.experimental.initialize_tpu_system",
"tensorflow.compat.v2.config.experimental_connect_to_cluster",
"tensorflow.compat.v2.compat.v1.app.run",
"tensorflow.compat.v2.distribute.experimental.MultiWorkerMirroredStrategy",
"tensorflow.compat.v2.distribute.cluster_resolver.... |
debugger24/kedro-mlflow | [
"6b060c00fdba003a33179415651bc9d1d19eeba7"
] | [
"tests/io/artifacts/test_mlflow_artifact_dataset.py"
] | [
"from pathlib import Path\n\nimport mlflow\nimport pandas as pd\nimport pytest\nfrom kedro.extras.datasets.pandas import CSVDataSet\nfrom kedro.extras.datasets.pickle import PickleDataSet\nfrom mlflow.tracking import MlflowClient\nfrom pytest_lazyfixture import lazy_fixture\n\nfrom kedro_mlflow.io.artifacts import ... | [
[
"pandas.DataFrame"
]
] |
fswzb/autotrade | [
"e3240dc6d5d81504b3df3be7f0f85000ce5b634d"
] | [
"test/lundong.py"
] | [
"# coding: utf-8\n\n#行业龙头股均线\n#股票池需要如下:\n#沪深300池,\n#当前不停牌的股票池,\n#有历史数据的股票池,\n#两者的交集得到可用股票池\n#持仓股票池\n#可用股票池中剔除持仓股票得到的股票池(可以进行买入操作的股票池)\n#将要买入的股票池:即上述股票池中发出买入信号得到的股票池\n#将要卖出的股票池:持仓股票池中,没有停牌的,发出卖出信号的股票池\nenable_profile()\nimport random\nimport numpy as np\nimport pandas as pd\nfrom pandas import Series, DataFrame\nimp... | [
[
"pandas.DataFrame",
"numpy.array",
"pandas.concat"
]
] |
EthanKochis/CUDA-Conways-Game-of-Life | [
"14521c9840fccaaf0f7654a1ec2f363ae945de87"
] | [
"make_PNG_Grid.py"
] | [
"import matplotlib.pyplot as plt\nfrom matplotlib import colors\nimport subprocess\nimport sys\n\ndef create_colormap(file_data, numRows, numCols, gen_number):\n \n data = []\n for i in range(0, numRows):\n temp = []\n for j in range(0, numCols):\n if file_data[i][j] == '0':\n ... | [
[
"matplotlib.colors.ListedColormap",
"matplotlib.colors.BoundaryNorm",
"matplotlib.pyplot.subplots"
]
] |
duggalsu/PySyft | [
"d811ef1e91e5e2c84fbbf1edf61e6983380b4d16"
] | [
"syft/frameworks/torch/mpc/fss.py"
] | [
"\"\"\"\nThis is an implementation of Function Secret Sharing\n\nUseful papers are:\n- Function Secret Sharing- Improvements and Extensions, Boyle 2017\n Link: https://eprint.iacr.org/2018/707.pdf\n- Secure Computation with Preprocessing via Function Secret Sharing, Boyle 2019\n Link: https://eprint.iacr.org/2019... | [
[
"numpy.concatenate",
"numpy.array",
"torch.cat",
"numpy.empty",
"torch.IntTensor",
"numpy.ones",
"numpy.random.randint",
"torch.tensor",
"numpy.arange",
"numpy.dtype"
]
] |
GingerLabUW/FFTA | [
"576591d6ba23731c26f7dfa90591e94795f1b288"
] | [
"ffta/pixel.py"
] | [
"\"\"\"pixel.py: Contains pixel class.\"\"\"\n# pylint: disable=E1101,R0902,C0103\n__author__ = \"Rajiv Giridharagopal\"\n__copyright__ = \"Copyright 2021\"\n__maintainer__ = \"Rajiv Giridharagopal\"\n__email__ = \"rgiri@uw.edu\"\n__status__ = \"Development\"\n\nimport numpy as np\nfrom scipy import signal as sps\n... | [
[
"numpy.copy",
"numpy.min",
"scipy.signal.filtfilt",
"numpy.fft.fft",
"numpy.max",
"numpy.sin",
"numpy.angle",
"scipy.signal.fftconvolve",
"matplotlib.pyplot.subplots",
"numpy.arange",
"matplotlib.pyplot.tight_layout",
"numpy.append",
"numpy.array",
"numpy.pa... |
AnacondaRecipes/lightgbm-feedstock | [
"93730f208a2fb258e79f25ff38fef8c2bed40f10"
] | [
"recipe/run_test.py"
] | [
"\"\"\"\nA simple test for LightGBM based on scikit-learn.\n\nTests are not shipped with the source distribution so we include a simple\nfunctional test here that is adapted from:\n\n https://github.com/Microsoft/LightGBM/blob/master/tests/python_package_test/test_sklearn.py\n\n\"\"\"\n\nimport unittest\n\nimpor... | [
[
"sklearn.model_selection.train_test_split",
"sklearn.datasets.load_boston",
"sklearn.datasets.load_breast_cancer"
]
] |
epigani/PatternFormation | [
"40b639928af345de093996b95561f1028f094ebb"
] | [
"code/params.py"
] | [
"import numpy as np\nimport pandas as pd\nimport os\n\n\nLOCAL_PATH = os.getcwd()\nSIMULATIONS_PATH = '../../simulations'\nLOG_PATH = '../../log'\nFIG_PATH = '../../fig'\n\nos.makedirs(SIMULATIONS_PATH, exist_ok=True)\nos.makedirs(LOG_PATH, exist_ok=True)\nos.makedirs(FIG_PATH, exist_ok=True)\n\nparameters = {}\n\n... | [
[
"pandas.DataFrame",
"numpy.array",
"numpy.sqrt"
]
] |
EltonCN/evolvepy | [
"4489264d6c03ea4f3c23ea665fdf12fe4ead1ccc"
] | [
"src/evolvepy/generator/selection/selection.py"
] | [
"import numpy as np\nfrom numpy.typing import ArrayLike\nfrom numpy.random import choice\nimport numba\n\n@numba.njit(fastmath=True)\ndef isin(val, arr):\n for i in range(arr.shape[0]):\n if arr[i] == val:\n return True\n return False\n\n@numba.njit\ndef tournament(fitness_array:ArrayLike, n... | [
[
"numpy.empty",
"numpy.asarray",
"numpy.zeros",
"numpy.sum",
"numpy.min",
"numpy.arange",
"numpy.random.randint",
"numpy.cumsum",
"numpy.random.random"
]
] |
jayralencar/fast-bert | [
"9f0c3d5fb031752d7e16630fd9c2fb7c398605e9"
] | [
"fast_bert/data_lm.py"
] | [
"import re\nimport html\nimport logging\nimport pandas as pd\nimport os\nimport random\nimport torch\nfrom pathlib import Path\nimport pickle\nimport shutil\nimport itertools\nimport more_itertools\n\nfrom sklearn.model_selection import train_test_split\n\nfrom torch.utils.data import (\n TensorDataset,\n Dat... | [
[
"torch.utils.data.RandomSampler",
"torch.cuda.device_count",
"torch.full",
"torch.tensor",
"torch.utils.data.DataLoader",
"sklearn.model_selection.train_test_split"
]
] |
Louie110/gluon-tutorials-zh | [
"34a46385ac8495a44f608fae5ff74b079963d9a6"
] | [
"gluonbook/utils.py"
] | [
"import random\nimport os\nimport tarfile\nfrom time import time\n\nfrom IPython.display import set_matplotlib_formats\nfrom matplotlib import pyplot as plt\nimport mxnet as mx\nfrom mxnet import autograd, gluon, image, nd\nfrom mxnet.gluon import nn, data as gdata, loss as gloss, utils as gutils\nimport numpy as n... | [
[
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.semilogy",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.Rectangle",
"matplotlib.pyplot.show"
]
] |
1iyiwei/pyml | [
"9bc0fa94abd8dcb5de92689c981fbd9de2ed1940"
] | [
"code/ch03/kernel_svm.py"
] | [
"import numpy as np\nfrom share import *\n\ndef xor_data(num_points):\n X_xor = np.random.randn(num_points, 2)\n y_xor = np.logical_xor(X_xor[:, 0] > 0, X_xor[:, 1] > 0)\n y_xor = np.where(y_xor, 1, -1)\n return X_xor, y_xor\n\ndef circle_data(num_points, radius): \n X = np.random.randn(num_points... | [
[
"numpy.logical_xor",
"numpy.random.seed",
"numpy.random.randn",
"sklearn.svm.SVC",
"numpy.where"
]
] |
nubiancypher/big-data-reu | [
"663d2e900746c6de967009bdb01d4686a7f84b84"
] | [
"2021-projects/team-1/analysis/var/var_data_maker.py"
] | [
"'''\nPurpose: Generate train and test data files for the VAR model.\n'''\nimport pandas as pd\nimport numpy as np\n\n# Open full dataset with shape (510, 448, 304, 10) corresponding to (months, height, width, # of predictors).\nwith open(\"/umbc/xfs1/cybertrn/reu2021/team1/research/preprocessing/whole_data.npy\", ... | [
[
"numpy.concatenate",
"numpy.nan_to_num",
"pandas.DataFrame",
"numpy.load",
"numpy.mean",
"numpy.expand_dims"
]
] |
XinzheL/allennlp | [
"6f222919aba1799f320ef507b08bce8a84e4af3f",
"6f222919aba1799f320ef507b08bce8a84e4af3f"
] | [
"tests/data/fields/multilabel_field_test.py",
"allennlp/modules/transformer/output_layer.py"
] | [
"import logging\n\nimport numpy\nimport pytest\n\nfrom allennlp.common.checks import ConfigurationError\nfrom allennlp.common.testing import AllenNlpTestCase\nfrom allennlp.data.fields import MultiLabelField\nfrom allennlp.data.vocabulary import Vocabulary\n\n\nclass TestMultiLabelField(AllenNlpTestCase):\n def ... | [
[
"numpy.array"
],
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.nn.LayerNorm"
]
] |
akin-aroge/mitx6.86_projects | [
"ab02b92bc0c28758cdae5898898cd26e297c3cd2"
] | [
"resources_mnist/mnist/part1/main.py"
] | [
"import sys\nimport numpy as np\nimport matplotlib.pyplot as plt\nsys.path.append(\"..\")\nfrom utils import *\nfrom linear_regression import *\nfrom svm import *\nfrom softmax import *\nfrom features import *\nfrom kernel import *\n\n#######################################################################\n# 1. Int... | [
[
"numpy.ones"
]
] |
PhiDCH/TextFuseNet | [
"f9d6139fd7bbf121a1ef9ab4ad488fb12a8b0ef4"
] | [
"cal_recall/rrc_evaluation_funcs.py"
] | [
"#!/usr/bin/env python2\n#encoding: UTF-8\nimport json\nimport sys;sys.path.append('./')\nimport zipfile\nimport re\nimport sys\nimport os\nimport codecs\nimport traceback\nimport numpy as np\n\ndef order_points_clockwise(pts):\n rect = np.zeros((4, 2), dtype=\"float32\")\n s = pts.sum(axis=1)\n rect[0] = ... | [
[
"numpy.array",
"numpy.argmin",
"numpy.zeros",
"numpy.diff",
"numpy.argmax"
]
] |
marquitos87/RFM_naranja | [
"6d66d58110ac137c2da7219e216a9d5d758fd525"
] | [
"src/rfm_deployment/query_mensual_comercios.py"
] | [
"import cx_Oracle\nimport pandas as pd\nimport numpy as np\nimport calendar\nimport datetime\n\n#==================================================================================================================\n\ndef add_months(sourcedate, months):\n \n \"\"\"Función que permite sumar o restar 'months' mese... | [
[
"pandas.DataFrame"
]
] |
nutrik/pymole | [
"f2e58f819d0e33a884f4f5779fd3cb24d04e41ce"
] | [
"core/div1DNonUniform.py"
] | [
"import numpy as np\nfrom .div1D import div1D\nfrom scipy.sparse import spdiags\n\n\ndef div1DNonUniform(k, ticks, dx=1.):\n \"\"\"Computes a m+2 by m+1 one-dimensional non-uniform mimetic divergence\n operator\n\n Arguments:\n k (int): Order of accuracy\n ticks (:obj:`ndarray`): Edges' ticks ... | [
[
"numpy.array",
"numpy.dot"
]
] |
Gogul09/virtual-drum | [
"374c5075bc6d2424e4fa6790a96d90600c05d6b1"
] | [
"virtual_drum.py"
] | [
"# organize imports\nimport cv2\nimport numpy as np\nfrom pygame import mixer\n\n# color to detect - drum stick\nlower = [17, 15, 100]\nupper = [80, 76, 220]\n\n# initialize mixer\nmixer.init()\n\n# region coordinates\nk_top, k_bottom, k_right, k_left = 180, 280, 540, 640\nh_top, h_bottom, h_right, h_left = 140, 24... | [
[
"numpy.array"
]
] |
EGO4D/hands-and-objects | [
"76d6ce6af1a9db4007ea24eb315f3f0eaea26bc2"
] | [
"state-change-localization-classification/bmn/Ego4D_keyframe_localisation/models/video_model_builder.py"
] | [
"#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n\n\"\"\"Video models.\"\"\"\n\nimport torch\nimport torch.nn as nn\n\nimport utils.weight_init_helper as init_helper\nfrom models.batchnorm_helper import get_norm\n\nfrom . import head_helper, resnet_helper, stem_helpe... | [
[
"torch.nn.ReLU",
"torch.cat",
"torch.nn.MaxPool3d",
"torch.nn.Conv3d"
]
] |
profLewis/gpml-python | [
"9a9cdf0498abd2c1922de0ba9f2994ed8f94d3a6"
] | [
"hyper.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\" GPML hyper parameter treatment.\r\n\r\nProvide iterator, getter and setter.\r\n\r\nCreated: Mon Jan 13 11:01:19 2014 by Hannes Nickisch, Philips Research Hamburg.\r\nModified: $Id: hyper.py 1263 2013-12-13 13:36:13Z hn $\r\n\"\"\"\r\n__version__ = \"$Id: hyper.py 913 2013-08-15 12... | [
[
"numpy.array"
]
] |
PhIMaL/phimal_utilities | [
"3d5c101e1a024ac29e7ed47823d7a15e9085dbd7"
] | [
"tests/testing_torch.py"
] | [
"import numpy as np\nfrom phimal_utilities.data import Dataset\nfrom phimal_utilities.data.diffusion import DiffusionGaussian\nfrom phimal_utilities.data.burgers import BurgersDelta, BurgersCos, BurgersSawtooth\nfrom phimal_utilities.data.kdv import KdVSoliton\n\nx = np.linspace(-5, 5, 1000)\nt = np.linspace(0.0, 2... | [
[
"numpy.linspace",
"numpy.linalg.lstsq",
"numpy.meshgrid"
]
] |
radiasoft/rsrespic | [
"7bbc3c30a9556e7b4d1ebe9c0190384612bd2af6"
] | [
"development/utilities.py"
] | [
"from __future__ import division\n\nimport numpy as np\nimport matplotlib\nimport scipy.integrate as sint\nimport matplotlib.pyplot as plt\n\nimport math\n\nimport constants\n\nq = constants.cgs_constants['q']\nc = constants.cgs_constants['c']\nm_e = constants.cgs_constants['m_e']\nm_p = constants.cgs_constants['m_... | [
[
"scipy.integrate.odeint",
"numpy.asarray",
"numpy.log",
"numpy.sum",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.title",
"numpy.linspace",
"matplotlib.pyplot.figure",
"numpy.abs",
"numpy.sqrt",
"matplotlib.pyplot.show",
"matplotlib.pyplot.hexbin",
"matplotlib.p... |
Railag/keras-image-recognition | [
"2e7c5b3ea53cf9dbb98a09074d7e90d6f44ebcce"
] | [
"NN_architectures/InceptionV3.py"
] | [
"import numpy as np\nfrom keras.applications.inception_v3 import InceptionV3, decode_predictions\n\n\ndef predict(image):\n model = InceptionV3()\n\n pred = model.predict(image)\n decoded_predictions = decode_predictions(pred, top=10)\n response = 'InceptionV3 predictions: ' + str(decoded_predictions[... | [
[
"numpy.argmax"
]
] |
miketrumpis/ecogdata | [
"ff65820198e69608634c12686a86b97ac3a77558",
"ff65820198e69608634c12686a86b97ac3a77558"
] | [
"ecogdata/devices/load/afe.py",
"ecogdata/devices/load/_OpenEphys.py"
] | [
"import tables\nimport nptdms\nimport numpy as np\nimport os\nfrom ecogdata.util import mkdir_p, Bunch\nimport ecogdata.filt.time as ft\nimport ecogdata.devices.electrode_pinouts as epins\nimport ecogdata.parallel.sharedmem as shm\nfrom ecogdata.parallel.split_methods import filtfilt\n\nfrom ..units import convert_... | [
[
"numpy.any",
"numpy.arange",
"numpy.diff"
],
[
"numpy.concatenate",
"numpy.array",
"numpy.isclose",
"numpy.reshape",
"numpy.zeros",
"numpy.min",
"numpy.shape",
"numpy.mean",
"numpy.float64",
"numpy.any",
"numpy.fromfile",
"numpy.dtype"
]
] |
adamos581/stable-protein-env | [
"49c488533d84740a57949f5969871f4eb841e21f"
] | [
"gym-rosetta/gym_rosetta/envs/protein_fold_env.py"
] | [
"import json\nimport os, subprocess, time, signal\nimport gym\nfrom gym import error, spaces\nfrom gym import utils\nfrom gym.utils import seeding\nfrom pyrosetta.teaching import *\nfrom pyrosetta import init, pose_from_pdb, pose_from_sequence\nfrom pyrosetta.toolbox import cleanATOM\nfrom pyrosetta.rosetta.core.id... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.zeros",
"numpy.random.seed"
]
] |
711e/deep_learn_recommender | [
"da4a97b8dcdb59853f166c6c4f89510d60b7de99"
] | [
"inference.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport tensorflow as tf\n\n# 嵌入矩阵的维度\nEMBED_DIM = 32\n\nUSER_ID_COUNT = 6041\nGENDER_COUNT = 2\nAGE_COUNT = 7\nJOB_COUNT = 21\n\nMOVIE_ID_COUNT = 3953\nMOVIE_GENRES_COUNT = 18\nMOVIE_TITLE_WORDS_COUNT = 5217\n\nBATCH_SIZE = 256\n\nLSTM_UNIT_NUM = 128\n\n\n# 用户特征网络核心代码\ndef user_feature_n... | [
[
"tensorflow.contrib.rnn.BasicLSTMCell",
"tensorflow.matmul",
"tensorflow.reshape",
"tensorflow.nn.embedding_lookup",
"tensorflow.contrib.rnn.DropoutWrapper",
"tensorflow.trainable_variables",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.summary.histogram",
"tensorfl... |
iamgroot42/data-poisoning-release | [
"fef371060878b7524af9b31225d3144d268b98b3"
] | [
"generate_label_flip_baseline.py"
] | [
"from __future__ import division\nfrom __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals \n\nimport os\nimport sys\nimport argparse\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn import linear_model, preprocessing, cluster\nimport matplotlib... | [
[
"scipy.sparse.issparse",
"numpy.zeros",
"numpy.round",
"numpy.sum",
"scipy.sparse.vstack",
"numpy.mean",
"numpy.where",
"numpy.append"
]
] |
cosmoquester/speech-recognition | [
"c9f137a7fe23548435d7f20d87b60522697218b5"
] | [
"speech_recognition/run/inference.py"
] | [
"import argparse\nimport csv\nimport sys\nfrom functools import partial\n\nimport tensorflow as tf\nimport tensorflow_text as text\nimport yaml\n\nfrom ..configs import DataConfig, get_model_config\nfrom ..data import delta_accelerate, load_audio_file\nfrom ..models import LAS, DeepSpeech2\nfrom ..search import Dee... | [
[
"tensorflow.keras.mixed_precision.experimental.set_policy",
"tensorflow.io.gfile.GFile",
"tensorflow.data.Dataset.from_tensor_slices",
"tensorflow.io.gfile.glob",
"tensorflow.keras.mixed_precision.experimental.Policy",
"tensorflow.keras.Input",
"tensorflow.train.Checkpoint"
]
] |
dungdinhanh/mmselfsup | [
"67fc764f4f5512701f93e8e1fa39e09ee008a54a"
] | [
"mmselfsup/core/crunner/kd_based_runner_readiter.py"
] | [
"# Copyright (c) OpenMMLab. All rights reserved.\nimport os\nimport os.path as osp\nimport platform\nimport shutil\nimport time\nimport warnings\n\nimport torch\n\nimport mmcv\nfrom mmcv.runner.base_runner import BaseRunner\nfrom mmcv.runner.epoch_based_runner import EpochBasedRunner\nfrom mmcv.runner.builder impor... | [
[
"torch.no_grad",
"torch.tensor",
"torch.from_numpy",
"pandas.read_csv"
]
] |
yileic/TensorFlowOnSpark | [
"a431252d6a6d6fd5f1f55dac29e50f2901de57cd"
] | [
"examples/mnist/spark/mnist_dist.py"
] | [
"# Copyright 2018 Yahoo Inc.\n# Licensed under the terms of the Apache 2.0 license.\n# Please see LICENSE file in the project root for terms.\n\n# Distributed MNIST on grid based on TensorFlow MNIST example\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import nested_sco... | [
[
"tensorflow.train.AdagradOptimizer",
"tensorflow.reshape",
"tensorflow.clip_by_value",
"tensorflow.train.MonitoredTrainingSession",
"tensorflow.cast",
"tensorflow.get_default_graph",
"tensorflow.argmax",
"tensorflow.summary.histogram",
"numpy.array",
"tensorflow.zeros",
... |
dlopuch/rat-solar-modelling | [
"bfe1486bd62052bdb982483cd3ec993b20e7db16"
] | [
"src/rat/pvwatts_api.py"
] | [
"import typing as t\nimport os\n\nimport requests\nimport pandas as pd\n\n\ndef assert_pvwatts_ready():\n assert os.environ.get('PVWATTS_API_KEY') is not None, 'Missing PVWATTS_API_KEY envvar! Set it as envvar or into ' \\\n 'os.environ[\"PVWATTS_API_KEY\"... | [
[
"pandas.date_range"
]
] |
beatyou/wechat_jump_game | [
"143c35893ff0f5ddd07348a4b4c55ccd4e8165fd"
] | [
"wechat_jump_py3.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport time\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nfrom PIL import Image\n\nVERSION = \"1.1.4\"\ndef pull_screenshot():\n os.system('adb shell screencap -p /sdcard/autojump.png')\n os.system('adb pull /sdcard/autojum... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.animation.FuncAnimation",
"matplotlib.pyplot.figure"
]
] |
MohanadGad38/Live-human-face-expression-augmentation-by-projection | [
"f8a657cc003988fedf4ff057cd306e1b49fd8ec3"
] | [
"best_one.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"best one.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1be2MmgS_huYhmgc0tKhXGWBddmri8ClC\n\"\"\"\n\nimport keras\nfrom keras.models import Sequential\nfrom keras.layers import Dense\nfrom keras.utils.np_u... | [
[
"numpy.array",
"numpy.savetxt",
"numpy.expand_dims",
"pandas.read_csv",
"numpy.squeeze",
"matplotlib.pyplot.imread",
"matplotlib.pyplot.imshow"
]
] |
milkpku/BetaElephant | [
"0db6140d328355ac0a3c7f9f667ca760f5096711"
] | [
"policy_experiment/policy.orign/dataset.py"
] | [
"#!/usr/bin/python3\n#-*-coding:utf-8-*-\n#$File: dataset.py\n#$Date: Sat May 7 10:59:24 2016\n#$Author: Like Ma <milkpku[at]gmail[dot]com>\n\nimport copy\nimport random\n\nimport numpy as np\n\nOUT_TYPE = np.float32\n\nclass Dataset(object):\n\n def __init__(self, path, _type):\n if _type == 'train':\n ... | [
[
"numpy.zeros",
"numpy.argwhere"
]
] |
LAccordeur/cymo | [
"af23f18714329fac5463ffd434059bd3c008a085"
] | [
"geomesa-test/src/main/python/TypicalQueryWorkloadGenerator.py"
] | [
"import random\r\nimport sys\r\nimport numpy as np\r\nimport math\r\nimport matplotlib.pyplot as plt\r\nimport pandas as pd\r\nimport matplotlib.dates as mdate\r\n\r\nfrom NormalizationUtils import *\r\n\r\ndef generate_workload_by_point_dataset(input_path, output_path, lon_width, lat_width, time_width, sample_rate... | [
[
"numpy.arange",
"numpy.zeros"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.