repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
ALexanderpu/tf229 | [
"eaa1f5c9ed568af850fb7658379226f6d42f1715"
] | [
"tf229/descriminative/softmax_regression.py"
] | [
"\"\"\"Implements stochastic gradient decent on logistic regression as seen in\nStanford 229.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom collections import namedtuple\n\nimport tensorflow as tf\nimport numpy as np\n\ndef train(x, y, **... | [
[
"tensorflow.matmul",
"tensorflow.Graph",
"tensorflow.truncated_normal",
"numpy.random.seed",
"tensorflow.reduce_mean",
"tensorflow.reduce_sum",
"numpy.arange",
"tensorflow.placeholder",
"tensorflow.exp",
"tensorflow.initialize_all_variables",
"tensorflow.train.GradientD... |
Jh-SYSU/MolRep | [
"b2c802d18d41d7db26c19c6dd644098f945e48a1"
] | [
"MolRep/Featurization/utils/graph_utils.py"
] | [
"# -*- coding: utf-8 -*-\n'''\nCreated on 2020.05.19\n\n@author: Jiahua Rao, Weiming Li, Hui Yang, Jiancong Xie\n'''\n\n\nfrom collections import defaultdict\nimport numpy as np\nimport networkx as nx\n\nimport torch\nfrom torch_geometric import data\nfrom torch_geometric.utils import dense_to_sparse\n\nfrom typing... | [
[
"numpy.array",
"numpy.zeros",
"torch.Tensor"
]
] |
ploriaux/Boruta-Shap | [
"3d6be5ae18aa5dbed836dc78d8558dc834d8cc5f"
] | [
"src/BorutaShap.py"
] | [
"from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor, IsolationForest\r\nfrom sklearn.datasets import load_breast_cancer, load_boston\r\nfrom statsmodels.stats.multitest import multipletests\r\nfrom sklearn.model_selection import train_test_split\r\nfrom sklearn.preprocessing import MinMaxSca... | [
[
"sklearn.ensemble.RandomForestRegressor",
"numpy.nanmedian",
"scipy.stats.ks_2samp",
"numpy.take",
"pandas.DataFrame",
"numpy.mean",
"numpy.nanmean",
"sklearn.datasets.load_boston",
"pandas.melt",
"sklearn.ensemble.RandomForestClassifier",
"numpy.arange",
"numpy.ful... |
b1skit/PyTorch-GAN | [
"1bdf9ba3d79434a39cd6b3e9b29d294081d21120"
] | [
"implementation/srgan/processImage.py"
] | [
"\"\"\"\nTest script: Use this to super-sample an image using a trained SRGAN model\n\nNote: This script will fail if network weights cannot be found.\n\"\"\"\n\nimport argparse\nimport os\nimport numpy as np\nimport math\nimport itertools\nimport sys\n\nimport torchvision.transforms as transforms\nfrom torchvision... | [
[
"torch.no_grad",
"torch.cuda.empty_cache",
"torch.cuda.is_available"
]
] |
nghia-vo/Savu | [
"1cf7343c141224643b2e1fb2f05e74448bc4fd58"
] | [
"savu/plugins/loaders/mapping_loaders/i22_loaders/i22_tomo_loader.py"
] | [
"# Copyright 2014 Diamond Light Source Ltd.\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 ... | [
[
"numpy.arange"
]
] |
blurry-mood/g2net | [
"62b9c235960844893a220e3f630adac6cca5f6e8"
] | [
"gnet/model/litmodel.py"
] | [
"import pytorch_lightning as pl\nimport torch\n\nfrom .model import model, Paper\nfrom ..utils import get_logger\nfrom ..preprocessing.preprocesser import Preprocessor\n\nfrom torch import nn\n\nfrom deepblocks.loss import FocalLoss, AUCLoss, AUCMarginLoss\nfrom torchmetrics import AUROC, Accuracy, F1\nfrom transfo... | [
[
"torch.sigmoid",
"torch.softmax"
]
] |
hide-dog/kaggle_titanic | [
"010d8b5621a54e95df9162265b655b91eeee00cf"
] | [
"majority rule/majority_rule.py"
] | [
"import pandas as pd\nimport numpy as np\nimport glob\nimport csv\n\n# ------------------------------------------------\n# main\n# ------------------------------------------------\ndef main():\n ofile = \"majority_rule.csv\"\n \n fff = glob.glob(\"solution*\")\n\n y = np.loadtxt(fff[0], delimiter=',', s... | [
[
"numpy.array",
"pandas.read_csv",
"numpy.loadtxt",
"pandas.DataFrame"
]
] |
CharLee674/rvisa_lightlab | [
"b43e36f3436b60c8c5f3088b4cb0896c5360aa4a"
] | [
"lightlab/util/data/one_dim.py"
] | [
"''' One-dimensional data structures with substantial processing abilities\n'''\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom scipy import signal\nfrom lightlab import logger\nfrom IPython import display\nimport lightlab.util.io as io\n\nfrom .peaks import findPeaks, ResonanceFeature\nfrom .basic impor... | [
[
"numpy.nanmax",
"matplotlib.pyplot.legend",
"numpy.sqrt",
"scipy.signal.correlate",
"matplotlib.pyplot.autoscale",
"numpy.nanmin",
"numpy.all",
"numpy.int",
"numpy.max",
"numpy.mean",
"numpy.argmin",
"numpy.var",
"numpy.allclose",
"numpy.clip",
"numpy.ar... |
Cosmos-Break/OpenNMT-py | [
"8d1b5555da65f7e2ebddb07e4532794fd775b482"
] | [
"onmt/bin/translate.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom __future__ import unicode_literals\n\nfrom onmt.utils.logging import init_logger\nfrom onmt.utils.misc import split_corpus\nfrom onmt.translate.multimodaltranslator import build_translator\nimport numpy as np\nimport onmt.opts as opts\nfrom onmt.utils.parse im... | [
[
"numpy.load"
]
] |
katosh/mizani | [
"c67e3665f71b7961c97fc24e2940ec47e3724693"
] | [
"mizani/tests/test_utils.py"
] | [
"import numpy as np\nimport pandas as pd\nimport pytest\n\n\nfrom mizani.utils import (round_any, min_max, match, precision,\n first_element, multitype_sort,\n same_log10_order_of_magnitude)\n\n\ndef test_round_any():\n x = 4.632\n assert round_any(x, 1) == 5\... | [
[
"numpy.isnan",
"numpy.array",
"pandas.Series"
]
] |
y1a2o6/qedr | [
"a63ecaf2b9538789ca0e761d55608a28d7194c4d"
] | [
"lib/eval/hinton.py"
] | [
"''' \nBased on:\n1) https://github.com/tonysyu/mpltools/blob/master/mpltools/special/hinton.py\n2) http://tonysyu.github.io/mpltools/auto_examples/special/plot_hinton.html\n'''\n\nfrom __future__ import division\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import collections\nfrom matplotl... | [
[
"matplotlib.pyplot.gca",
"numpy.log",
"numpy.abs",
"numpy.clip",
"numpy.asarray",
"numpy.arange",
"matplotlib.transforms.Affine2D",
"numpy.ceil",
"numpy.where"
]
] |
sutoiku/autostat | [
"b0e6588e587450c4cbdb19a021d847f7571ba466"
] | [
"autostat/plots.py"
] | [
"from matplotlib import pyplot as plt\nimport numpy as np\nfrom numpy.typing import NDArray\nimport typing as ty\n\nfrom .auto_gp_model import AutoGpModel\nfrom .dataset_adapters import Dataset\nfrom .decomposition import DecompositionData\n\n\ndef plot_observations(X, Y, ax):\n ax.plot(X.flatten(), Y.flatten(),... | [
[
"matplotlib.pyplot.subplots"
]
] |
osoco/comprendiendo-software-creando-herramientas | [
"64b07b29a876ce180b3ba03dfd1d1770d5fc6f6e"
] | [
"demos/models/suchai-flight-software/sandbox/log_parser.py"
] | [
"import re\nimport argparse\nimport pandas as pd\n\n# General expressions\nre_error = re.compile(r'\\[ERROR\\]\\[(\\d+)\\]\\[(\\w+)\\](.+)')\nre_warning = re.compile(r'\\[WARN \\]\\[(\\d+)\\]\\[(\\w+)\\](.+)')\nre_info = re.compile(r'\\[INFO \\]\\[(\\d+)\\]\\[(\\w+)\\](.+)')\nre_debug = re.compile(r'\\[DEBUG\\]\\[(... | [
[
"pandas.DataFrame"
]
] |
kmr0877/pyq | [
"dcad1f5d52f9b0df4a77f2918af4fdd5c00a5d80"
] | [
"src/pyq/_n.py"
] | [
"\"\"\"A helper module for interfacing with numpy\n\nNumpy has four date units\n\nCode\tMeaning\tTime span (relative)\tTime span (absolute)\nY\tyear\t+/- 9.2e18 years\t[9.2e18 BC, 9.2e18 AD]\nM\tmonth\t+/- 7.6e17 years\t[7.6e17 BC, 7.6e17 AD]\nW\tweek\t+/- 1.7e17 years\t[1.7e17 BC, 1.7e17 AD]\nD\tday\t+/- 2.5e16 ye... | [
[
"numpy.dtype"
]
] |
jamesthomasgriffin/smm | [
"5f1f6432e17f84f7f793d60cb9831ac5c79991e6"
] | [
"smm/lemm/mppca.py"
] | [
"from smm.lemm.linearlyembeddedmm import LinearlyEmbeddedMM\nfrom smm.rvs.normalsimplexrv import NormalSimplexRV\nimport numpy as np\n\n\nclass MPPCA(LinearlyEmbeddedMM):\n \"\"\"\n A class implementing mixtures of PPCA, described in\n\n Michael E. Tipping and Christopher M. Bishop,\n *Mixtures ... | [
[
"numpy.zeros"
]
] |
3e45/minpiler | [
"993bdb38d1e4709a412bb551f7eb213376bfe7d2"
] | [
"minpiler/std/_macro.py"
] | [
"import json\nimport math\nimport textwrap\nfrom collections import defaultdict\nfrom dataclasses import dataclass\nfrom pathlib import Path\nfrom typing import Any, Final\n\nfrom minpiler.m_ast import FrozenBuildContext\nfrom minpiler.std import _tripy\n\n\ndef render_svg(filepath: str, x: None, y: None, size: flo... | [
[
"numpy.abs",
"numpy.random.seed",
"numpy.min",
"numpy.arange",
"numpy.median",
"numpy.max",
"numpy.std",
"numpy.mean",
"numpy.count_nonzero",
"numpy.where"
]
] |
samuelcheang0419/practice-ml-from-scratch | [
"8500044341d3b68633d1639ed3705001d1df6f33"
] | [
"kmeans/kmeans.py"
] | [
"import numpy as np\nimport random\n\nclass KMeans:\n def __init__(self, n_clusters, max_iter, max_convergence_change_cnt, random_seed):\n self.n_clusters = n_clusters\n self.max_iter = max_iter\n self.max_convergence_change_cnt = max_convergence_change_cnt\n self.random_seed = random... | [
[
"numpy.arange",
"numpy.mean",
"numpy.zeros",
"numpy.sum"
]
] |
lijiansong/lang | [
"e255709da2b12e09dea45f86d54f77a19b96f13b"
] | [
"python/sklearn/linear-regression/workload-analysis/classify/online/roofline/roofline.py"
] | [
"#!/usr/bin/env python3\n\nfrom collections import OrderedDict\nimport matplotlib\nimport matplotlib.pyplot as plt\n\nimport seaborn as sns;\n\ndef get_data(data_file_path):\n data_file_reader = open(data_file_path, 'r')\n data_list = []\n try:\n text_lines = data_file_reader.readlines()\n fo... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplots"
]
] |
Jingkustc/Doc2EDAG | [
"9d3d2026265cead9247fecebcaaf79b084035a36"
] | [
"dee/dee_helper.py"
] | [
"# -*- coding: utf-8 -*-\n# AUTHOR: Shun Zheng\n# DATE: 19-9-19\n\nimport logging\nimport os\nimport re\nfrom collections import defaultdict, Counter\nimport numpy as np\nimport torch\n\nfrom .dee_metric import measure_event_table_filling\nfrom .event_type import event_type2event_class, BaseEvent, event_type_fields... | [
[
"numpy.mean",
"torch.tensor"
]
] |
shalei120/OxLegalReasoning | [
"009bc8249d45d61a3d9f52146e447535005e79d2"
] | [
"LSTM_capIB.py"
] | [
"import torch\nimport torch.autograd as autograd\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom torch.nn.parameter import Parameter\n\nimport numpy as np\n\nimport datetime\nimport math\n\nfrom Encoder import Encoder\nfrom Decoder impo... | [
[
"torch.nn.Softmax",
"torch.nn.functional.softmax",
"torch.sign",
"torch.sum",
"torch.nn.Embedding",
"torch.nn.CrossEntropyLoss",
"torch.norm",
"torch.einsum",
"torch.nn.Sigmoid",
"torch.rand",
"torch.nn.NLLLoss",
"torch.zeros_like",
"torch.exp",
"torch.nn.Li... |
luiszeni/Boosted-OICR | [
"9c787808a3a0e5a2610cde7562eb04bc2ce050b9"
] | [
"code/layers/losses/oicr_losses.py"
] | [
"import torch\nimport torch.nn as nn\nfrom pdb import set_trace as pause \n\nclass OICRLosses(nn.Module):\n\n def forward(self, pcl_probs, labels, cls_loss_weights, gt_assignment, im_labels):\n\n\n eps = 1e-6\n pcl_probs = pcl_probs.clamp(eps, 1-eps).log()\n\n \n cls_loss_weights = cl... | [
[
"torch.arange"
]
] |
myedibleenso/this-before-that | [
"ddf609ac34e852aee205823928f26d7faa55b5c7"
] | [
"lstm/pitchfork_lstm.py"
] | [
"from gensim.models.word2vec import Word2Vec # make use of pretrained embeddings\nfrom sklearn.cross_validation import StratifiedKFold\nimport theano\nfrom keras.preprocessing import sequence\nfrom keras.preprocessing.text import one_hot, base_filter, Tokenizer\nfrom keras.utils import np_utils # for converting lab... | [
[
"sklearn.cross_validation.StratifiedKFold",
"numpy.random.seed",
"pandas.DataFrame",
"pandas.read_json",
"numpy.zeros"
]
] |
dhaase-de/dito | [
"c804d40fcf068a04b98737d9f39a639b2a6a0727"
] | [
"dito/draw.py"
] | [
"import cv2\nimport numpy as np\n\nimport dito.core\n\n\n# often-used constants\nsqrt_05 = np.sqrt(0.5)\n\n\ndef draw_circle(image, center, radius, color, thickness, line_type, start_angle=None, end_angle=None):\n \"\"\"\n TODO: fix round corners when using start_angle/end_angle and thickness != cv2.FILLED\n ... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.cos",
"numpy.sin",
"numpy.array"
]
] |
wufan-tb/improved-LabelImg | [
"e8c08bdaf6a7cba307bad6b84c246e9bd75ab9bf"
] | [
"keras_retinanet/utils/gpu.py"
] | [
"\"\"\"\nCopyright 2017-2019 Fizyr (https://fizyr.com)\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.0\n\nUnless required by applicable la... | [
[
"tensorflow.config.experimental.list_logical_devices",
"tensorflow.config.experimental.set_memory_growth",
"tensorflow.config.experimental.list_physical_devices",
"tensorflow.ConfigProto",
"tensorflow.Session",
"tensorflow.config.experimental.set_visible_devices"
]
] |
rakschahsa/networkx | [
"3f1fdcb7693ff152f17623ce549526ec272698b1"
] | [
"networkx/algorithms/centrality/katz.py"
] | [
"# coding=utf8\n# Copyright (C) 2004-2018 by\n# Aric Hagberg <hagberg@lanl.gov>\n# Dan Schult <dschult@colgate.edu>\n# Pieter Swart <swart@lanl.gov>\n# All rights reserved.\n# BSD license.\n#\n# Authors: Aric Hagberg (aric.hagberg@gmail.com)\n# Pieter Swart (swart@lanl.gov)\n# Sa... | [
[
"numpy.eye",
"numpy.linalg.norm"
]
] |
gugarosa/synthetic_rbms | [
"a86c323e165a893810ac5bf79213f603ed86a8b3"
] | [
"libraries/nalp/nalp/models/generators/lstm.py"
] | [
"from tensorflow.keras.layers import RNN, Dense, Embedding, LSTMCell\n\nimport nalp.utils.logging as l\nfrom nalp.core.model import Generator\n\nlogger = l.get_logger(__name__)\n\n\nclass LSTMGenerator(Generator):\n \"\"\"A LSTMGenerator class is the one in charge of Long Short-Term Memory implementation.\n\n ... | [
[
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.LSTMCell",
"tensorflow.keras.layers.RNN",
"tensorflow.keras.layers.Embedding"
]
] |
mohakbhardwaj/differentiable-robot-model | [
"be5bd816cc81931ed2b7133bcd4fde7c92b2abd7"
] | [
"differentiable_robot_model/rigid_body/differentiable_rigid_body.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates.\n\nimport torch\nfrom differentiable_robot_model.rigid_body import utils\nfrom differentiable_robot_model.rigid_body.coordinate_transform import (\n CoordinateTransform,\n z_rot,\n y_rot,\n x_rot,\n)\n\nimport hydra\n\n\nclass DifferentiableRigidBody(t... | [
[
"torch.reshape",
"torch.nn.Parameter",
"torch.rand_like",
"torch.zeros"
]
] |
abhishekkulkarni24/Machine-Learning | [
"8bf49a5c9c669ce078250f164376606546c9e81f"
] | [
"Numpy/vector_ranging_10_to_49.py"
] | [
"#Create a vector with values ranging from 10 to 49\n\n\nimport numpy as np\n\nvector = np.arange(10,50);\nprint(vector)\n\n'''\nOutput\n\n[10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33\n 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49]\n\n'''"
] | [
[
"numpy.arange"
]
] |
ianlevesque/ThreatExchange | [
"d00ca28b200eb2b9ade9db5299c083f1968c5a41"
] | [
"pytx3/benchmarks/benchmark_pdq_faiss_matchers.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\n\nimport argparse\nimport binascii\nimport os\nimport time\nimport pickle\n\nimport numpy\nimport faiss\n\nfrom pytx3.hashing import (\n PDQFlatHashIndex,\n PDQMultiHashIndex,\n BITS_IN_PDQ,\n)\n\nparser = argparse.ArgumentParser(\n ... | [
[
"numpy.bitwise_xor",
"numpy.pad",
"numpy.random.default_rng",
"numpy.ones"
]
] |
dmgav/test_doc | [
"2e3b8faf55364c5b3f7e2897b8d6bfe61f5b4664"
] | [
"pyxrf/model/setting.py"
] | [
"from __future__ import (absolute_import, division,\n print_function)\n\nimport numpy as np\nfrom collections import OrderedDict\nimport copy\nimport os\nimport re\n\nfrom atom.api import (Atom, Str, observe, Dict, List, Int, Bool)\n\nfrom skbeam.fluorescence import XrfElement as Element\nfro... | [
[
"numpy.log",
"numpy.sqrt",
"numpy.asarray",
"numpy.copy",
"numpy.array",
"numpy.sum"
]
] |
AustinXY/super-res-stylegan2 | [
"b1dbfcd0a20ae2917240aeb0562dc242b2671587"
] | [
"train1.py"
] | [
"import argparse\nimport math\nimport random\nimport os\nimport copy\n\nos.environ[\"CUDA_VISIBLE_DEVICES\"]=\"0\"\n\nfrom numpy.core.fromnumeric import resize\nimport dnnlib\n\nimport numpy as np\nimport torch\nfrom torch import nn, autograd, optim\nfrom torch.nn import functional as F\nfrom torch.utils import dat... | [
[
"torch.randn_like",
"torch.transpose",
"torch.zeros",
"torch.load",
"torch.no_grad",
"torch.nn.functional.interpolate",
"numpy.random.randint",
"torch.distributed.init_process_group",
"torch.utils.data.distributed.DistributedSampler",
"torch.randn",
"torch.nn.functional... |
NaturalSolutions/NS.Bootstrap | [
"c2cc73717dbe769e064c3254a5b20cb16b37bda2"
] | [
"Back/ecoreleve_server/Views/station.py"
] | [
"from pyramid.view import view_config\nfrom ..Models import (\n DBSession,\n Station,\n StationType,\n Observation\n )\nfrom ecoreleve_server.GenericObjets.FrontModules import (FrontModule,ModuleField)\nfrom ecoreleve_server.GenericObjets import ListObjectWithDynProp\nimport transaction\nimport json\... | [
[
"numpy.round",
"pandas.merge",
"pandas.DataFrame"
]
] |
Zed-Wu/ManiSkill-Learn | [
"8056fe327752cd0863f8730672fe62bd85a0ec12"
] | [
"mani_skill_learn/utils/data/converter.py"
] | [
"import numpy as np\nfrom collections.abc import Sequence, Iterable\nfrom numbers import Number\nfrom .type import str_to_dtype, is_arr, is_dict, is_seq_of, is_type, scalar_type, is_str\n\n\ndef astype(x, dtype):\n if dtype is None:\n return x\n assert is_arr(x) and is_str(dtype), (type(x), type(dtype)... | [
[
"numpy.string_",
"numpy.abs",
"torch.from_numpy",
"numpy.isscalar",
"numpy.array",
"numpy.isreal"
]
] |
Dj1312/EMpy | [
"4bf1b01acc683c2a5ffc8679fdd4a9790aacfed0",
"4bf1b01acc683c2a5ffc8679fdd4a9790aacfed0"
] | [
"examples/ex_SRR.py",
"EMpy/modesolvers/FD.py"
] | [
"\"\"\"Single ring resonator example.\"\"\"\n\nimport EMpy\nimport numpy\nimport pylab\n\nwls = numpy.linspace(1.53e-6, 1.56e-6, 1000)\nK1 = EMpy.devices.Coupler(wls, numpy.sqrt(0.08), 1.)\nK2 = EMpy.devices.Coupler(wls, numpy.sqrt(0.08), 1.)\nl1 = numpy.pi * 5e-6\nl2 = numpy.pi * 5e-6\nSWG = EMpy.devices.SWG(488, ... | [
[
"numpy.absolute",
"numpy.sqrt",
"numpy.linspace"
],
[
"scipy.sparse.linalg.eigen.eigs",
"numpy.dot",
"scipy.sparse.coo_matrix",
"numpy.polyfit",
"numpy.abs",
"numpy.linspace",
"numpy.conj",
"numpy.arange",
"numpy.ones",
"scipy.sqrt",
"numpy.diff",
"n... |
GouldGroup/MFBERT | [
"743587b1ea76b00f4adf46d616fc1e28dd001749"
] | [
"fine_tune_freesolv.py"
] | [
"import os\nos.environ['CUDA_VISIBLE_DEVICES']='0'\n\nimport pandas as pd\nimport torch\nfrom transformers import RobertaForMaskedLM\nfrom torch.utils.data import Dataset, DataLoader\nimport pickle\nfrom tqdm import tqdm\nfrom Tokenizer.MFBERT_Tokenizer import MFBERTTokenizer\nimport numpy as np\n\nassert torch.cud... | [
[
"torch.mean",
"torch.nn.Dropout",
"torch.utils.data.DataLoader",
"torch.tensor",
"torch.nn.Linear",
"torch.cuda.device_count",
"torch.nn.MSELoss",
"torch.save"
]
] |
abhinine4/ivy | [
"79f8037cb0e0815d21cf46a906e66a45b2f27688"
] | [
"ivy/functional/backends/torch/old/general.py"
] | [
"\"\"\"\nCollection of PyTorch general functions, wrapped to fit Ivy syntax and signature.\n\"\"\"\n\n# global\nimport ivy\nimport numpy as np\ntorch_scatter = None\nimport math as _math\nimport torch as torch\nfrom operator import mul\nfrom torch.types import Number\nfrom functools import reduce as _reduce\nfrom t... | [
[
"torch.jit.script",
"torch.abs",
"torch.transpose",
"torch.jit.trace",
"torch.max",
"torch.cat",
"torch.min",
"torch.reshape",
"torch.tensor",
"torch.stack",
"torch.clamp",
"torch.meshgrid",
"torch.squeeze",
"torch.cross"
]
] |
benlansdell/obs-rl-i2a | [
"47e274a371c3d0eec418b85dc4ed732e36885c53"
] | [
"o2a/i2a.py"
] | [
"import os\nimport gym\nimport time\nimport logging\nimport numpy as np\nimport tensorflow as tf\nfrom common.multiprocessing_env import SubprocVecEnv\nfrom tqdm import tqdm\n\nfrom env_model_minigrid import create_env_model\nfrom a2c import get_actor_critic, CnnPolicy\nfrom common.minigrid_util import num_pixels, ... | [
[
"tensorflow.nn.softmax_cross_entropy_with_logits",
"tensorflow.nn.dynamic_rnn",
"tensorflow.concat",
"tensorflow.contrib.rnn.GRUCell",
"numpy.max",
"numpy.exp",
"tensorflow.get_collection",
"tensorflow.layers.dense",
"numpy.argmax",
"tensorflow.train.Saver",
"numpy.zero... |
jcgeo9/ML-For-Fish-Recognition | [
"0b5faba77d0b2c5452950637f047882c80fa6fb7"
] | [
"Python-Files/model_conversion/convert_to_tflite.py"
] | [
"# =============================================================================\n# Created By : Giannis Kostas Georgiou\n# Project : Machine Learning for Fish Recognition (Individual Project)\n# =============================================================================\n# Description : File in order to con... | [
[
"tensorflow.lite.TFLiteConverter.from_saved_model"
]
] |
dhimanray/WEMRR | [
"aab019f1d1bb4d6db6dea36f9444167591129322"
] | [
"examples/NAMD/template_milestone/westpa_scripts/convert_first_milestone.py"
] | [
"#THIS CODE IS ONLY FOR FIRST MILSTONE. build.py WILL REPLACE convert.py WITH THIS FILE FOR FIRST MILESTONE\n\nimport numpy as np\n\nendpoint = ENDPOINT\n\nl = np.loadtxt('parent.dat')\n\nr = l[len(l)-1]\n\n#print(\"{:.2f}\".format(r)) #needed for OpenMM (does not include zero frame by default)\n\nl = []\n\nl = np.... | [
[
"numpy.loadtxt"
]
] |
marisuki/LearnCRR | [
"0eb4c26be7b4e9d816f275ef45b848c99a489c57"
] | [
"core/sklearn_cnd.py"
] | [
"from sklearn.linear_model import BayesianRidge\nfrom sklearn.linear_model import LinearRegression\n\nimport numpy as np\nfrom copy import copy\nimport random\nfrom sklearn.metrics import mean_squared_error\nmse = mean_squared_error\n\n\n#@DeprecationWarning(\"not_essay\")\ndef train_baye(X_train, y_train):\n re... | [
[
"numpy.vander",
"sklearn.linear_model.LinearRegression",
"sklearn.linear_model.BayesianRidge",
"numpy.var",
"numpy.array"
]
] |
doc-E-brown/embc_2020 | [
"ddf1f8f684b34e491b04787a0300bc7995ba336d"
] | [
"src/models/train_model.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n\n.. currentmodule:: \n\n\"\"\"\n__author__ = 'Ben Johnston'\n\nimport tensorflow as tf\n\nfrom src.models.model1 import * \nfrom src.data.muct import load_tensors\nfrom src.data import augment_data \n\nfrom src.models.losses import dice_loss\n\nimport numpy... | [
[
"tensorflow.keras.callbacks.ModelCheckpoint",
"tensorflow.keras.callbacks.EarlyStopping",
"tensorflow.keras.callbacks.TerminateOnNaN",
"tensorflow.keras.callbacks.ReduceLROnPlateau"
]
] |
vladbataev/nv-wavenet | [
"2e16155cef2a460bb7862df674a1b8fa074a5cab"
] | [
"pytorch/mel2samp_onehot.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# * Red... | [
[
"tensorflow.enable_eager_execution",
"numpy.pad",
"numpy.abs",
"numpy.clip",
"tensorflow.ConfigProto",
"numpy.ceil",
"torch.FloatTensor",
"numpy.load"
]
] |
IvanBongiorni/RNN-GAN_Timeseries-imputation | [
"4af0a7077d145f7726e42c4df623dfb0cd227d1c"
] | [
"model.py"
] | [
"\"\"\"\nAuthor: Ivan Bongiorni, https://github.com/IvanBongiorni\n2020-03-19\n\nModels implementation.\n\"\"\"\nimport tensorflow as tf\n\n\ndef build_vanilla_seq2seq(params):\n \"\"\"\n Implements a seq2seq RNN with Convolutional self attention. It keeps a canonical\n Encoder-Decoder structure: an Em... | [
[
"tensorflow.keras.layers.Concatenate",
"tensorflow.keras.models.Model",
"tensorflow.keras.layers.Dense",
"tensorflow.keras.layers.Conv1D",
"tensorflow.keras.layers.RepeatVector",
"tensorflow.keras.layers.LSTM",
"tensorflow.keras.layers.BatchNormalization",
"tensorflow.keras.layers.... |
doutriaux1/ocgis | [
"989573258e6fcbeeb8b92d66bf5f6a43a34c2662"
] | [
"src/ocgis/test/fragments/hostetler/test_hostetler.py"
] | [
"import unittest\nimport os.path\nimport netCDF4 as nc\nfrom ocg.meta.interface.interface import GlobalInterface\nfrom ocg.api.interp.iocg.dataset import OcgDataset\nfrom ocg.conv.csv_ import CsvConverter\nimport numpy as np\nfrom ocg.conv.shp import ShpConverter\nfrom ocg.conv.shpidx import ShpIdxConverter\nfrom o... | [
[
"numpy.array"
]
] |
HelenR6/imagenet-r | [
"3131cacee97c407bd2ecea15846a67817a64f924"
] | [
"utils.py"
] | [
"import numpy as np\nimport sklearn.metrics as sk\nimport sklearn.neighbors\nimport sklearn.ensemble\nimport time\n\nrecall_level_default = 0.95\n\n\n\ndef calib_err(confidence, correct, p='2', beta=100):\n # beta is target bin size\n idxs = np.argsort(confidence)\n confidence = confidence[idxs]\n corre... | [
[
"sklearn.metrics.roc_auc_score",
"numpy.sqrt",
"numpy.asarray",
"numpy.cumsum",
"numpy.mean",
"torch.FloatTensor",
"numpy.nanmean",
"numpy.square",
"numpy.allclose",
"numpy.unique",
"numpy.std",
"numpy.diff",
"numpy.logical_not",
"torch.LongTensor",
"num... |
hedibejaoui/spark-timeseries | [
"9112dcbbba4e095b5eb46c568e1c72e13e1f251a"
] | [
"python3/sparkts/test/test_datetimeindex.py"
] | [
"from .test_utils import PySparkTestCase\nfrom sparkts.datetimeindex import *\nimport pandas as pd\n\nclass DateTimeIndexTestCase(PySparkTestCase):\n def test_frequencies(self):\n bd = BusinessDayFrequency(1, 1, self.sc)\n self.assertEqual(bd.days(), 1)\n \n hf = HourFrequency(4, self... | [
[
"pandas.to_datetime",
"pandas.date_range"
]
] |
yingxinff-source/DeepRecSys | [
"bf781e112492563631e89fb1fba3431601f1331c"
] | [
"deep_recommend/other/attention/attention.py"
] | [
"'''\n@Description: \n@version: \n@License: MIT\n@Author: Wang Yao\n@Date: 2020-04-02 14:19:14\n@LastEditors: Wang Yao\n@LastEditTime: 2020-04-02 14:20:01\n'''\nimport tensorflow as tf\nimport tensorflow.keras.backend as K\nfrom tensorflow.keras.layers import Layer\n\n\nclass Attention(Layer):\n\n def __init__(s... | [
[
"tensorflow.keras.backend.dot",
"tensorflow.keras.backend.softmax"
]
] |
wanglikuan/PFL-Non-IID-baselines | [
"0d73765847cfcbd94ad065ce51957b11c215d657"
] | [
"generate_niid_class.py"
] | [
"from tqdm import trange\nimport numpy as np\nimport random\nimport json\nimport os\nimport argparse\nfrom torchvision.datasets import CIFAR10\nimport torch\nfrom torch.utils.data import DataLoader\nimport torchvision.transforms as transforms\n# from data.Mnist.multi_mnist_loader import MNIST\n\nrandom.seed(42)\nnp... | [
[
"numpy.random.seed",
"numpy.random.choice",
"numpy.unique",
"torch.utils.data.DataLoader",
"numpy.random.shuffle",
"torch.tensor",
"numpy.ones",
"torch.save"
]
] |
HaoranLv/Shelf-product-identification | [
"7302e6d535843dc7f9c1de81422ad3e68bb5e5c8"
] | [
"object_detector_retinanet/keras_retinanet/utils/transform.py"
] | [
"import numpy as np\n\nDEFAULT_PRNG = np.random\n\n\ndef colvec(*args):\n \"\"\" Create a numpy array representing a column vector. \"\"\"\n return np.array([args]).T\n\n\ndef transform_aabb(transform, aabb):\n \"\"\" Apply a transformation to an axis aligned bounding box.\n\n The result is a new AABB i... | [
[
"numpy.array",
"numpy.cos",
"numpy.random.RandomState",
"numpy.sin"
]
] |
ProfLeao/RMG-Py | [
"47c4e0b16ee274919ec24aa4160ac5e83cc9f0a9"
] | [
"rmgpy/solver/surfaceTest.py"
] | [
"#!/usr/bin/env python3\n\n###############################################################################\n# #\n# RMG - Reaction Mechanism Generator #\n# ... | [
[
"numpy.logspace",
"numpy.array",
"numpy.sum",
"numpy.allclose"
]
] |
greatofdream/pmtTest | [
"d8f1fc8e94c3999516b6eef01e228311e6135053"
] | [
"waveana/triggerana.py"
] | [
"import numpy as np\nfrom .waveana import Waveana, interpolate\n'''\nuse trigger channel to extract information from other numpy waveforms\n'''\nclass Triggerana(Waveana):\n def __init__(self, wave=[], eid=0) -> None:\n super().__init__(wave, eid)\n def setTriggerWave(self, triggerWave, uprising=True):... | [
[
"numpy.average"
]
] |
KevinVolkSTScI/wfss_overlap | [
"6648ec520587c5d7a52f0241e08c7d129bab8223"
] | [
"fits_image_display.py"
] | [
"#! /usr/bin/env python\n#\n\"\"\"\nThis code uses matplotlib and numpy to produce a window within which a FITS\nimage can be displayed. The reason for having this and not using the usual\npackages already in existence is that I will want specific functions on the\nimage for data reduction.\n\nUsage:\n\nfits_image... | [
[
"numpy.poly1d",
"numpy.asarray",
"numpy.squeeze",
"matplotlib.pyplot.plot",
"numpy.max",
"numpy.mean",
"numpy.argmin",
"numpy.arange",
"numpy.copy",
"matplotlib.pyplot.subplot",
"numpy.argmax",
"numpy.zeros",
"matplotlib.pyplot.figure",
"numpy.min",
"num... |
climate-and-health-datasci-Unicamp/permapy | [
"23be83f0a8c31fe79611dc63bcaef5b0efebf5ad"
] | [
"utils/utils.py"
] | [
"import os\nimport numpy as np\n\nclass Utils:\n def __init__(self):\n pass\n \n def retrieve_data_from_np_array(self,path):\n \"\"\" Read a numpy array\"\"\"\n with open(path, 'rb') as f:\n np_array = np.load(f)\n return np_array\n\n def create_folder_structur... | [
[
"numpy.load",
"numpy.save"
]
] |
FilatovArtm/RAdam-Tensorflow | [
"29328c3ddf07b62585c29fb1bc1b8ebf33a71c8b"
] | [
"RAdam.py"
] | [
"import tensorflow as tf\nfrom tensorflow.python.eager import context\nfrom tensorflow.python.framework import ops\nfrom tensorflow.python.ops import control_flow_ops\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import resource_variable_ops\nfrom tensorflow.python.ops import state_ops\nfr... | [
[
"tensorflow.cond",
"tensorflow.python.ops.control_flow_ops.group",
"tensorflow.python.ops.math_ops.square",
"tensorflow.python.framework.ops.init_scope",
"tensorflow.python.framework.ops.colocate_with",
"tensorflow.python.ops.resource_variable_ops.resource_scatter_add",
"tensorflow.pyt... |
deekshaarya4/gymexperiments | [
"2d503ba14fcfba41339de25dd78d649bd12693e6"
] | [
"irmodel.py"
] | [
"import numpy as np\nfrom sklearn.linear_model import LinearRegression, LogisticRegression\n\nclass TimeBuffer:\n def __init__(self, max_timesteps, max_episodes, observation_shape, action_shape):\n self.max_timesteps = max_timesteps\n self.max_episodes = max_episodes\n self.observation_shape = observation... | [
[
"numpy.random.choice",
"numpy.random.multivariate_normal",
"numpy.stack",
"numpy.ones",
"numpy.all",
"numpy.concatenate",
"numpy.cov",
"sklearn.linear_model.LinearRegression",
"numpy.array",
"numpy.zeros",
"numpy.empty"
]
] |
Granero0011/lambdata | [
"c31afa997f825997ecc70a57f46805122a42fd5e"
] | [
"lambdata_granero0011/__init__.py"
] | [
"#!/usr/bin/env python\n\"\"\"\n\nlambdata- a collection of Data Science helper functions\n\"\"\"\n\nimport pandas as pd\nimport numpy as np\nfrom . import example_module\n\nY= example_module.increment(example_module.x)\nTEST = pd.DataFrame(np.ones(10))\n\n"
] | [
[
"numpy.ones"
]
] |
sallysyw/ClassyVision | [
"b6202d6323431203997039a6768762811cb7215f"
] | [
"classy_vision/models/classy_model.py"
] | [
"#!/usr/bin/env python3\n# 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 copy\nimport types\nfrom enum import Enum\nfrom typing import Any, Dict, List, Optional, Tuple\n\nimp... | [
[
"torch.nn.ModuleDict"
]
] |
awacha/credolib | [
"11c0be3eea7257d3d6e13697d3e76ce538f2f1b2"
] | [
"credolib/plotting.py"
] | [
"__all__=['plotsascurve','guinierplot','kratkyplot']\nfrom .io import getsascurve\nimport matplotlib.pyplot as plt\nfrom sastool.libconfig import qunit, dunit\n\ndef plotsascurve(samplename, *args, **kwargs):\n if 'dist' not in kwargs:\n kwargs['dist'] = None\n data1d, dist = getsascurve(samplename, kw... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.errorbar",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.ylabel"
]
] |
ankitaduttagupta/ga-learner-dsmp-repo | [
"8e1bed56ba8c86964857fa52396c8ecd60976888"
] | [
"NLP/code.py"
] | [
"# --------------\n# import packages\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\n\nimport seaborn as sns\nimport re\nfrom nltk.corpus import stopwords\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.feature_extraction.text import CountVectorizer, TfidfVectorizer\nf... | [
[
"pandas.read_csv",
"sklearn.linear_model.LogisticRegression",
"sklearn.naive_bayes.MultinomialNB",
"sklearn.model_selection.train_test_split",
"sklearn.feature_extraction.text.CountVectorizer",
"sklearn.feature_extraction.text.TfidfVectorizer"
]
] |
vivekbarsagadey/medicom-services | [
"319321aff3f38e68765291cf5e0b84252a3414b5"
] | [
"src/com/medicom/health/diabetes/domain/user.py"
] | [
"import json\n\nimport pandas as pd\n\nfrom com.medicom.health.diabetes.services.db_handler import DBHandler\n\n\nclass User:\n def __init__(self ,org={}):\n self.firstName = org['firstName']\n self.lastName = org['lastName']\n self.pregnancy = org['pregnancy']\n self.glucose = org['g... | [
[
"pandas.DataFrame"
]
] |
mustafabozkaya/Advanced-Deep-Learning-with-Keras | [
"81b9da2fb7d18e9bf08a0716fa1e7627045002e8"
] | [
"chapter1-keras-quick-tour/plot-linear-1.1.1.py"
] | [
"'''Utility for plotting a linear function\nwith and without noise\n'''\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nwant_noise = True\n# grayscale plot, comment if color is wanted\nplt.figure(figureSize=(18,9))\nplt.style.use('grayscale')\n\n# generate data bet -1,1 interval of 0.2\nx = np.arange(-1,1... | [
[
"matplotlib.pyplot.legend",
"numpy.arange",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.plot",
"numpy.random.uniform",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.close",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.show",
"matplotlib.... |
Vrroom/pacPlanning | [
"cd149af0332c626521dabe95c3d2cfc706737272"
] | [
"LUCB.py"
] | [
"from constants import *\nimport math\nimport numpy as np\nimport sys\nimport time\nfrom util import bestTwoActions\n\nverbose = 0\n\ndef LUCBStopping(mdp, start_state=0, epsilon=4, delta=0.1, fileprint=1):\n\tglobal MAX_ITERATION_LIMIT, c\n\titeration = 0\n\tit=0\n\tinitial_iterations = 1*mdp.numStates*mdp.numActi... | [
[
"numpy.amax",
"numpy.linalg.norm",
"numpy.ones",
"numpy.copy",
"numpy.savetxt",
"numpy.zeros",
"numpy.sum"
]
] |
quachconghoang/SemanticFusion | [
"68dc24c732c0ea9754038eda4d3f1c0396d22844"
] | [
"GTSAM/keyframe_factor.py"
] | [
"import os.path\nfrom os import path\nimport glob\nimport numpy as np\nimport open3d as o3d\nfrom functools import partial\nimport cv2 as cv\nimport sys, copy\nsys.path.append('../')\n\nfrom SlamUtils.transformation import pos_quats2SEs, pos_quats2SE_matrices, pose2motion, SEs2ses, line2mat, tartan2kitti\nfrom Slam... | [
[
"numpy.load"
]
] |
duongntbk/FashionMNIST | [
"982f31ac7d857b5deadfde37f979bc6a047fa007"
] | [
"graph_utils.py"
] | [
"# -*- coding: utf-8 -*-\n\n'''\nMiscellaneous methods to draw graphs and images.\n'''\n\nimport pickle\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.axes._subplots import SubplotBase\n\ndef set_graph_layout(nrows, ncols, figsize):\n '''\n Set the size and layout of graph.\n '''\n... | [
[
"numpy.array",
"matplotlib.pyplot.show",
"matplotlib.pyplot.imshow",
"matplotlib.pyplot.subplots"
]
] |
17IT089/Music-Recommendation-System | [
"880f1f9289ec8e1b930cbd6c795b65b9b006fb17"
] | [
"music_recommendation.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Music Recommendation.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1RW9ABbhb1cBSQEbBdIPdE6wtG1roLF30\n\"\"\"\n\nimport pandas as pd\n\nfrom google.colab import drive\ndrive.mount('/content/drive')\n\npath... | [
[
"pandas.read_csv"
]
] |
krzysztofoporowski/Ichimoku_trading | [
"0fd5031d03c413925b69131022b0e0aeaa1e556e"
] | [
"ichimoku_trading.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Jul 10 19:48:17 2019\n\n@author: krzysztof.oporowski\n\"\"\"\n\nfrom datetime import timedelta, datetime\nimport warnings\nimport pandas as pd\nfrom talib import ATR\nfrom simtradesim import Budget, Transaction, define_gl\nfrom wsedatareader import get_date_only, get... | [
[
"pandas.concat",
"pandas.DataFrame"
]
] |
IT-gMA/tabular-dl | [
"d0fb7086fa8851370e35ebfaf4c119181f037f10"
] | [
"bin/read_npydata.py"
] | [
"import numpy as np\nimport sys\n\nFILE_PATH = '../data/california_housing/idx_test.npy'\nnp.set_printoptions(threshold=sys.maxsize)\ndata = np.load(FILE_PATH)\nprint(data)\nprint(data.shape)"
] | [
[
"numpy.load",
"numpy.set_printoptions"
]
] |
Bruce-Dudu/zvt | [
"a261a2b688b2c75b7b637b85eabaffdc27fbd80f"
] | [
"zvt/__init__.py"
] | [
"# -*- coding: utf-8 -*-\nimport enum\nimport json\nimport logging\nimport os\nfrom logging.handlers import RotatingFileHandler\n\nimport pandas as pd\nfrom pkg_resources import get_distribution, DistributionNotFound\n\nfrom zvt.settings import DATA_SAMPLE_ZIP_PATH, ZVT_TEST_HOME, ZVT_HOME, ZVT_TEST_DATA_PATH, ZVT_... | [
[
"pandas.set_option"
]
] |
singhalok641/Machine-Learning-Engineer-Nanodegree | [
"d0ae8bddb85f2d62d4d35e2f2fb80100f055e19c"
] | [
"SentimentAnalysisIMDB/train/train.py"
] | [
"import argparse\nimport json\nimport os\nimport pickle\nimport sys\nimport sagemaker_containers\nimport pandas as pd\nimport torch\nimport torch.optim as optim\nimport torch.utils.data\n\nfrom model import LSTMClassifier\n\ndef model_fn(model_dir):\n \"\"\"Load the PyTorch model from the `model_dir` directory.\... | [
[
"torch.load",
"torch.manual_seed",
"torch.utils.data.TensorDataset",
"torch.utils.data.DataLoader",
"torch.from_numpy",
"torch.nn.BCELoss",
"torch.cuda.is_available",
"torch.save"
]
] |
sscardapane/jax | [
"21e5eb13dd879f92b6ff94e18bf33a24ed8cc2a7"
] | [
"tests/linalg_test.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.swapaxes",
"numpy.abs",
"numpy.einsum",
"numpy.linalg.inv",
"numpy.eye",
"numpy.matmul",
"numpy.linalg.norm",
"numpy.finfo",
"numpy.linalg.qr",
"numpy.ndindex",
"numpy.zeros",
"numpy.divide"
]
] |
MarekWadinger/semestral_project | [
"62ff869e8315426ce0af8be044bcd94d911e3028"
] | [
"src/anomaly.py"
] | [
"import pandas as pd\nimport time\n\nfrom pyod.models.iforest import IForest\nfrom matplotlib import pyplot as plt\nfrom sklearn.preprocessing import MinMaxScaler\n\n\ndef get_sampling_frequency(s, ratio):\n \"\"\"Get sampling frequency of time-series data.\n\n Function that returns the sampling frequency of ... | [
[
"matplotlib.pyplot.figure",
"pandas.DataFrame",
"sklearn.preprocessing.MinMaxScaler"
]
] |
n778509775/NWCQ | [
"72851d26f470465e9e13b219a12d52daa5e1ceed"
] | [
"MI/crossValidation-complex.py"
] | [
"import numpy as np\nimport pandas as pd\nimport random\nimport math\nimport operator\nimport matplotlib.pyplot as plt\nfrom sklearn.metrics import roc_auc_score\nimport argparse\n#from collections import Counter\n\nimport torch\nimport torch.utils.data\nfrom torch.autograd import Variable\nimport torch.nn.function... | [
[
"torch.nn.CrossEntropyLoss",
"pandas.read_csv",
"torch.LongTensor",
"torch.eq",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.subplots",
"torch.from_numpy",
"numpy.mean",
"torch.FloatTensor",
"matplotlib.pyplot.close",
"numpy.array",
"torch.squeeze"
]
] |
Vedantsahai18/k-yantra | [
"e515bcec21455d1882f64a21906795766b5d8b16"
] | [
"app.py"
] | [
"import os\nimport sys\nimport json\n\n# Flask\nfrom flask import Flask, redirect, url_for, request, render_template, Response, jsonify, redirect\nfrom werkzeug.utils import secure_filename\nfrom gevent.pywsgi import WSGIServer\n\n# TensorFlow and tf.keras\nimport tensorflow as tf\nfrom tensorflow import keras\nimp... | [
[
"tensorflow.keras.models.load_model",
"numpy.expand_dims",
"numpy.argmax",
"tensorflow.keras.applications.imagenet_utils.preprocess_input"
]
] |
saltedpotato/custom-data-with-mcrnn | [
"59dc46447b207f6f6dd3c228874cbc8c6e2911d9"
] | [
"mrcnn/model.py"
] | [
"\"\"\"\nMask R-CNN\nThe main Mask R-CNN model implementation.\n\nCopyright (c) 2017 Matterport, Inc.\nLicensed under the MIT License (see LICENSE for details)\nWritten by Waleed Abdulla\n\"\"\"\n\nimport os\nimport random\nimport datetime\nimport re\nimport math\nimport logging\nfrom collections import OrderedDict... | [
[
"numpy.amax",
"numpy.expand_dims",
"tensorflow.concat",
"tensorflow.control_dependencies",
"tensorflow.stack",
"tensorflow.reduce_sum",
"tensorflow.minimum",
"tensorflow.cast",
"tensorflow.image.non_max_suppression",
"tensorflow.equal",
"tensorflow.image.crop_and_resize... |
Pradhy729/BertSum | [
"6864f3dadb51a1e680623a3d018f46d714d4b62c"
] | [
"src/models/model_builder.py"
] | [
"\nimport torch\nimport torch.nn as nn\nfrom transformers import BertModel, BertConfig\nfrom torch.nn.init import xavier_uniform_\n\nfrom models.encoder import TransformerInterEncoder, Classifier, RNNEncoder\nfrom models.optimizers import Optimizer\n\n\ndef build_optim(args, model, checkpoint):\n \"\"\" Build op... | [
[
"torch.is_tensor",
"torch.nn.init.xavier_uniform_"
]
] |
tranbahien/bae_prior | [
"6bb385ed765ae1dd8c961e597f1ed91e036ae470"
] | [
"learnable_priors/distributions/gaussian.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\nfrom learnable_priors.distributions import PriorDistribution\nfrom utils import inv_softplus\n\n\nclass GaussianDistribution(PriorDistribution):\n\n def __init__(self, *shape, mean_init=0., log_var_init=-6,\n ... | [
[
"numpy.log",
"torch.ones",
"torch.zeros",
"torch.sqrt",
"torch.randn",
"torch.sum",
"torch.exp"
]
] |
GustavoHBDuarte/fraud-detection | [
"89090ff1071b056a58a28710fadb8af2fa73836a"
] | [
"web_app/Fraud_class/Data_prep.py"
] | [
"import pickle\nimport bz2\nimport _pickle as cPickle\nfrom math import ceil\nfrom math import floor\nimport pandas as pd\nimport numpy as np\nimport json\n\n\n\nclass Data_prep(object):\n \n def __init__(self): \n self.amount_scaler = pick... | [
[
"numpy.cos",
"numpy.sin"
]
] |
CriticalLink/ArrowCMR | [
"d7e45421b8762421aeff660108d1166be83e0d89"
] | [
"MotorControlGUI/Python/libs/adiSerial.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Mon Aug 17 10:23:20 2020\n\n@brief: Serial class for communication over COM port.\n@description: Serial connection manager with convenience\nmethods for connecting to serial, discovering ports\nand sending data as a stream of bytes.\n\n@author: Tom Sharkey\n@last-modifie... | [
[
"numpy.arange",
"pandas.DataFrame"
]
] |
frankfengdi/lidarMTL | [
"70c6181149e84c638b0435738282ae93faab8d1b"
] | [
"pcdet/models/detectors/detector3d_template.py"
] | [
"import os\n\nimport torch\nimport torch.nn as nn\n\nfrom ...ops.iou3d_nms import iou3d_nms_utils\nfrom .. import backbones_2d, backbones_3d, dense_heads, roi_heads\nfrom ..backbones_2d import map_to_bev\nfrom ..backbones_3d import pfe, vfe\nfrom ..model_utils import model_nms_utils\n\nfrom visual_utils import debu... | [
[
"torch.LongTensor",
"torch.sigmoid",
"torch.max",
"torch.zeros",
"torch.cat",
"torch.load",
"torch.arange",
"torch.device"
]
] |
Lewington-pitsos/lanenet-lane-detection | [
"12009ebc0cd7b418b1e07a646b4e1b7285466790"
] | [
"semantic_segmentation_zoo/cnn_basenet.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Time : 17-9-18 下午3:59\n# @Author : MaybeShewill-CV\n# @Site : https://github.com/MaybeShewill-CV/lanenet-lane-detection\n# @File : cnn_basenet.py\n# @IDE: PyCharm Community Edition\n\"\"\"\nThe base convolution neural networks mainly implement some usefu... | [
[
"tensorflow.cond",
"tensorflow.concat",
"tensorflow.zeros",
"tensorflow.nn.max_pool",
"tensorflow.layers.conv2d_transpose",
"tensorflow.keras.initializers.VarianceScaling",
"tensorflow.nn.depthwise_conv2d",
"tensorflow.nn.atrous_conv2d",
"tensorflow.nn.conv2d",
"tensorflow.... |
AlbertiPot/darts | [
"ad6d458ac5a556ab3ce876bcc46ab4dfcf73ed38"
] | [
"cnn/architect.py"
] | [
"import torch\nimport numpy as np\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\n\ndef _concat(xs):\n return torch.cat([x.view(-1) for x in xs])\n\n\nclass Architect(object):\n\n def __init__(self, model, args):\n self.network_momentum = args.momentum\n self.network_weight_decay = args.weigh... | [
[
"torch.zeros_like",
"torch.autograd.Variable"
]
] |
ubsuny/data-analysis-final20 | [
"96bd050527f31aee49eee08de4c8e27d02558ec2"
] | [
"GPS/utility/tests/least_squares_test.py"
] | [
"# So we can access the utility files:\nimport sys\nsys.path.append('../')\n\nimport numpy as np\n\n# The main library:\nfrom least_squares import least_squares, chi2, rmse\n\n# The test:\ndef test_least_squares():\n # First, we can test in the base case where it's a polynomial of the form\n x = np.linspace(0... | [
[
"numpy.sqrt",
"numpy.linspace"
]
] |
zhoulei-biubiu/pytorch-lightning | [
"09669028d5b56914c4f7381862d9151d09947a98"
] | [
"tests/utilities/test_apply_func.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.allclose",
"numpy.array",
"torch.tensor"
]
] |
PengFCB/Traffic_Anomaly_Detection_System_UCAS | [
"30675b3fcb5ed65bf64daa782e271f45f27d40e2"
] | [
"main.py"
] | [
"import cal_distance\nimport cal_f1\nimport csv_dealer\nimport get_gps\nimport get_Sit\nimport K_Means\nimport nmf_sklearn\nimport probability\nimport numpy as np\nimport os\n\n\ndef check_dic():\n path_list = ['final_test_cut', 'test_csv_cut', 'training_csv_cut', 'result', 'result1']\n\n for path in path_lis... | [
[
"numpy.savetxt"
]
] |
wilsonify/DSIRP | [
"72747f177956952369df287ad9cc833458e0e205"
] | [
"timing.py"
] | [
"\n\nimport os\n\ndef etime():\n \"\"\"Measures user and system time this process has used.\n\n Returns the sum of user and system time.\"\"\"\n user, sys, chuser, chsys, real = os.times()\n return user+sys\n\ndef time_func(func, n):\n \"\"\"Run a function and return the elapsed time.\n\n func: fu... | [
[
"matplotlib.pyplot.legend",
"matplotlib.pyplot.xscale",
"matplotlib.pyplot.yscale",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.ylabel"
]
] |
Chiraagkv/Driver-distraction-detection | [
"633115c3e3a861ad267d8fd5db5878666d6f4d4b"
] | [
"backend.py"
] | [
"import tensorflow as tf\r\nimport tensorflow_hub as hub\r\n# import streamlit as st\r\n# import matplotlib \r\n# import matplotlib.pyplot as plt\r\nimport os\r\nimport pandas\r\nimport numpy as np\r\nfrom PIL import Image, ImageOps\r\n\r\n# What I have to do:\r\n\r\n# 1. Get create_batches\r\n# 2. Get unbatchify\r... | [
[
"tensorflow.keras.models.load_model",
"tensorflow.unstack",
"numpy.asarray",
"tensorflow.stack",
"numpy.ndarray",
"numpy.max",
"tensorflow.image.resize",
"numpy.argmax",
"numpy.array"
]
] |
YoussefSaied/ML2 | [
"db3215fe2f1e2400e39a85f1550733447af9955c"
] | [
"MainY23.py"
] | [
"# %% Global parameters\n#Our variables:\nYoussefPathModel= '/home/youssef/EPFL/MA1/Machine learning/MLProject2/ML2/youssefServer4.modeldict' # Path of the weights of the model\nYoussefdatapath = '/home/youssef/EPFL/MA1/Machine learning/MLProject2/Data' # Path of data\nYoussefServerPathModel= '/home/saied/ML/ML2/yo... | [
[
"sklearn.metrics.roc_auc_score",
"torch.utils.data.DataLoader",
"matplotlib.pyplot.plot",
"numpy.max",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"torch.nn.SoftMarginLoss",
"torch.optim.lr_scheduler.StepLR",
"matplotlib.pyplot.title",
"numpy.min",
"... |
BaselLaserMouse/rt_model_orsolic | [
"19217bedfb3d973d74972b8b361628e0f366709e"
] | [
"src/gp_fit.py"
] | [
"#!/usr/bin/env python3\n\nimport json\nimport time\nfrom pathlib import Path\nfrom functools import partial\n\nimport defopt\nimport numpy as np\nimport scipy.io as io\nimport pandas as pd\nimport tensorflow as tf\nimport gpflow\nfrom sklearn.model_selection import train_test_split\n\nfrom strenum import strenum\n... | [
[
"numpy.savez",
"numpy.random.seed",
"scipy.io.loadmat",
"sklearn.model_selection.train_test_split",
"tensorflow.ConfigProto",
"numpy.ceil",
"tensorflow.Session",
"numpy.load",
"numpy.vstack"
]
] |
FeherBalazs/text-analytics-service | [
"36292f835419c9cd6266f4813731b084b2a6cf24"
] | [
"flask_deployment/sentiment_service.py"
] | [
"# -*- coding: utf-8 -*-\n\n'''\nsentiment_service.py\n~~~~~~~~~~~~~~~~~~~~\n\nApp implements a sentiment analysis pipeline. \n\n'''\nimport cPickle\nimport os\n\nfrom flask import Flask, request, jsonify\nimport pandas as pd\nimport requests\nimport sklearn\n\nresp = requests.get(\"https://raw.githubusercontent.co... | [
[
"pandas.Series"
]
] |
hsnee/LSSTC-DSFP-Sessions | [
"5d90992179c80efbd63e9ecc95fe0fef7a0d83c1"
] | [
"Session4/Day4/triangle_linear.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\n'''\n This hacked version of triangle, called triangle_linear, is an adaption of the following authors open source code, their credentials below. triangle_linear is an adaption by Megan Shabram and Dan Gettings, made in 2013. Some of the original functionalit... | [
[
"numpy.sqrt",
"numpy.linspace",
"numpy.arctan2",
"numpy.max",
"scipy.stats.gaussian_kde",
"numpy.mean",
"matplotlib.pyplot.gca",
"numpy.linalg.svd",
"numpy.atleast_1d",
"numpy.real",
"numpy.argmax",
"matplotlib.pyplot.figure",
"numpy.atleast_2d",
"numpy.cov"... |
gait-analyzer/.github | [
"2064375ddc36bf38f3ff65f09e776328b8b4612a"
] | [
"scripts/gaitdb/stride_time.py"
] | [
"import np # main library for numeric calculations\nimport pandas as pd # main library for data analysis\nimport matplotlib.pyplot as plt # main library for data plotting\nfrom glob import glob # check files\nfrom math import *\nfrom .logReg import *\n\ngaitdb = []\ngaitDBnames = []\nfor i in sorted(glob(\"gaitdb/*... | [
[
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.figure"
]
] |
landsito/pysatNASA | [
"8ebbad6e8447ed656641a4bbeb29e6a41f06bcc8"
] | [
"pysatNASA/instruments/cnofs_plp.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"Supports the Planar Langmuir Probe (PLP) onboard the Communication\nand Navigation Outage Forecasting System (C/NOFS) satellite. Downloads\ndata from the NASA Coordinated Data Analysis Web (CDAWeb).\n\nDescription from CDAWeb:\n\nThe Planar Langmuir Probe on C/NOFS is a suite of 2 cu... | [
[
"numpy.where"
]
] |
YufeiHU-fr/obow_ssl | [
"011b8b0def3d8eda1a7671ea088dace8e479e67a"
] | [
"test.py"
] | [
"import glob\nimport os\nimport pathlib\nimport datetime\nimport logging\nimport time\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.distributed\n\n\nfrom collections import defaultdict\n\n\ndef setup_printing(is_master):\n \"\"\"\n This function disables printing when not... | [
[
"torch.distributed.broadcast",
"torch.load",
"torch.cat",
"torch.no_grad",
"torch.cuda.is_available",
"torch.allclose",
"torch.distributed.get_rank",
"torch.randn",
"torch.distributed.barrier",
"torch.tensor",
"torch.ones_like",
"torch.distributed.is_initialized",
... |
Chenfeng1271/JSPNet-Learning-Joint-Semantic-Instance-Segmentation-of-Point-Clouds-via-Similarity-and-Probabili | [
"1d50417431b5af1ad76b96749e841969d4dc1359"
] | [
"utils/provider.py"
] | [
"import numpy as np\nimport h5py\n\n# BASE_DIR = os.path.dirname(os.path.abspath(__file__))\n# sys.path.append(BASE_DIR)\n#\n# # Download dataset for point cloud classification\n# DATA_DIR = os.path.join(BASE_DIR, 'data')\n# if not os.path.exists(DATA_DIR):\n# os.mkdir(DATA_DIR)\n# if not os.path.exists(os.path... | [
[
"numpy.ones_like",
"numpy.cos",
"numpy.random.shuffle",
"numpy.sin",
"numpy.random.randn",
"numpy.random.uniform",
"numpy.array",
"numpy.zeros"
]
] |
VegaSera/DS-Unit-3-Sprint-2-SQL-and-Databases | [
"0668c3d57424e6d4dc5af659dce3becd52ff32cf"
] | [
"module2-sql-for-analysis/migrate_rpg.py"
] | [
"import sqlite3\nimport pandas as pd\nimport os\nfrom dotenv import load_dotenv\nimport psycopg2\nfrom sqlalchemy import create_engine\n\nfilepath = os.path.join(os.path.dirname(__file__),\"..\",\"module1-introduction-to-sql\",\"\")\n#filepath = 'C:/Users/Vega/Documents/DS-Unit-3-Sprint-2-SQL-and-Databases/module1-... | [
[
"pandas.read_sql"
]
] |
jcmgray/quijy | [
"3440fa382ec1bc87bdb6ee880f983160c08e47e6"
] | [
"quimb/tensor/tensor_arbgeom_tebd.py"
] | [
"import random\nimport itertools\nimport collections\n\nfrom autoray import do, to_numpy, dag\n\nfrom ..core import eye, kron, qarray\nfrom ..utils import ensure_dict\nfrom ..utils import progbar as Progbar\nfrom .tensor_core import Tensor\nfrom .drawing import get_colors, get_positions\n\n\nclass LocalHamGen:\n ... | [
[
"matplotlib.pyplot.show",
"matplotlib.pyplot.Line2D",
"matplotlib.pyplot.subplots"
]
] |
ViToSVK/dt-linear | [
"6de413a125bce73dc3b5d1df860f6353a9729fda"
] | [
"src/split/auc.py"
] | [
"# Area under the curve splitting criterion\n\nimport numpy as np\nfrom sklearn.linear_model import LinearRegression #LogisticRegression\nfrom sklearn.metrics import accuracy_score, roc_auc_score\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.svm import LinearSVC\nimport sys\nsys.path.insert(0, '.... | [
[
"sklearn.preprocessing.StandardScaler",
"sklearn.linear_model.LinearRegression",
"sklearn.svm.LinearSVC"
]
] |
KrisNguyen135/Advanced-Python-Programming-Second-Edition | [
"e5d473e3efc5f6590028cb3f318e1f4aeb0aadd1"
] | [
"Chapter08/test_tensorflow_matmul.py"
] | [
"import tensorflow.compat.v1 as tf\ntf.disable_v2_behavior()\nimport time\nimport numpy as np\nN = 5000\n\nA_data = np.random.rand(N, N)\nB_data = np.random.rand(N, N)\n\n# Creates a graph.\n\nwith tf.device('/gpu:0'):\n A = tf.placeholder('float32')\n B = tf.placeholder('float32')\n\n C = tf.matmul(A, B)\... | [
[
"tensorflow.compat.v1.device",
"tensorflow.compat.v1.disable_v2_behavior",
"tensorflow.compat.v1.Session",
"tensorflow.compat.v1.matmul",
"tensorflow.compat.v1.placeholder",
"numpy.random.rand"
]
] |
elicharlese/pyextremes | [
"efcf342df0116e68b88cd1ad0c0f0dd07f9e30ae"
] | [
"tests/extremes/test_return_periods.py"
] | [
"import numpy as np\nimport pytest\n\nfrom pyextremes.extremes import get_return_periods\n\n\ndef test_get_return_periods_errors(battery_wl_preprocessed, extremes_bm_high):\n # Test bad block_size type\n with pytest.raises(TypeError, match=r\"invalid type.*block_size.*argument\"):\n get_return_periods(... | [
[
"numpy.argmax",
"numpy.argmin"
]
] |
lordk911/incubator-linkis | [
"f27699aa6be01d7ee2ae3e544c8fefcef2830b0a"
] | [
"linkis-engineconn-plugins/engineconn-plugins/spark/src/main/resources/python/mix_pyspark.py"
] | [
"#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements. See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); yo... | [
[
"matplotlib.use"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.