repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
nmamano/sanim | [
"b4b8603bfb86678f7448364135292cde7b02d719",
"b4b8603bfb86678f7448364135292cde7b02d719"
] | [
"manim_engine/utils/color.py",
"manim_engine/once_useful_constructs/light.py"
] | [
"import numpy as np\nimport random\n\nfrom colour import Color\n\nfrom manim_engine.constants import WHITE\nfrom manim_engine.constants import PALETTE\n\nfrom manim_engine.utils.bezier import interpolate\nfrom manim_engine.utils.space_ops import normalize\nfrom manim_engine.utils.simple_functions import clip_in_pla... | [
[
"numpy.dot",
"numpy.apply_along_axis"
],
[
"scipy.spatial.ConvexHull"
]
] |
AgentMaker/AgentCLPR | [
"3dfa6a2390176493965f432be38990fee9f4a931"
] | [
"agentclpr/infer/system.py"
] | [
"import cv2\nimport json\nimport numpy as np\n\nfrom agentocr import OCRSystem\n\nfrom .detector import CLPDetector\nfrom .utility import clp_det_model, det_model, cls_model, rec_model, rec_char_dict_path, base64_to_cv2\n\n\nclass CLPSystem:\n def __init__(\n self,\n clp_det_model=clp_det_m... | [
[
"numpy.fromfile",
"numpy.prod"
]
] |
smgpulse007/lucid4keras | [
"a014bd93c90e29bc1cde4f40cb3641be0acb37c1"
] | [
"lucid4keras/render.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nimport keras.backend as K\nfrom keras.layers import Lambda,Input\nfrom keras.models import Model\n\nimport lucid.optvis.param as param\nfrom lucid.optvis.render import make_t_image, make_transform_f, make_optimizer\nfrom lucid.misc.io import show\nfrom lucid.misc.io.s... | [
[
"tensorflow.set_random_seed",
"numpy.hstack",
"numpy.array",
"numpy.zeros"
]
] |
Waffle-Liu/magenta | [
"b36c65466745ff1e056dca40179ae71306a0ca5b"
] | [
"magenta/models/onsets_frames_transcription/infer_util.py"
] | [
"# Copyright 2019 The Magenta Authors.\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 o... | [
[
"tensorflow.metrics.mean",
"numpy.pad",
"tensorflow.greater",
"tensorflow.cast",
"tensorflow.equal",
"tensorflow.placeholder",
"tensorflow.div",
"tensorflow.logging.info",
"numpy.zeros_like",
"numpy.transpose",
"tensorflow.variable_scope",
"numpy.array",
"tensor... |
dkauf42/bayota | [
"104ba91746231be10419390a9d7ed8f2593a21bc",
"104ba91746231be10419390a9d7ed8f2593a21bc",
"104ba91746231be10419390a9d7ed8f2593a21bc"
] | [
"bayota_util/vis/acres_bars.py",
"bayom_e/model_handling/model_inspection.py",
"bayota_util/vis/zL_bars.py"
] | [
"import matplotlib.pyplot as plt\n\n\ndef acres_bars(df=None, instance=None, savefig=True, savefilepathandname=None, titlestr=''):\n if not savefilepathandname:\n raise ValueError('Not savepath specified')\n\n # ---- Make acres Figure ----\n # sorteddf_byacres = merged_df.sort_values(by='acres')\n ... | [
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.title",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.figure"
],
[
"numpy.where",
"pandas.DataFrame"
],
[
"matplotlib.pyplot.gca",
"matplotlib.pyplot.barh",
"matplotlib.pyplot.savefig",
"mat... |
AnjaliMathew/DL-based-Cough-Sneeze-Detector | [
"ef34c05ff74d5ae139c41e346f1e3380616e7e42"
] | [
"cough_sneeze_training.py"
] | [
"import numpy as np\nfrom utilities import *\n\ndef get_random_time_segment(segment_ms):\n \"\"\"\n Gets a random time segment of duration segment_ms in a 10,000 ms audio clip.\n \n Arguments:\n segment_ms -- the duration of the audio clip in ms (\"ms\" stands for \"milliseconds\")\n \n Returns... | [
[
"numpy.zeros",
"numpy.random.seed",
"numpy.random.randint"
]
] |
James-P-D/GeniusSquare | [
"f136b0b2118dffff8c9688a1822d04cccfe196f6"
] | [
"src/GeniusSquare/GeniusSquare/GeniusSquare.py"
] | [
"import pygame # Tested with pygame v1.9.6\nimport numpy as np\nfrom Constants import *\nfrom UIControls import *\nimport threading\nimport random\nimport time\n\n###############################################\n# Globals\n###############################################\n\n# pygame screen\nscreen = pygame.display.s... | [
[
"numpy.zeros",
"numpy.ndarray"
]
] |
mhawry/auquantoolbox | [
"f88b052d04baa81575b6886f829bca71d9425196"
] | [
"backtester/features/score_logloss_feature.py"
] | [
"from backtester.features.feature import Feature\nimport numpy as np\nimport pandas as pd\n\n\nclass ScoreLogLossFeature(Feature):\n\n @classmethod\n def computeForInstrument(cls, updateNum, time, featureParams, featureKey, instrumentManager):\n instrumentLookbackData = instrumentManager.getLookbackIns... | [
[
"numpy.log"
]
] |
ruohoruotsi/silero-vad | [
"8628a846213819f4271cd79b30c27f2249482dcb"
] | [
"utils_vad.py"
] | [
"import torch\nimport torchaudio\nfrom typing import List\nfrom itertools import repeat\nfrom collections import deque\nimport torch.nn.functional as F\n\n\ntorchaudio.set_audio_backend(\"soundfile\") # switch backend\n\n\nlanguages = ['ru', 'en', 'de', 'es']\n\n\nclass IterativeMedianMeter():\n def __init__(se... | [
[
"torch.jit.load",
"torch.softmax",
"torch.cat",
"torch.zeros",
"torch.unsqueeze",
"pandas.DataFrame",
"torch.set_grad_enabled",
"torch.no_grad",
"torch.split",
"torch.device",
"torch.argsort"
]
] |
rkretsch/arnie | [
"28251b4e96fe313475994dbf8780710776f4bf33"
] | [
"mea/mea_utils.py"
] | [
"import numpy as np\nimport argparse, sys\n\ndef convert_dotbracket_to_matrix(s):\n m = np.zeros([len(s),len(s)])\n for char_set in [['(',')'], ['[',']'],['{','}'],['<','>']]:\n bp1=[]\n bp2=[]\n for i, char in enumerate(s):\n if char==char_set[0]:\n bp1.append(i... | [
[
"numpy.sum",
"numpy.sqrt",
"numpy.loadtxt",
"numpy.triu_indices"
]
] |
EvilPsyCHo/attention-pytorch | [
"d5367d14803a976ce2d3c643d1834612024df2d3"
] | [
"models/layer.py"
] | [
"# coding:utf8\n# @Time : 18-6-15 下午2:17\n# @Author : evilpsycho\n# @Mail : evilpsycho42@gmail.com\nimport numpy as np\nimport torch\nfrom torch import nn\n\n\nclass ScaledDotProductAttention(nn.Module):\n\n def __init__(self, d_model, attn_dropout=0.1):\n super(ScaledDotProductAttention, self).__i... | [
[
"torch.nn.Softmax",
"torch.nn.Dropout",
"numpy.power",
"torch.randn",
"torch.bmm"
]
] |
MatthijsBurgh/SpatialFlow | [
"3994fb175fb1c5ff4693cdc34e1a8f713f3e2864"
] | [
"tools/panoptic_converters/panoptic2detection_coco_format.py"
] | [
"\"\"\"This script converts panoptic COCO format to detection COCO format. More\ninformation about the formats can be found here:\nhttp://cocodataset.org/#format-data. All segments will be stored in RLE format.\n\nAdditional option:\n- using option '--things_only' the script can discard all stuff\nsegments, saving ... | [
[
"numpy.asfortranarray",
"numpy.array_split",
"numpy.expand_dims"
]
] |
aricooperman/Jzipline | [
"62d4878cccbe3b9ea71dc2013ca609fa4e9dc29f"
] | [
"zipline/data/us_equity_loader.py"
] | [
"# Copyright 2016 Quantopian, 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 applicable law or ag... | [
[
"pandas.tslib.normalize_date"
]
] |
CPJKU/partitura | [
"b1053d663fc10fc839a3c9c81c9b3dbf53d9e4b2"
] | [
"partitura/musicanalysis/key_identification.py"
] | [
"# -*- coding: utf-8 -*-\n\"\"\"\nKrumhansl and Shepard key estimation\n\n\"\"\"\nimport numpy as np\nfrom scipy.linalg import circulant\nfrom partitura.utils.music import ensure_notearray\n\n__all__ = [\"estimate_key\"]\n\n# List of labels for each key (Use enharmonics as needed).\n# Each tuple is (key root name, ... | [
[
"scipy.linalg.circulant",
"numpy.mod",
"numpy.argsort",
"numpy.array",
"numpy.where",
"numpy.sum",
"numpy.corrcoef"
]
] |
getoutreach/simpletransformers | [
"071f9f709891d6c8ba6da6af54bf4a378008e729"
] | [
"simpletransformers/classification/transformer_models/bert_model_with_gcn.py"
] | [
"from transformers.modeling_bert import BertPreTrainedModel, BertModel\nimport torch\nimport torch.nn as nn\nfrom torch.nn import CrossEntropyLoss, MSELoss\nfrom simpletransformers.classification.graph_models.gcn_model import Net\nimport networkx as nx\nimport dgl\n\n\nclass BertForSequenceClassificationWithGCN(Ber... | [
[
"torch.nn.Dropout",
"torch.nn.CrossEntropyLoss",
"torch.cat",
"torch.tensor",
"torch.nn.Linear",
"torch.nn.MSELoss"
]
] |
kmcdono2/ap | [
"e57dc026d7737ee1656e136117ac5e72145dfc99",
"e57dc026d7737ee1656e136117ac5e72145dfc99"
] | [
"raw_speeches_grouping.py",
"parse_speaker_dfs.py"
] | [
"#!/usr/bin/env python\n\nimport pickle\nimport pandas as pd\nfrom pandas import *\nimport numpy as np\nfrom nltk import word_tokenize\nfrom nltk.util import ngrams\nimport collections\nfrom collections import Counter\nimport os\nimport regex as re\nfrom make_ngrams import compute_ngrams\nimport math\nfrom collecti... | [
[
"pandas.Series",
"pandas.DataFrame",
"pandas.DataFrame.from_dict"
],
[
"pandas.read_excel",
"pandas.ExcelWriter"
]
] |
yarny/gbdt | [
"c99d90d7de57705c30b05d520a32e458985fd834"
] | [
"examples/benchm-ml/run.py"
] | [
"#!/usr/bin/python\n\nimport sys\nimport json\nimport subprocess\nimport numpy as np\nfrom sklearn import metrics\nimport csv\nimport matplotlib.pyplot as plt\n\ndef configName(model):\n return 'benchm-ml.{0}.config'.format(model)\n\ndef forestName(model):\n return 'forest.{0}'.format(model)\n\ndef executeCom... | [
[
"sklearn.metrics.auc",
"sklearn.metrics.roc_curve"
]
] |
arbrasington/Optimization-Methods | [
"e8035a887b4ba1a3a93338d49e8de4045019f093"
] | [
"bay_opt/optimize.py"
] | [
"import os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfrom gpr import GaussianProcess\nfrom space import Space\nfrom opt import Optimizer\n\ninputs = {i: [int, [0, 10]] for i in range(10)}\n\ndef f(x):\n return np.sum(x)\n\n\n# initialize surrogate\nn_init = 25\nn_iters = 50\ngp = GaussianProcess(... | [
[
"matplotlib.pyplot.plot",
"matplotlib.pyplot.show",
"numpy.zeros",
"numpy.sum"
]
] |
gitstar21/recommendation_system | [
"1e24f5d49fa56563b114d323eb90139b4d00e586"
] | [
"utilities/Recommender.py"
] | [
"import numpy as np\nimport mysql.connector\nclass Recommender:\n def __init__(self, users, movies, userID):\n self.users = users\n self.movies = movies\n self.userID = userID # this is the user who needs the recommendations\n self.db = mysql.connector.connect(\n host=\"loc... | [
[
"numpy.random.permutation",
"numpy.zeros",
"numpy.sum"
]
] |
pengxin99/gluon-cv | [
"f4b44e96cad589debccdd9fc9e3973de65dc4f75"
] | [
"gluoncv/model_zoo/segbase.py"
] | [
"\"\"\"Base Model for Semantic Segmentation\"\"\"\nimport math\nimport warnings\nimport numpy as np\nimport mxnet as mx\nfrom mxnet.ndarray import NDArray\nfrom mxnet.gluon.nn import HybridBlock\nfrom ..utils.parallel import parallel_apply\nfrom .resnetv1b import resnet18_v1b, resnet34_v1b, resnet50_v1s, resnet101_... | [
[
"numpy.array"
]
] |
abhmul/projects-repo | [
"6d3a8110ce69219e769e0e56d14fbe394f6389c6"
] | [
".archive/experiments/pac_rectangle.py"
] | [
"import numpy as np\n\nimport projectlib.common.distributions as dist\n\nRNG = np.random.default_rng(12345)\n\ndef tightest_fit(true_points):\n # points are Samples x Shape\n bound_max = np.max(true_points, axis=0)\n bound_min = np.min(true_points, axis=0)\n return bound_max, bound_min\n\n\ndef error(re... | [
[
"numpy.min",
"numpy.minimum.accumulate",
"numpy.max",
"numpy.maximum.accumulate",
"numpy.random.default_rng"
]
] |
GaiYu0/learning_to_retrieve_reasoning_paths | [
"f83c7a8f707c62d51b749716b7afc01e9cb9d737"
] | [
"retriever/doc_db.py"
] | [
"import sqlite3\nimport argparse\nimport time\ntry:\n from retriever.utils import find_hyper_linked_titles, remove_tags, normalize\nexcept:\n from utils import find_hyper_linked_titles, remove_tags, normalize\n\nimport numpy as np\n\nfrom functools import reduce\nfrom itertools import chain\nfrom multiprocess... | [
[
"numpy.load",
"numpy.logical_and",
"numpy.save"
]
] |
Hallvardd/TDT4195-StarterCode | [
"2a0a6abfd07e139a380f1624632dea4fe6f5a7eb"
] | [
"assignment2/task4d.py"
] | [
"import numpy as np\nimport skimage\nimport utils\nfrom task4b import convolve_im\n\n\ndef sharpen(im: np.array):\n \"\"\" Sharpens a grayscale image using the laplacian operator.\n\n Args:\n im: np.array of shape [H, W]\n Returns:\n im: np.array of shape [H, W]\n \"\"\"\n laplacian = n... | [
[
"numpy.concatenate",
"numpy.array"
]
] |
grgkopanas/pytorch3d | [
"e37085d9990bf94c7fcee6a9df5dc8db35391608"
] | [
"pytorch3d/ops/nearest_neighbor_points.py"
] | [
"# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\n\nimport torch\nfrom pytorch3d import _C\n\n\ndef nn_points_idx(p1, p2, p2_normals=None) -> torch.Tensor:\n \"\"\"\n Compute the coordinates of nearest neighbors in pointcloud p2 to points in p1.\n Args:\n p1: FloatTensor of... | [
[
"torch.no_grad"
]
] |
HerouFenix/cdados-project | [
"2204da8f97d8a4ee40a8128428afcb479f576e49"
] | [
"Classification/Clustering/ds_functions.py"
] | [
"import itertools\nimport math\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport matplotlib.dates as mdates\nimport warnings\nimport sklearn.metrics as metrics\nimport config as cfg\nimport datetime as dt\nimport matplotlib.colors as colors\n\n\nCOLORS = colors.CSS4_COLORS\n\nwarni... | [
[
"matplotlib.pyplot.gca",
"numpy.set_printoptions",
"matplotlib.pyplot.subplots",
"sklearn.metrics.confusion_matrix",
"pandas.DataFrame",
"matplotlib.dates.AutoDateFormatter",
"pandas.unique",
"sklearn.metrics.plot_roc_curve",
"matplotlib.dates.AutoDateLocator"
]
] |
kennethGHS/PAID_C_and_H | [
"1756bb4a83b8cdefb1484bb2e67dd408d2925126"
] | [
"Catalog 1/Grayscale_Transformations/gammaTransform.py"
] | [
"import matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\ndef gammaTransform():\r\n #necessary configuration of pyplot to see the images in grayscale\r\n plt.rcParams['image.cmap'] = 'gray'\r\n\r\n image = plt.imread('boat.jpg')\r\n fig = plt.figure()\r\n\r\n ########The gamma transformation of t... | [
[
"numpy.clip",
"matplotlib.pyplot.imread",
"numpy.arange",
"matplotlib.pyplot.draw",
"numpy.round",
"matplotlib.pyplot.clf",
"matplotlib.pyplot.pause",
"matplotlib.pyplot.figure"
]
] |
KhizarAziz/C3AE_Age_Estimation | [
"026303e63d877ca3550f45b3a91aec939fe5029f"
] | [
"models/run_net.py"
] | [
"#!/usr/bin/env python\n# encoding: utf-8\n\nimport tensorflow as tf\nimport sys\nsys.path.append('..')\nfrom models.network import Network\nfrom config import cfg\nfrom models.losses import l1_loss, kl_loss\n\nclass C3AENet:\n def __init__(self, img, age_labels, age_vector, is_training, batcn_norm_decay=0.997):... | [
[
"tensorflow.name_scope",
"tensorflow.shape"
]
] |
tiankaixie/pytorch-cifar | [
"efcbdb9411f88877933c45acbe5a43a141f7858e"
] | [
"main.py"
] | [
"'''Train CIFAR10 with PyTorch.'''\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.backends.cudnn as cudnn\n\nimport torchvision\nimport torchvision.transforms as transforms\n\nimport os\nimport argparse\n\nfrom models import *\nfrom utils import prog... | [
[
"torch.nn.CrossEntropyLoss",
"torch.optim.lr_scheduler.CosineAnnealingLR",
"torch.load",
"torch.manual_seed",
"torch.utils.data.DataLoader",
"torch.no_grad",
"torch.cuda.is_available",
"torch.nn.DataParallel",
"torch.save"
]
] |
kernhanda/ELL | [
"370c0de4e4c190ca0cb43654b4246b3686bca464"
] | [
"interfaces/python/test/dataset_test.py"
] | [
"import os\nimport numpy as np\nfrom testing import Testing\nimport find_ell\nimport ell\n\ndef exampleTest(example):\n # Now test the IDataVector of the example\n av = example.GetData()\n l = example.GetLabel()\n\n # test we can copy AutoDataVector to DoubleVector\n v = ell.math.DoubleVector()\n ... | [
[
"numpy.asarray",
"numpy.testing.assert_equal"
]
] |
alonsoir/tfx | [
"359dcc95e6104e183b685a683d502744305e5eba",
"359dcc95e6104e183b685a683d502744305e5eba",
"359dcc95e6104e183b685a683d502744305e5eba"
] | [
"tfx/components/pusher/executor.py",
"tfx/orchestration/config/config_utils_test.py",
"tfx/components/example_gen/custom_executors/parquet_executor_test.py"
] | [
"# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.io.gfile.exists"
],
[
"tensorflow.test.main"
],
[
"tensorflow.io.gfile.exists",
"tensorflow.io.gfile.GFile",
"tensorflow.test.main"
]
] |
Mark-MDO47/RubberBandGun | [
"77bd01c1314b194932ef557420fd848846c11f6d"
] | [
"RBG_arduino/RobotSounds.py"
] | [
"# Author: Mark Olson 2020-01-18\n#\n# Rubber Band Gun - https://github.com/Mark-MDO47/RubberBandGun\n# RBG - A high-tech imagining of the rubber band gun\n#\n# This crude program will read from the state table spreadsheet for the RBG, extract the unique sounds, and create\n# a bash file to generate a *.wav file... | [
[
"pandas.ExcelFile"
]
] |
Hoa-Lab/2021_Menieres | [
"2fc8a814a9b1883dd8c17b5d2cd6058f47f7fd4e"
] | [
"a01_gl-meni_01_rss.py"
] | [
"import pandas as pd\nimport scanpy as sc\nfrom pathlib import Path\nfrom pyscenic.rss import regulon_specificity_scores\n\n#--------------------------------------------------------\nf_gl='./out/a01_gl-meni_00_genelist/gl_meni.txt'\nfd_ada='./out/a00_pp_00_load'\nfd_out='./out/a01_gl-meni_01_rss'\n\nl_sample=['sc_P... | [
[
"pandas.DataFrame"
]
] |
crypdick/RoboSkeeter | [
"c905a69c4f7ecf1e1c3e950f36200610a903b6a5"
] | [
"roboskeeter/math/test_math_sorcery.py"
] | [
"\"\"\"\nUnit tests for kinematics calculations.\n\"\"\"\nfrom __future__ import print_function, division\n\nimport unittest\n\nimport numpy as np\n\nfrom kinematic_math import math_toolbox\n\n\nclass TruismsTestCase(unittest.TestCase):\n def setUp(self):\n print(\"In test '{}'...\".format(self._testMetho... | [
[
"numpy.abs",
"numpy.sqrt",
"numpy.isnan",
"numpy.ones",
"numpy.random.normal",
"numpy.array",
"numpy.zeros",
"numpy.testing.assert_array_almost_equal"
]
] |
snakeztc/sentence-transformers | [
"4c5090bfe603dd14366edad9952efe2af29ce650"
] | [
"examples/training_stsbenchmark_cnn.py"
] | [
"\"\"\"\nThis example runs a CNN after the word embedding lookup. The output of the CNN is than pooled,\nfor example with mean-pooling.\n\n\n\"\"\"\nimport torch\nfrom torch.utils.data import DataLoader\nimport math\nfrom soco_sentence_transformers import models, losses\nfrom soco_sentence_transformers import Sente... | [
[
"torch.utils.data.DataLoader"
]
] |
yiwang62/pymatgen | [
"a568957a821fc0bdf9fa4374c9d206d2740e5be4",
"a568957a821fc0bdf9fa4374c9d206d2740e5be4"
] | [
"pymatgen/analysis/chemenv/utils/func_utils.py",
"pymatgen/symmetry/settings.py"
] | [
"# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module contains some utility functions and classes that are used in the chemenv package.\n\"\"\"\n\n__author__ = \"David Waroquiers\"\n__copyright__ = \"Copyright 2012, The Materials Proje... | [
[
"numpy.array",
"numpy.sum",
"numpy.isclose"
],
[
"numpy.allclose",
"numpy.linalg.inv",
"numpy.matmul",
"numpy.identity",
"numpy.mod",
"numpy.array",
"numpy.zeros"
]
] |
MaLuHart/Blogpost-Classification | [
"ebb891ed6edb24ffcb1e8490d948ce0d0ce73735"
] | [
"Code/Blogs_kNN_reduced_Labels.py"
] | [
"\n# coding: utf-8\n\n# # Textklassifikation mit Bag-of-Words-Vektorisierung in tf-idf-Repräsentation und kNN-Algorithmus \n# Labels (Themen und Disziplinen) sind auf höchste Hierarchieebene reduziert\n# \n# Autorin: Maria Hartmann\n\n# In[1]:\n\n\n# Imports\nimport os\nimport time\nimport numpy as np\nimport panda... | [
[
"pandas.read_csv",
"sklearn.model_selection.RandomizedSearchCV",
"numpy.random.seed",
"sklearn.metrics.precision_score",
"sklearn.preprocessing.MultiLabelBinarizer",
"pandas.DataFrame",
"sklearn.neighbors.KNeighborsClassifier",
"sklearn.feature_extraction.text.CountVectorizer",
... |
zhanglei1949/federatedSpeechRecognition | [
"e8a9a1761e309c2aef93a629b7e82742afc798f3"
] | [
"utils/model_utils.py"
] | [
"'''\nfrom keras import backend as K\nfrom keras.models import Model\nfrom keras.layers import Input, Lambda, BatchNormalization, Conv1D, GRU, TimeDistributed, Activation, Dense, Flatten\nfrom keras.optimizers import SGD, RMSprop\nfrom keras.callbacks import ModelCheckpoint \nfrom keras.losses import categorical_... | [
[
"tensorflow.keras.layers.Lambda",
"tensorflow.keras.models.Model",
"tensorflow.keras.losses.categorical_crossentropy",
"tensorflow.keras.backend.ctc_batch_cost",
"tensorflow.keras.layers.Input"
]
] |
moment0517/Foundations_of_Algorithms | [
"7eb8df02c4d6a8befce46307b446e2678deadef3"
] | [
"DijkstraSingleSourceShortestPaths.py"
] | [
"import numpy as np\n\n\ndef dijkstra_single_source_shortest_paths(mat_adj, n, s_i):\n vertices = [s_i]\n edges = []\n length = np.ones(n) * -1\n touch = np.ones(n, dtype=int) * s_i\n\n for i in range(n):\n if i != s_i:\n length[i] = mat_adj[s_i, i]\n\n while len(vertices) < n:\n... | [
[
"numpy.max",
"numpy.array",
"numpy.ones"
]
] |
minsoo9506/catchMinor | [
"22b40e1459fd7e845e64596837f2bdb1a59b044d"
] | [
"src/lit_models/LitBaseVAE.py"
] | [
"from typing import List\n\nimport pytorch_lightning as pl\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nfrom src.models.BaseVAE import BaseVAE\n\n# import wandb\n\n\ndef loss_function(output_x, x, mu, logvar):\n BCE = F.binary_cross_entropy(output_x, x, reduction=\"sum\")\n K... | [
[
"torch.nn.functional.binary_cross_entropy"
]
] |
Aarsh2001/ivy | [
"827164d7d31bd08c5287bbd1ac9ccce588b733bc",
"827164d7d31bd08c5287bbd1ac9ccce588b733bc"
] | [
"ivy/functional/backends/torch/image.py",
"ivy/functional/backends/torch/set.py"
] | [
"\"\"\"Collection of PyTorch image functions, wrapped to fit Ivy syntax and signature.\"\"\"\n\n# global\nimport math\nimport torch\nfrom operator import mul\nfrom functools import reduce\nfrom typing import List, Optional\n\n# local\nfrom ivy.functional.backends import torch as ivy\n\n\ndef stack_images(\n imag... | [
[
"torch.transpose",
"torch.cat",
"torch.zeros",
"torch.reshape",
"torch.zeros_like",
"torch.swapaxes",
"torch.nn.functional.grid_sample",
"torch.nn.functional.interpolate"
],
[
"torch.isnan",
"torch.reshape",
"torch.tensor",
"torch.any",
"torch.unique",
"... |
PMeira/dss_python | [
"2dbc72ed875108d3f98d21cb0a488bab6b0d7f4c"
] | [
"dss/dss_capi_ir/IYMatrix.py"
] | [
"'''\nA compatibility layer for DSS C-API that mimics the official OpenDSS COM interface.\n\nCopyright (c) 2016-2020 Paulo Meira\n'''\nfrom __future__ import absolute_import\nfrom .._cffi_api_util import Base\nimport numpy as np\n\nclass IYMatrix(Base):\n __slots__ = []\n\n def GetCompressedYMatrix(self, fact... | [
[
"numpy.array"
]
] |
UCSFMemoryAndAging/macpie | [
"524ffe47c2270ef52299a893c6d28a9c21d96903"
] | [
"src/macpie/io/formats/excel.py"
] | [
"\"\"\"\nUtilities for conversion to writer-agnostic Excel representation.\n\"\"\"\n\nfrom typing import Iterable\n\nimport numpy as np\nimport pandas as pd\nimport pandas.core.common as com\nfrom pandas import Index, MultiIndex\nfrom pandas.io.formats.excel import CSSToExcelConverter, ExcelCell, ExcelFormatter\nfr... | [
[
"pandas.core.common.any_not_none",
"pandas.io.formats.excel.CSSToExcelConverter",
"pandas.io.formats.format.get_level_lengths",
"pandas.io.formats.excel.ExcelCell"
]
] |
ShivamThukral/Indoor-Object-Detection | [
"49df39c9bce77383e072fbff4ea4b5ec07062a19"
] | [
"votenet/src/ros_votenet/scripts/votenet_ros_version.py"
] | [
"# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\" Demo of using VoteNet 3D object detector to detect objects from a point cloud.\n\n\"\"\"\n\nimport os\nimport sys\nimport numpy as np\nimport argparse\nimport importlib\nimport tim... | [
[
"numpy.expand_dims",
"torch.load",
"torch.from_numpy",
"numpy.percentile",
"torch.no_grad",
"torch.cuda.is_available"
]
] |
wxmerkt/crocoddyl | [
"1463f5f214d1b47f95ee5f16b60ae8c421b7725c"
] | [
"unittest/bindings/test_costs.py"
] | [
"import sys\nimport unittest\n\nimport example_robot_data\nimport numpy as np\n\nimport crocoddyl\nimport pinocchio\nfrom crocoddyl.utils import (CoMPositionCostModelDerived, ControlCostModelDerived, FramePlacementCostModelDerived,\n FrameRotationCostModelDerived, FrameTranslationCostMod... | [
[
"numpy.allclose"
]
] |
NickSwainston/pulsar_spectra | [
"b264aab3f8fc1bb3cad14ef1b93cab519ed5bc69"
] | [
"tests/test_spectral_fit.py"
] | [
"#! /usr/bin/env python\n\"\"\"\nTests the spectral_fit.py script\n\"\"\"\nimport os\nimport numpy as np\nfrom numpy.testing import assert_almost_equal\nimport csv\n\nfrom pulsar_spectra import catalogue\nfrom pulsar_spectra.spectral_fit import find_best_spectral_fit\nfrom pulsar_spectra.catalogue import collect_ca... | [
[
"numpy.array"
]
] |
zhty98/optical-tweezers-broida-4410 | [
"c92d3630079f58dd09131dd08965baef5b4e8988"
] | [
"GUI_GM 1.0.py"
] | [
"# Run Micro-Manager ------------------------------------------------------------\r\n\r\n#import os\r\n#os.startfile(\"C:\\Program Files\\Micro-Manager-1.4\\ImageJ.exe\")\r\n\r\nimport Tkinter as tk\r\nimport PyDAQmx\r\nimport numpy as np\r\nimport time\r\nimport csv\r\n\r\n# The GUI -------------------------------... | [
[
"numpy.sin"
]
] |
rhennig22/amazon-braket-sdk-python | [
"b6642f859f9556f4862a1006e7abcc17712b0e58"
] | [
"src/braket/tasks/annealing_quantum_task_result.py"
] | [
"# Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"). You\n# may not use this file except in compliance with the License. A copy of\n# the License is located at\n#\n# http://aws.amazon.com/apache2.0/\n#\n# or in the \"license... | [
[
"numpy.asarray",
"numpy.argsort",
"numpy.flip",
"numpy.zeros"
]
] |
Strivingperson/store | [
"485889c318fd96741c8079713239caed3220b501"
] | [
"zf_code_v1/visualize_series.py"
] | [
"import pandas as pd\r\nimport matplotlib.pyplot as plt\r\nfrom matplotlib.pyplot import MultipleLocator\r\nimport matplotlib.dates as mdates\r\nimport numpy as np\r\n\r\ndef complete_print():\r\n pd.set_option('expand_frame_repr',False) # 不折叠显示\r\n pd.set_option('display.max_columns', None)\r\n pd.set_op... | [
[
"pandas.read_csv",
"numpy.isnan",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.MultipleLocator",
"matplotlib.pyplot.xlim",
"matplotlib.pyplot.grid",
"pandas.set_option",
"matplotlib.pyplot.show",
"matplotlib.pyplot.xticks"
]
] |
giuse/coco | [
"9f117c4b6e3520e349c88c30690c4c0c0a1f34c3",
"9f117c4b6e3520e349c88c30690c4c0c0a1f34c3"
] | [
"code-postprocessing/cocopp/pptex.py",
"code-postprocessing/cocopp/ppfigparam.py"
] | [
"#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"Routines for writing TeX for tables.\"\"\"\nfrom __future__ import absolute_import\nimport os\nimport sys\nimport string\nimport numpy\n\nfrom . import toolsstats\nfrom pdb import set_trace\n\n#GLOBAL VARIABLES DEFINITION\nalphabet = 'ABCDEFGHIJKLMNOPQRSTUVW... | [
[
"numpy.isnan",
"numpy.log10",
"numpy.isinf"
],
[
"matplotlib.pyplot.gca",
"numpy.isnan",
"matplotlib.pyplot.ylim",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.getp",
"matplotlib.pyplot.xlim",
"numpy.log10",
"numpy.mean",
"matplotlib.pyplot.close",
"matplotl... |
mk37972/SCAPE | [
"01080e4159917546c76dd15ae5c74e092f4ae299",
"01080e4159917546c76dd15ae5c74e092f4ae299"
] | [
"baselines/common/vec_env/vec_normalize.py",
"baselines/common/vec_env/vec_monitor.py"
] | [
"from . import VecEnvWrapper\r\nimport numpy as np\r\n\r\nclass VecNormalize(VecEnvWrapper):\r\n \"\"\"\r\n A vectorized wrapper that normalizes the observations\r\n and returns from an environment.\r\n \"\"\"\r\n\r\n def __init__(self, venv, ob=True, ret=True, clipob=10., cliprew=10., gamma=0.99, ep... | [
[
"numpy.zeros",
"numpy.sqrt"
],
[
"numpy.zeros"
]
] |
DIVA-DIA/DIVA-DAF | [
"0ae3b873d04f1852d9053cb4cb2fbc7bda73471c"
] | [
"src/datamodules/RolfFormat/datasets/dataset.py"
] | [
"\"\"\"\nLoad a dataset of historic documents by specifying the folder where its located.\n\"\"\"\n\n# Utils\nimport re\nfrom dataclasses import asdict, dataclass\nfrom pathlib import Path\nfrom typing import List, Tuple\n\nimport torch.utils.data as data\nfrom torch import is_tensor\nfrom torchvision.datasets.fold... | [
[
"torch.is_tensor"
]
] |
Obarads/PointNet-AutoEncoder-Chainer | [
"7134e62794497ebffdecbea446a14b4911e1c034"
] | [
"models/distance_loss.py"
] | [
"# -*- coding: utf-8 -*-\nimport numpy as np\nimport chainer\nfrom chainer import functions\nfrom chainer import Variable\n\n\"\"\"\nreference charlesq34/pointnet-autoencoder\nwebsite:https://github.com/charlesq34/pointnet-autoencoder/blob/master/tf_ops/nn_distance/tf_nndistance_cpu.py\n(access:2018/12/5 (yyyy/mm/d... | [
[
"numpy.sum",
"numpy.random.random",
"numpy.zeros",
"numpy.random.seed"
]
] |
devinkwok/littlenet | [
"5d4f364a905448c138e69544bf2ead792b172b2f",
"5d4f364a905448c138e69544bf2ead792b172b2f"
] | [
"test/test_train.py",
"test/test_apd.py"
] | [
"\"\"\"Unit tests for train.py\"\"\"\n\nimport unittest\nimport numpy as np\nimport xarray as xr\nfrom littlenet import neural_net as nn\nfrom littlenet import train as train\n\nclass TrainTest(unittest.TestCase):\n\n def test_shuffle_indexes(self):\n arr1 = xr.DataArray(np.arange(100).reshape((50, 2)), d... | [
[
"numpy.arange",
"numpy.ones",
"numpy.equal",
"numpy.testing.assert_allclose",
"numpy.zeros"
],
[
"numpy.arange",
"numpy.equal",
"numpy.testing.assert_allclose"
]
] |
noahwaterfieldprice/alphago | [
"4a7bba6d9758ccf1d2f2d7ae964b5d5d48021ee8"
] | [
"alphago/estimator.py"
] | [
"import abc\nimport random\n\nimport numpy as np\nimport tensorflow as tf\nfrom tqdm import tqdm\n\nfrom .games import Game\n\n\ndef create_trivial_estimator(game: Game):\n \"\"\"Create a trivial evaluator function given a next states function\n for a game.\n\n Parameters\n ----------\n game:\n\n\n ... | [
[
"numpy.nan_to_num",
"tensorflow.contrib.layers.conv3d",
"tensorflow.contrib.layers.flatten",
"numpy.mean",
"tensorflow.summary.scalar",
"tensorflow.Graph",
"tensorflow.train.MomentumOptimizer",
"tensorflow.Session",
"tensorflow.train.Saver",
"tensorflow.placeholder",
"t... |
janchorowski/Theano | [
"b46e24dcf37727f688057a55c57bf939f3f05c07"
] | [
"theano/tensor/nnet/nnet.py"
] | [
"\"\"\"\nProvides neural-network specific Ops.\n\nNotes\n-----\nTODO: factor this out into a neural-network toolbox.\n\nWe register all optimization with the gpu tag as we don't\nimplement all the intermediate case on the GPU (in particular\nAdvancedSubtensor). So to make sure it run well on the gpu with\nfast_comp... | [
[
"numpy.log",
"numpy.allclose",
"numpy.all",
"numpy.argmax",
"numpy.zeros_like",
"numpy.exp",
"numpy.zeros",
"numpy.sum",
"numpy.empty"
]
] |
Ale-Ba2lero/CNN-FromScratch | [
"8337db42f3aa0eae878a2724f382039c27498d70"
] | [
"model/layers/dense.py"
] | [
"from model.layers.layer import Layer, LayerType\nfrom model.utility import xavier_initialization\nimport numpy as np\n\n\nclass Dense(Layer):\n def __init__(self, num_neurons) -> None:\n super().__init__()\n self.num_neurons: int = num_neurons\n self.layer_type: LayerType = LayerType.DENSE\... | [
[
"numpy.dot",
"numpy.zeros",
"numpy.sum",
"numpy.clip"
]
] |
Sclare87/UQ360 | [
"2378bfa4a8d61f813afbf6854341888434c9eb11"
] | [
"uq360/datasets/banking_dataset.py"
] | [
"import os\nimport zipfile\nimport sys\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.preprocessing import OneHotEncoder, LabelEncoder\n\n\ndef default_preprocessing(df):\n \"\"\"\n 1. Drop some unnecessary columns and na values.\n 2. Break off label column from dataframe.\n 3. Encode categori... | [
[
"pandas.read_csv",
"numpy.unique",
"sklearn.preprocessing.OneHotEncoder",
"sklearn.preprocessing.LabelEncoder",
"numpy.array"
]
] |
HEIDIES/Unet-tensorflow | [
"7d00075c5246713fbafd19290f824cfd9a9abdbe"
] | [
"reader.py"
] | [
"import tensorflow as tf\nimport utils\nimport matplotlib.pyplot as plt\nimport numpy as np\n\n\nclass Reader:\n def __init__(self, tfrecords_file, image_size=256, min_queue_examples=30, batch_size=2,\n num_threads=12, name=''):\n self.tfrecords_file = tfrecords_file\n self.image_si... | [
[
"tensorflow.Graph",
"tensorflow.FixedLenFeature",
"numpy.reshape",
"tensorflow.image.resize_images",
"tensorflow.train.start_queue_runners",
"tensorflow.train.Coordinator",
"matplotlib.pyplot.subplots",
"tensorflow.global_variables_initializer",
"tensorflow.train.string_input_p... |
nemoNoboru/GEN0 | [
"715385f5f243db04c86e6737a8ee93c9af786078"
] | [
"nn/models/sequential.py"
] | [
"# feedForwards input to all layers Sequentialy\nimport numpy as np\nfrom .mutable import Mutable\n\n\nclass Sequential(Mutable):\n def __init__(self, mutationFunction):\n self.layers = []\n self.mutationFunction = mutationFunction\n\n def first(self, layer, input_size):\n self.layers.app... | [
[
"numpy.array"
]
] |
shakedlokits/neuralart_tensorflow | [
"d37e40f4854a9b17ac4935dc76225f88e594cc62"
] | [
"main.py"
] | [
"import argparse\nimport os\n\nimport numpy as np\nimport scipy.io\nimport scipy.misc\nimport tensorflow as tf\n\nIMAGE_W = 800\nIMAGE_H = 800\nCONTENT_IMG = './images/Taipei101.jpg'\nSTYLE_IMG = './images/StarryNight.jpg'\nOUTOUT_DIR = './results'\nOUTPUT_IMG = 'results.png'\nVGG_MODEL = '../imagenet-vgg-verydeep-... | [
[
"numpy.dot",
"tensorflow.constant",
"tensorflow.transpose",
"tensorflow.pow",
"numpy.reshape",
"numpy.clip",
"tensorflow.reshape",
"tensorflow.initialize_all_variables",
"tensorflow.nn.avg_pool",
"tensorflow.Session",
"tensorflow.train.AdamOptimizer",
"numpy.random.... |
keng000/ml_ops_sample | [
"eb9b71e51d31db0b3e055032d93882d1785044eb"
] | [
"app/tests/ml/test_model.py"
] | [
"import unittest\n\nimport torch\n\nfrom app.ml.model import load_model\n\n\nclass TestModel(unittest.TestCase):\n def test_load_model(self):\n devices = [\"cpu\"]\n if torch.cuda.is_available():\n devices.append(\"cuda\")\n\n for device in devices:\n device = torch.dev... | [
[
"torch.device",
"torch.cuda.is_available"
]
] |
faribas/PyDAS | [
"fe9e6080af6e8dd09e9fcba00bb06c98bc2766de"
] | [
"examples/diffusion/python/model.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n\n\"\"\"\n\nimport numpy\n\nfrom pydas import DASSL\n\nclass DiffusionModel(DASSL):\n \"\"\"\n A class for solving the diffusion equation in a 1D thin membrane. The \n attribute `N` is the number of grid points to use to discretize the\n spatial... | [
[
"numpy.zeros"
]
] |
GabrielePicco/pytorch-lightning | [
"0d6dfd42d8965347a258e3d20e83bddd344e718f",
"0d6dfd42d8965347a258e3d20e83bddd344e718f",
"0d6dfd42d8965347a258e3d20e83bddd344e718f",
"0d6dfd42d8965347a258e3d20e83bddd344e718f"
] | [
"pl_examples/basic_examples/mnist_datamodule.py",
"pl_examples/basic_examples/simple_image_classifier.py",
"pl_examples/domain_templates/computer_vision_fine_tuning.py",
"tests/utilities/test_memory.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.utils.data.random_split",
"torch.utils.data.DataLoader"
],
[
"torch.nn.Linear",
"torch.nn.functional.cross_entropy"
],
[
"torch.optim.Adam",
"torch.nn.Sequential",
"torch.sigmoid",
"torch.optim.lr_scheduler.MultiStepLR",
"torch.utils.data.DataLoader",
"torch.... |
mpriessner/DAIN | [
"e85e406947016d7db4469d880aa0d1f1f47b0f5b"
] | [
"my_package/SeparableConvFlow/SeparableConvFlowLayer.py"
] | [
"# this is for wrapping the customized layer\r\nimport torch\r\nfrom torch.autograd import Function\r\nimport separableconvflow_cuda as my_lib\r\nimport warnings\r\n#Please check how the STN FUNCTION is written :\r\n#https://github.com/fxia22/stn.pytorch/blob/master/script/functions/gridgen.py\r\n#https://github.co... | [
[
"torch.cuda.current_device",
"torch.zeros"
]
] |
Thuamo/Chinese-Text-Classification-Pytorch | [
"c9ffc171b5bb667b42f47cbb4d02b1f62c60013d"
] | [
"models/FastText.py"
] | [
"# coding: UTF-8\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport numpy as np\n\n\nclass Config(object):\n\n \"\"\"配置参数\"\"\"\n def __init__(self, dataset, embedding):\n self.model_name = 'FastText'\n self.train_path = dataset + '/data/train.txt' ... | [
[
"torch.nn.Dropout",
"torch.cat",
"torch.nn.Embedding",
"torch.nn.Linear",
"torch.nn.functional.relu",
"torch.nn.Embedding.from_pretrained",
"torch.cuda.is_available",
"numpy.load"
]
] |
ch3cook-fdu/NumPytorch | [
"236dbf10676f190841dd5ceee1958c9c449237b9"
] | [
"NumpyTorch/utils.py"
] | [
"\"\"\"\r\nAuthor: Sijin Chen, Fudan University\r\nFinished Date: 2021/06/04\r\n\"\"\"\r\n\r\nimport numpy as np\r\nfrom math import ceil\r\nfrom collections import OrderedDict\r\nimport pickle\r\n\r\n\r\nclass Dataset:\r\n def __init__(self, *args): pass\r\n def __getitem__(self, *args): raise NotImplemented... | [
[
"numpy.arange",
"numpy.array",
"numpy.random.choice"
]
] |
utepnetlab/netflowviz | [
"d4fb33e00d19a637360f8c53754158c3d5963015",
"d4fb33e00d19a637360f8c53754158c3d5963015"
] | [
"py/drilldownDriver.py",
"py/onDemand.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 11 10:52:37 2019\n\n@author: Carlos Alcantara\n\"\"\"\n\nimport pandas as pd\nfrom math import nan\nimport country\nimport organization\nimport drilldownHist\nimport sys\n\ndef countryDriver(filename, src, dst, outputFileName):\n df = p... | [
[
"pandas.read_csv",
"pandas.DataFrame"
],
[
"matplotlib.pyplot.tight_layout",
"pandas.read_csv",
"matplotlib.pyplot.subplots",
"pandas.DataFrame",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
jputlock/CSCI4961 | [
"3f8300694c0ac0d2163973b421343cd776053528"
] | [
"labs/lab09/test.py"
] | [
"import tensorflow as tf\nimport numpy as np\nnum_examples = 50\nX = np.array([np.linspace(-2, 4, num_examples), np.linspace(6,-18, num_examples)])\nx, y = X\ny += np.random.randn(num_examples)\nbias_with_x = np.array([(1.0,a) for a in x]).astype(np.float32)\ntraining_steps = 50\nlearning_rate = 0.002\n# with tf.Se... | [
[
"numpy.array",
"numpy.random.randn",
"numpy.linspace"
]
] |
EdJeeOnGitHub/PR1956 | [
"fc904a00272041c886db72759b6e0e576a29f744"
] | [
"Rect.py"
] | [
"#includes functions related with Rect computation\n\nimport numpy as np\nimport cv2\nfrom shapely.geometry import Polygon\n\ndef AreaOfOverlap(rect1,rect2,rect=True):\n #return the size of intersection area of rect1 and rect2\n if rect:\n rect1 = Polygon(cv2.boxPoints(tuple(rect1)))\n rect2 = P... | [
[
"numpy.int0",
"numpy.dot",
"numpy.linalg.inv",
"numpy.ones",
"numpy.concatenate",
"numpy.argsort",
"numpy.array",
"numpy.sum"
]
] |
tealeeseng/ros2learn | [
"1cee021f8a956d412c82cfddf570b9225625ce87"
] | [
"algorithms/baselines/baselines/ppo1/pposgd_simple.py"
] | [
"from baselines.common import Dataset, explained_variance, fmt_row, zipsame\nfrom baselines import logger\nimport baselines.common.tf_util as U\nimport tensorflow as tf, numpy as np\nimport time\nfrom baselines.common.mpi_adam import MpiAdam\nfrom baselines.common.mpi_moments import mpi_moments\nfrom mpi4py import ... | [
[
"tensorflow.clip_by_value",
"tensorflow.get_default_session",
"tensorflow.train.latest_checkpoint",
"tensorflow.reduce_mean",
"tensorflow.minimum",
"tensorflow.assign",
"tensorflow.placeholder",
"tensorflow.train.import_meta_graph",
"numpy.append",
"numpy.std",
"numpy.m... |
bwhitesell/SpyNN | [
"52ade7c9f54fa81abc6f6d9133ecccafed69e5dc"
] | [
"spyne/operations/elements.py"
] | [
"import numpy as np\n\nfrom .base import UniTensorOperation\nfrom .utils import nest_func\n\n\nclass TensorSum(UniTensorOperation):\n name = 'Tensor Sum'\n\n def execute(self):\n return self._a.sum()\n\n def vector_jacobian_product(self, func=lambda g: g):\n internal_shape = self._a.shape\n\n... | [
[
"numpy.square",
"numpy.log",
"numpy.ones",
"numpy.exp",
"numpy.sum",
"numpy.divide"
]
] |
davidrojas/lyngspice | [
"e179c35a196ae156487def0365ba28d4e73de95f"
] | [
"examples/example_montecarlo.py"
] | [
"# -*- coding: utf-8 -*-\r\n\"\"\"Example of AC analysis with random variables (Monte Carlo)\r\n\r\nThis example generates a netlist as a function of three parameters: two resistances and once capacitance.\r\nThe resulting circuit is a non-inverting amplifier with a low-pass capacitor\r\n\r\nThis function is called... | [
[
"numpy.abs",
"matplotlib.pyplot.title",
"matplotlib.pyplot.semilogx",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.draw",
"matplotlib.pyplot.ylabel",
"numpy.random.normal",
"matplotlib.pyplot.grid",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.xticks",
"matplotlib.... |
hvdthong/gated-graph-neural-network-samples | [
"7d375967caedab1060bd94164a7c442b77c338f5"
] | [
"chem_tensorflow.py"
] | [
"#!/usr/bin/env/python\n\nfrom typing import Tuple, List, Any, Sequence\n\nimport tensorflow as tf\nimport time\nimport os\nimport json\nimport numpy as np\nimport pickle\nimport random\n\nfrom utils import MLP, ThreadedIterator, SMALL_NUMBER\n\n\nclass ChemModel(object):\n @classmethod\n def default_params(c... | [
[
"tensorflow.reduce_sum",
"tensorflow.variables_initializer",
"tensorflow.train.AdamOptimizer",
"tensorflow.Graph",
"tensorflow.ConfigProto",
"tensorflow.clip_by_norm",
"tensorflow.name_scope",
"tensorflow.Session",
"tensorflow.square",
"tensorflow.placeholder",
"tensorf... |
Susanne-ICDS/gsd-designer | [
"68ca61a8c87b74d47f3c9399b95cb0812a57578d"
] | [
"statistical_parts/math_parts/t_test_functions.py"
] | [
"import numpy as np\nfrom scipy.stats import norm\nfrom scipy.stats import t\nfrom scipy.stats import nct\nfrom scipy.optimize import root_scalar\n\n\ndef simulate_statistics(n_simulations, sample_sizes, memory_limit, cohens_d, sides):\n \"\"\" Simulate test statistics for an independent groups t-test\n\n Sim... | [
[
"scipy.stats.norm.ppf",
"numpy.absolute",
"numpy.asarray",
"numpy.reshape",
"numpy.isnan",
"scipy.stats.nct.cdf",
"numpy.cumsum",
"numpy.ones",
"scipy.stats.t.ppf",
"numpy.ceil",
"numpy.random.normal",
"scipy.stats.nct.ppf",
"numpy.max",
"scipy.stats.t.cdf",... |
baobabtr33/M-Robo-1st-Project | [
"2454a6c0f5cbaa97b27f44d9aad6e1df7a1e6877"
] | [
"mFinance.py"
] | [
"import pandas as pd\nimport requests\nfrom bs4 import BeautifulSoup\nimport traceback\nfrom datetime import datetime, timedelta\nimport mLog\nimport logging.config\n\n\ndef parse_naver_page(code, page):\n \"\"\"\n 네이버 페이지 주식 데이터 파싱\n\n params:\n code : 종목 코드\n page : 종목 주식 페이지\n\n return:... | [
[
"pandas.concat"
]
] |
crissthiandi/Victoria | [
"2d7e3621b472146a262745900ab143ba18ba0340"
] | [
"victoriaepi/ama.py"
] | [
"#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\n\n\"\"\"\n\nimport sys\n\nimport numpy as np\nimport scipy.stats as ss\nfrom scipy import integrate\nimport matplotlib.pyplot as plt\n\nfrom . import victoria\nfrom . import pytwalk\nimport pickle\n\n\n\ndef odeint( rhs, X0, t_quad, args):\n \"\"\"\n S... | [
[
"numpy.dot",
"numpy.cumsum",
"scipy.integrate.odeint",
"numpy.max",
"scipy.stats.uniform.rvs",
"scipy.stats.gamma.logpdf",
"numpy.where",
"scipy.stats.lognorm.logpdf",
"numpy.arange",
"scipy.stats.nbinom.logpmf",
"numpy.diff",
"numpy.zeros",
"matplotlib.pyplot.f... |
christen-gauker/Precipitable-Water-Model | [
"50624e3a1641b744c21753d3c0e7d348f3e5d5eb"
] | [
"src/util/tests/diag.py"
] | [
"# Diagnostic Algthm\nimport csv\nimport sys\nimport datetime\nfrom numpy import *\nfrom datetime import date as dte\nfrom datetime import datetime as dt\nimport pandas as pd\nsys.path.append(\"./archive\")\nfrom mesowest import WyomingUpperAir, MesoWest\nimport time\nimport os\nimport requests\nimport pprint as pp... | [
[
"pandas.to_datetime"
]
] |
EGGS-Experiment/EGGS_Control | [
"c29b3ab0e30dcb6e01d1ca3212ac64ad1506143b"
] | [
"EGGS_labrad/scripts/other/rga_continuous_measure.py"
] | [
"# connect to labrad\nimport labrad\ncxn = labrad.connect()\n\n# general import\nfrom numpy import arange\nfrom time import time, sleep\nstart_time = time()\n\n# get servers\nrga = cxn.rga_server\ndv = cxn.data_vault\ncr = cxn.context()\n\n# parameters\n(mass_initial, mass_final, mass_steps) = (39, 41, 2)\ndv_dep_v... | [
[
"numpy.arange"
]
] |
johntsi/preast_qa | [
"e95fb167f4fdeb8868fed935f88493450ea10ddd"
] | [
"models/multi_src_pointer_gen.py"
] | [
"import torch\nfrom torch import nn\nimport torch.nn.functional as F\n\nfrom attention import CombinedAttention, AdditiveAttention\n\n\nclass QaMultiSrcPointerGen(nn.Module):\n\t\"\"\"\n\tMulti-Source Pointer-Generator network for generating the answer sequence.\n\tThe idea is similar to the one introduced in the \... | [
[
"torch.nn.Softmax",
"torch.nn.functional.softmax",
"torch.ones",
"torch.cat",
"torch.matmul",
"torch.nn.Linear",
"torch.mul",
"torch.split",
"torch.nn.functional.one_hot"
]
] |
stephen-w-bailey/fast-n-deep-faces | [
"53173c6367dfa3a20d3193ad7a0e77ac1e898f02",
"53173c6367dfa3a20d3193ad7a0e77ac1e898f02"
] | [
"PoseGenerator.py",
"render/scene.py"
] | [
"import logging\ntry:\n import maya.api.OpenMaya as om\n import pymel\n import pymel.core\n usingMaya = True\nexcept:\n logging.warning('PoseGenerator not running in maya')\n usingMaya = False\nimport functools\nimport numpy as np\nimport random\nimport socket\nimport struct\nimport time\n\nclass ... | [
[
"numpy.square",
"numpy.asarray",
"numpy.dtype",
"numpy.stack",
"numpy.concatenate",
"numpy.logical_or",
"numpy.frombuffer",
"numpy.mean",
"numpy.repeat",
"numpy.array",
"numpy.zeros",
"numpy.sum"
],
[
"numpy.asarray"
]
] |
BjoernMayer92/Signal-to-Noise-Paradox-in-the-Lorenz-Model | [
"7b6e74ecf984d5b33842ccacf0a4b31bdff5bc22"
] | [
"src/modules/general.py"
] | [
"import numpy as np\n\n\ndef latex_export_variable(mean, meanstd, filename, significant_digits=2):\n # takes a value and its standard deviation calculates the significant digits and exports the variable into a textfile in latex format such that it can be input in a tex file\n \n total_digits = - (int(np.lo... | [
[
"numpy.log10"
]
] |
cuiboyuan/plato | [
"260b785cbbf8588c92331d6343211ff72321f90e",
"260b785cbbf8588c92331d6343211ff72321f90e",
"260b785cbbf8588c92331d6343211ff72321f90e"
] | [
"plato/config.py",
"plato/samplers/all_inclusive.py",
"plato/models/multimodal/fusion_net.py"
] | [
"\"\"\"\nReading runtime parameters from a standard configuration file (which is easier\nto work on than JSON).\n\"\"\"\nimport argparse\nimport logging\nimport os\nimport random\nimport sqlite3\nfrom collections import OrderedDict, namedtuple\n\nimport yaml\nfrom yamlinclude import YamlIncludeConstructor\n\n\nclas... | [
[
"torch.cuda.device_count",
"tensorflow.config.experimental.list_physical_devices",
"torch.distributed.is_available",
"torch.cuda.is_available"
],
[
"torch.utils.data.SubsetRandomSampler"
],
[
"torch.zeros",
"torch.cat"
]
] |
I4-Projektseminar-HHU-2016/seminar-project-BrainWasheD | [
"d301a357d45ee8bb62bafd45dd82d3f5cba8153b"
] | [
"percentages.py"
] | [
"import re\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom os import path\nfrom matplotlib import cm\n\n\nclass percs(object):\n def __init__(self):\n return\n\n def percent(self, tweets, mentions, mtcount):\n\n print ('creating mention graphs...')\n #Counting Tweets that conta... | [
[
"matplotlib.pyplot.tight_layout",
"numpy.arange",
"matplotlib.pyplot.close",
"matplotlib.pyplot.axis",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.figure"
]
] |
jsyoo61/tools | [
"bba8bfe69f87c8111d8b82c90a65a71b6996f9b4"
] | [
"tools/torch/layers.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\nclass attention(nn.Module):\n def __init__(self, dim=1):\n super(att_pool, self).__init__()\n self.attention = nn.softmax()\n\n\n def forward(self, x):\n return x*self.attention(x)\n"
] | [
[
"torch.nn.softmax"
]
] |
earthobservatory/isce2 | [
"655c46cc4add275879167b750a5e91f6d00f168e"
] | [
"components/isceobj/TopsProc/runVerifyDEM.py"
] | [
"#\n# Author: Piyush Agram\n# Copyright 2016\n#\n\nimport logging\nimport isceobj\nimport mroipac\nfrom isceobj.Util.ImageUtil import DemImageLib\nimport os\nimport numpy as np\n\nlogger = logging.getLogger('isce.insar.VerifyDEM')\n\nclass INFO:\n def __init__(self, snwe):\n self.extremes = snwe\n def ... | [
[
"numpy.ceil",
"numpy.floor"
]
] |
Axel-Jacobsen/opentrons | [
"c543d95c25003f2e784560efaa6a91f051d4cd33"
] | [
"api/src/opentrons/hardware_control/robot_calibration.py"
] | [
"import logging\nimport numpy as np # type: ignore\nfrom dataclasses import dataclass\nfrom typing import Optional, List\n\nfrom opentrons import config\nfrom opentrons.config import robot_configs, feature_flags as ff\nfrom opentrons.calibration_storage import modify, types, get\nfrom opentrons.types import Mount\... | [
[
"numpy.linalg.matrix_rank",
"numpy.array_equal",
"numpy.put",
"numpy.ma.masked_array",
"numpy.array",
"numpy.zeros"
]
] |
Kabongosalomon/examples | [
"c4bdf77ca3687c4a43ae3f50f78f63f041f1a0c8"
] | [
"word_language_model/main.py"
] | [
"# coding: utf-8\nimport argparse\nimport time\nimport math\nimport os\nimport torch\nimport torch.nn as nn\nimport torch.onnx\n\nimport data\nimport model\n\nparser = argparse.ArgumentParser(description='PyTorch Wikitext-2 RNN/LSTM/GRU/Transformer Language Model')\nparser.add_argument('--data', type=str, default='... | [
[
"torch.nn.NLLLoss",
"torch.onnx.export",
"torch.LongTensor",
"torch.load",
"torch.manual_seed",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"torch.save"
]
] |
pkgpl/TorchWI | [
"772f2f26b2faf7487a1eec6b1c4821ebaf6dd44f"
] | [
"torchwi/propagator/td2d_numba.py"
] | [
"import torch\nimport numpy as np\nfrom . import td2d_base\n\ndef get_fdm(ne):\n if ne == 1:\n _fdm = td2d_base.fdm_o2\n elif ne == 2:\n _fdm = td2d_base.fdm_o4\n elif ne == 4:\n _fdm = td2d_base.fdm_o8\n else:\n raise NotImplementedError(\"Wrong order: use 2, 4, and 8\")\n ... | [
[
"numpy.zeros_like",
"torch.from_numpy"
]
] |
Ethanator/pandas | [
"229722e6a24b9658a27fc06b617701ad02aaa435"
] | [
"pandas/io/excel/_odfreader.py"
] | [
"from typing import List, cast\n\nimport numpy as np\n\nfrom pandas._typing import FilePathOrBuffer, Scalar, StorageOptions\nfrom pandas.compat._optional import import_optional_dependency\n\nimport pandas as pd\n\nfrom pandas.io.excel._base import BaseExcelReader\n\n\nclass ODFReader(BaseExcelReader):\n \"\"\"\n... | [
[
"pandas.to_datetime",
"pandas.compat._optional.import_optional_dependency"
]
] |
analyticFolk/detectron2 | [
"dbd209a892efb4a72af88abb8d36b687dd0bbc3a"
] | [
"detectron2/modeling/backbone/inception.py"
] | [
"from __future__ import print_function, division, absolute_import\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\n\nfrom detectron2.layers import (\n ShapeSpec,\n)\n\nfrom .backbone import Backbone\nfrom .build import BACKBONE_REGISTRY\n\nclass Ba... | [
[
"torch.cat",
"torch.nn.functional.avg_pool2d",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.Linear",
"torch.nn.AvgPool2d",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU",
"torch.nn.functional.pad"
]
] |
YinlinHu/DANN | [
"13a529521aa084b14249566e6f545e72d51089fd"
] | [
"train/main.py"
] | [
"import random\nimport os\nimport torch.backends.cudnn as cudnn\nimport torch.optim as optim\nimport torch.utils.data\n\nimport sys\nsys.path.append('../')\n\nfrom dataset.data_loader import GetLoader\nfrom torchvision import datasets\nfrom torchvision import transforms\nfrom models.model import CNNModel\nimport nu... | [
[
"numpy.exp"
]
] |
Deltares/xugrid | [
"41881977e5e49d0f87a90dd995960283b812b921"
] | [
"tests/test_plot.py"
] | [
"import matplotlib.pyplot as plt\nimport numpy as np\nimport pytest\nimport xarray as xr\nfrom matplotlib.collections import LineCollection, PathCollection, PolyCollection\nfrom matplotlib.image import AxesImage\nfrom matplotlib.tri import TriContourSet\n\nimport xugrid\nfrom xugrid.plot import plot\n\n\nclass Test... | [
[
"matplotlib.pyplot.gca",
"numpy.allclose",
"matplotlib.pyplot.subplots",
"matplotlib.pyplot.close",
"matplotlib.pyplot.figure"
]
] |
tylee33/nlp-tensorflow | [
"57b2acca931799f9102d593327716cfcfe703886"
] | [
"02-nlp_application/01-Sentiment/model.py"
] | [
"import tensorflow as tf\n\nclass CNN(object):\n \"\"\"\n The implementation is based on following:\n dennybritz: simplified implementation of Kim's Convolutional Neural Networks for Sentence Classification paper in Tensorflow.\n \"\"\"\n\n def __init__(\n self, sess, vocab_size, sequence_... | [
[
"tensorflow.concat",
"tensorflow.nn.max_pool",
"tensorflow.equal",
"tensorflow.cast",
"tensorflow.train.AdamOptimizer",
"tensorflow.nn.conv2d",
"tensorflow.Variable",
"tensorflow.train.exponential_decay",
"tensorflow.contrib.layers.xavier_initializer",
"tensorflow.argmax",
... |
redsnappper/pytorch_advanced | [
"b6004ef951a998069c9e60ef01cfcaa6cc359220"
] | [
"3_semantic_segmentation/networkModel_.py"
] | [
"import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.nn.modules import module\n\nclass PSPNet(nn.Module):\n def __init__(self, n_classes):\n super(PSPNet, self).__init__()\n\n block_config = [3, 4, 6, 3]\n img_size = 475\n img_size_8 = 60\n\n self.f... | [
[
"torch.nn.Dropout2d",
"torch.cat",
"torch.nn.Conv2d",
"torch.nn.MaxPool2d",
"torch.nn.AdaptiveAvgPool2d",
"torch.rand",
"torch.nn.functional.interpolate",
"torch.nn.BatchNorm2d",
"torch.nn.ReLU"
]
] |
maxyang27896/mbrl-lib | [
"4543fc929321fdd6e6522528c68e54d822ad2a6a",
"4543fc929321fdd6e6522528c68e54d822ad2a6a"
] | [
"mbrl/models/model.py",
"mbrl/third_party/pytorch_sac_pranz24/sac.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 abc\nimport pathlib\nfrom typing import Any, Dict, Optional, Sequence, Tuple, Union\n\nimport torch\nfrom ... | [
[
"torch.device",
"torch.sqrt",
"torch.normal",
"torch.no_grad"
],
[
"torch.optim.Adam",
"torch.Tensor",
"torch.load",
"torch.zeros",
"torch.min",
"torch.tensor",
"torch.nn.functional.mse_loss",
"torch.no_grad",
"torch.FloatTensor"
]
] |
mtzl/altair | [
"e3cbb602475f5f2812f64371a041eceddb92f73f"
] | [
"altair/vegalite/v2/examples/multiline_tooltip.py"
] | [
"\"\"\"\nMulti-Line Tooltip\n==================\nThis example shows how you can use selections and layers to create a multi-line tooltip\nthat tracks the x position of the cursor.\n\"\"\"\n# category: interactive\n\nimport altair as alt\nimport pandas as pd\nimport numpy as np\n\nnp.random.seed(42)\ndata = pd.DataF... | [
[
"pandas.RangeIndex",
"numpy.random.randn",
"numpy.random.seed"
]
] |
rojithakamal/functions | [
"3c13cd63fba38fa45523969295d9ece105522000"
] | [
"iotfunctions/metadata.py"
] | [
"# *****************************************************************************\n# © Copyright IBM Corp. 2018. All Rights Reserved.\n#\n# This program and the accompanying materials\n# are made available under the terms of the Apache V2.0\n# which accompanies this distribution, and is available at\n# http://www.... | [
[
"pandas.to_datetime",
"pandas.Grouper",
"pandas.Timedelta",
"pandas.DatetimeIndex",
"pandas.DataFrame",
"pandas.to_timedelta"
]
] |
yelongshen/ogb | [
"293790ee77576375b40a3c7e0ead15be466963fe"
] | [
"examples/graphproppred/ppa/main_pyg.py"
] | [
"import torch\nfrom torch_geometric.data import DataLoader\nimport torch.optim as optim\nimport torch.nn.functional as F\nfrom gnn import GNN, GAT\n\nfrom tqdm import tqdm\nimport argparse\nimport time\nimport numpy as np\n\nimport torch.nn.functional as F\nfrom util import AverageMeter\nfrom progress.bar import Ba... | [
[
"torch.nn.CrossEntropyLoss",
"torch.zeros",
"torch.cat",
"torch.tensor",
"torch.no_grad",
"torch.cuda.is_available",
"torch.device",
"numpy.array",
"torch.nn.functional.pad",
"torch.save"
]
] |
Ellie-Yen/demo_project | [
"49151b452e5e4fcc70c4e22ebd2519e330ade49d"
] | [
"Game/sudoku/sudoku.py"
] | [
"\"\"\"\nElie Yen\nPython 3\nSudoku creator, solver and validator v2\n\"\"\"\nimport numpy as np\n\nclass Sudoku:\n\n @classmethod\n def __backtracking__ (cls, board, cols, box, places, mode = False):\n '''\n core program to create/ solve a sudoku by in-place modify\n cols and box: dict, ... | [
[
"numpy.arange",
"numpy.array",
"numpy.zeros",
"numpy.random.default_rng"
]
] |
Devot1on/gammapy | [
"6a5255cd7221f50079d36250888ca8cc763ebaf7"
] | [
"gammapy/maps/tests/test_hpxnd.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport pytest\nimport numpy as np\nfrom numpy.testing import assert_allclose\nfrom astropy import units as u\nfrom astropy.coordinates import SkyCoord\nfrom astropy.io import fits\nfrom regions import CircleSkyRegion\nfrom gammapy.maps import HpxGeom... | [
[
"numpy.ones_like",
"numpy.logspace",
"numpy.arange",
"numpy.ones",
"numpy.max",
"numpy.nansum",
"numpy.testing.assert_allclose",
"numpy.random.uniform",
"numpy.sum"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.