repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
TianWuYuJiangHenShou/horovod_pretraining
[ "c05b282ad0710521fbea237bad905470b25ddfc3" ]
[ "run_classifier_hvd.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Google AI Language Team 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# Unl...
[ [ "tensorflow.io.TFRecordWriter", "tensorflow.compat.v1.metrics.mean", "tensorflow.nn.log_softmax", "tensorflow.reduce_sum", "tensorflow.cast", "tensorflow.distribute.cluster_resolver.TPUClusterResolver", "tensorflow.compat.v1.zeros_initializer", "tensorflow.compat.v1.train.Scaffold"...
DengBoCong/text-sim
[ "2c6c323649aa259a7b3d5c6d3714bd1860114826" ]
[ "sim/bert_base/torch/transformers/modeling_nezha.py" ]
[ "#! -*- coding: utf-8 -*-\n\"\"\" NeZha Model, Base Transformers\n\"\"\"\n# Author: DengBoCong <bocongdeng@gmail.com>\n# https://arxiv.org/pdf/1909.00204.pdf\n#\n# License: MIT License\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport copy\ni...
[ [ "torch.nn.Softmax", "torch.zeros", "torch.nn.Embedding", "torch.t", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.ones", "torch.sqrt", "torch.tensor", "torch.arange", "numpy.zeros", "torch.ones_like", "torch.sigmoid", "numpy.power", "torch.zero...
naver-ai/neuralwoz
[ "89f10904256c0df33e14c05e8581421d52b63105" ]
[ "SUMBT/code/BeliefTrackerSlotQueryMultiSlot.py" ]
[ "import os.path\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom torch.nn import CrossEntropyLoss\nfrom torch.nn import CosineEmbeddingLoss\n\nfrom pytorch_pretrained_bert.modeling import BertModel\nfrom pytorch_pretrained_bert.modeling import BertPreTrainedModel\n\nclass B...
[ [ "torch.nn.functional.softmax", "torch.max", "torch.cat", "torch.zeros", "torch.nn.GRU", "torch.sum", "torch.nn.Embedding", "torch.nn.Embedding.from_pretrained", "torch.nn.PairwiseDistance", "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.nn.CosineSimilarity"...
domrim/bachelorarbeit-code
[ "56df0e2ab9b91c76a0f3f25d745316863ee4f275" ]
[ "jupyter-notebooks/eval/steps_sweep_error_bpsk.py" ]
[ "#!/usr/bin/env python3\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport tikzplotlib\n\nget_ipython().run_line_magic('run', \"'./../split_step_fourier.ipynb'\")\nDEBUG = False\n\n# showing figures inline\nget_ipython().run_line_magic('matplotlib', 'inline')\n# plotting options \nfigure_size = (16, 9)\...
[ [ "numpy.square", "numpy.amax", "numpy.amin", "numpy.arange", "matplotlib.pyplot.rcParams.update", "matplotlib.pyplot.figure" ] ]
victorkich/MA-GRID
[ "386e323796b80ed8dac027e916e15a4fa3bf45ef" ]
[ "ddpg.py" ]
[ "import pickle\nimport numpy as np\nimport torch\nimport torch.optim as optim\nfrom ddpg_step import ddpg_step\nfrom models.Policy_ddpg import Policy\nfrom models.Value_ddpg import Value\nfrom replay_memory import Memory\nfrom torch.utils.tensorboard import SummaryWriter\nfrom utils.file_util import check_path\nfro...
[ [ "numpy.random.seed", "numpy.clip", "torch.manual_seed", "torch.cuda.empty_cache", "torch.no_grad", "torch.utils.tensorboard.SummaryWriter", "numpy.random.randn" ] ]
soominok/cheese-api
[ "6188b114c89f5aa0f83d92d25e7a5ebda379805e" ]
[ "com_cheese_api/cop/ord/order/model/order_service.py" ]
[ "import os\n\nfrom com_cheese_api.util.file_handler import FileReader\nimport pandas as pd\nimport numpy as np\nfrom sklearn.ensemble import RandomForestClassifier # rforest\nfrom sklearn.tree import DecisionTreeClassifier # dtree\nfrom sklearn.naive_bayes import GaussianNB # nb(Naive Bayes)\nfrom sklearn.neighbors...
[ [ "pandas.concat", "sklearn.naive_bayes.GaussianNB", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "sklearn.model_selection.KFold", "sklearn.neighbors.KNeighborsClassifier", "sklearn.tree.DecisionTreeClassifier", "numpy.mean", "pandas.cut", "sklearn.svm.SVC",...
tueimage/meta-segmentation-msc-2018
[ "d497e6ea99b89fdb54e11568452894f022269043" ]
[ "archive/metafeature_extraction/meta_get_features.py" ]
[ "from MetaFeatureExtraction import MetaFeatureExtraction\nfrom tqdm import tqdm\nimport numpy as np\nimport os\nfrom keras.applications.vgg19 import VGG19\nfrom keras.models import Model, model_from_json\nfrom networks import EncoderDecoderNetwork\nfrom keras.applications.mobilenet import relu6\nos.environ[\"CUDA_V...
[ [ "numpy.zeros" ] ]
ashutoshvarma/scipy
[ "46de4f0851991109c83592ee9e8dc59eb6541470" ]
[ "scipy/stats/tests/test_continuous_basic.py" ]
[ "import pickle\nimport numpy as np\nimport numpy.testing as npt\nimport pytest\nfrom pytest import raises as assert_raises\nfrom scipy.integrate import IntegrationWarning\n\nfrom scipy import stats\nfrom scipy.special import betainc\nfrom. common_tests import (check_normalization, check_moment, check_mean_expect,\n...
[ [ "numpy.sqrt", "scipy.stats.rv_histogram", "scipy.stats.reciprocal.cdf", "numpy.all", "numpy.histogram", "numpy.testing.suppress_warnings", "numpy.testing.assert_almost_equal", "numpy.diff", "scipy.special.betainc", "numpy.zeros", "numpy.testing.assert_array_almost_equal...
Edison1847/Mask_RCNN_Thy
[ "af8e9a97121825a12601f56cc4d57cd4e08ffcc0" ]
[ "samples/demo2.py" ]
[ "import os\nimport sys\nimport random\nimport math\nimport numpy as np\nimport skimage.io\nimport time\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport cv2\n\n# Root directory of the project\nROOT_DIR = os.path.abspath(\"../\")\n\n# Import Mask RCNN\nsys.path.append(ROOT_DIR) # To find local version of ...
[ [ "matplotlib.pyplot.imshow", "numpy.concatenate", "numpy.any", "numpy.where", "matplotlib.patches.Polygon", "matplotlib.pyplot.tight_layout", "numpy.unique", "numpy.fliplr", "numpy.arange", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "numpy.zeros", "ma...
choco9966/Semantic-Segmentation-Review
[ "2518a0ca39bf9f6459f8fbf9c8dc26b6572abdf1" ]
[ "DeepLab Semantic Image Segmentation with Deep Convolutional Nets, Atrous Convolution, and Fully Connected CRFs (DeepLabv2) Review/code/DeepLabv2.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn import functional as F\n\"\"\"\nlast few max pooling layers를 없애고, 대신에 이후 convolution layers에 atrous convolution을 함. \nVGG16 or ResNet101 in fully convolutional fashion + using Atrous conv for downsampling\nbilinear interpolation to original resolution\nvgg16 based...
[ [ "torch.nn.Dropout2d", "torch.randn", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.functional.interpolate", "torch.nn.ReLU" ] ]
kastnerkyle/exploring_species_counterpoint
[ "dda762463e64036adeba7efd46c51daaaf906019" ]
[ "pvnet_mcts/generate_buffer_data_net_mcts.py" ]
[ "from net_mcts import NetMCTS\nfrom networks import PolicyValueNetwork\nfrom env_managers import MusicStateManager\nimport numpy as np\nimport torch as th\nfrom torch.autograd import Variable\nimport copy\n\nrandom_state = np.random.RandomState(9)\nmove_validator = MusicStateManager(random_state=random_state)\npv =...
[ [ "torch.load", "numpy.min", "numpy.max", "torch.FloatTensor", "numpy.mean", "numpy.exp", "numpy.random.RandomState" ] ]
dyy0205/VisTR
[ "f1fe95680734f327be262b2a9e6566507ab5608f" ]
[ "net/models/adaptive_avgmax_pool.py" ]
[ "\"\"\" PyTorch selectable adaptive pooling\nAdaptive pooling with the ability to select the type of pooling from:\n * 'avg' - Average pooling\n * 'max' - Max pooling\n * 'avgmax' - Sum of average and max pooling re-scaled by 0.5\n * 'avgmaxc' - Concatenation of average and max pooling along feature dim...
[ [ "torch.nn.AdaptiveMaxPool2d", "torch.cat", "torch.nn.functional.adaptive_avg_pool2d", "torch.nn.functional.adaptive_max_pool2d", "torch.nn.AdaptiveAvgPool2d" ] ]
Parskatt/mmdetection
[ "ee4cfa29e7f479b2454b1f1355f8c05be62d8466" ]
[ "mmdet/models/detectors/base.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nfrom abc import ABCMeta, abstractmethod\nfrom collections import OrderedDict\n\nimport mmcv\nimport numpy as np\nimport torch\nimport torch.distributed as dist\nfrom mmcv.runner import BaseModule, auto_fp16\n\nfrom mmdet.core.visualization import imshow_det_bboxes\n...
[ [ "torch.distributed.all_reduce", "torch.distributed.is_initialized", "numpy.stack", "numpy.full", "numpy.concatenate", "torch.distributed.is_available", "torch.stack", "torch.distributed.get_rank", "torch.distributed.get_world_size", "torch.onnx.is_in_onnx_export", "nump...
xssstory/STAS
[ "ba4286e839069e43c2eac95d14a5f2816d90332e", "ba4286e839069e43c2eac95d14a5f2816d90332e" ]
[ "fairseq/tasks/extractive_summarization_recovery_dev.py", "fairseq/models/extract_sum_roberta_long_transformer_rank.py" ]
[ "\r\nimport os\r\nimport numpy as np\r\nimport torch\r\nfrom fairseq import options\r\nfrom fairseq.data import (\r\n data_utils, GPT2Dictionary, FlexibleDictionary, LanguagePairDataset, indexed_dataset,\r\n # ExtractSumRecoveryDataset,\r\n IndexedRawTextDataset,\r\n IndexedCachedDataset,\r\n)\r\nfrom f...
[ [ "torch.serialization.default_restore_location", "numpy.random.RandomState", "torch.cuda.empty_cache" ], [ "torch.linspace", "torch.ones", "torch.nn.functional.dropout", "torch.nn.init.constant_", "torch.nn.ModuleList", "torch.arange", "torch.nn.Embedding", "torch.nn...
matthew-frank/training
[ "dc72f48cc5279f80e8e1736d0756c83f9e3cf116" ]
[ "single_stage_detector/ssd/model/transform.py" ]
[ "import math\nimport torch\nimport torchvision\n\nfrom torch import nn, Tensor\nfrom typing import List, Tuple, Dict, Optional\n\nfrom model.image_list import ImageList\nfrom model.roi_heads import paste_masks_in_image\n\n\n@torch.jit.unused\ndef _get_shape_onnx(image: Tensor) -> Tensor:\n from torch.onnx import...
[ [ "torch._C._get_tracing_state", "torch.empty", "torch.onnx.operators.shape_as_tensor", "torch.tensor", "torch.nn.functional.interpolate", "torch.stack", "torch.as_tensor" ] ]
J-bytes/Epidemiologic-simulation
[ "1a1b4d8744a3ba2bdbe3bdc900694704bf82d61a" ]
[ "app.py" ]
[ "# -*- coding: utf-8 -*-\n\n\n\n#========================================================================================\n#Importation des modules\nimport dash\n\n\nimport dash_core_components as dcc\nimport dash_html_components as html\nimport pandas as pd\n\nfrom dash.dependencies import Input, Output\nimport da...
[ [ "pandas.read_csv", "numpy.sqrt", "pandas.DataFrame", "numpy.std", "numpy.mean", "numpy.argmin", "numpy.zeros" ] ]
jyqi/mx-viddet
[ "af89ed736362fecdd1ee5e6584d9b221c59ff8c4" ]
[ "rfcn/core/DataParallelExecutorGroup.py" ]
[ "# --------------------------------------------------------\n# Deep Feature Flow\n# Copyright (c) 2016 by Contributors\n# Copyright (c) 2017 Microsoft\n# Licensed under The Apache-2.0 License [see LICENSE for details]\n# Modified by Yuwen Xiong\n# --------------------------------------------------------\n\nimport l...
[ [ "numpy.prod" ] ]
MartimQS/Deep-MVLM
[ "b01b5f44f423f236e94741d94a7a3628240123dd" ]
[ "utils3d/utils3d.py" ]
[ "import numpy as np\nimport vtk\nimport os\n\n\nclass Utils3D:\n def __init__(self, config):\n self.config = config\n self.heatmap_maxima = None\n self.transformations_3d = None\n self.lm_start = None\n self.lm_end = None\n self.landmarks = None\n self.logger = co...
[ [ "numpy.multiply", "numpy.quantile", "numpy.linalg.norm", "numpy.ones", "numpy.linalg.pinv", "numpy.copy", "numpy.transpose", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.loadtxt" ] ]
MayankShrivastava17/opencv-operation-on-image
[ "c5ade8fa527ad05d99b65016678d8d25db201132" ]
[ "denoiseOfColor.py" ]
[ "import numpy as np\nimport cv2 as cv \nfrom matplotlib import pyplot as plt\n\nimg = cv.imread(\"dog.jpg\")\n\ndst = cv.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 15)\n\nplt.subplot(121), plt.imshow(img)\nplt.subplot(122), plt.imshow(dst)\n\nplt.show()\n" ]
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.subplot" ] ]
Zumo09/Feedback-Prize
[ "e7e7343a81bfec2f5b187f2266154da0bbe48fb9" ]
[ "engine.py" ]
[ "from collections import deque\nfrom datetime import datetime\nimport math\nfrom pathlib import Path\nimport sys\nfrom tqdm import tqdm\nfrom typing import Optional\n\nimport torch\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard.writer import SummaryWriter\n\nfrom models import CriterionDETR,...
[ [ "torch.no_grad", "torch.cat", "torch.ones", "torch.zeros" ] ]
josancamon19/facial_keypoint_detection
[ "c0ae09a54c5f4e1ab4f3e4aa669523fbeb53a045" ]
[ "models.py" ]
[ "## TODO: define the convolutional neural network architecture\n\nimport torch\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\n# can use the below import should you choose to initialize the weights of your Net\nimport torch.nn.init as I\n\n\nclass Net(nn.Module):\n\n ...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Conv2d", "torch.nn.functional.dropout" ] ]
jellis18/courses
[ "8fa995169e20ef89a4cf30a585ed28564616ded5" ]
[ "deeplearning1/nbs/utils.py" ]
[ "from __future__ import division,print_function\nimport math, os, json, sys, re\ntry:\n import cPickle as pickle\nexcept ModuleNotFoundError:\n import pickle\nfrom glob import glob\nimport numpy as np\nfrom matplotlib import pyplot as plt\nfrom operator import itemgetter, attrgetter, methodcaller\nfrom collec...
[ [ "matplotlib.pyplot.text", "numpy.rollaxis", "matplotlib.pyplot.imshow", "matplotlib.pyplot.yticks", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.title", "numpy.clip", "numpy.set_printoptions", "numpy.concatenate", "matplotlib.pyplot.colorbar", "matplotlib.pyplot...
freedomkite/easytext
[ "ef83261a366bd8d7c259aa112da14f3fa7cdf918" ]
[ "event/event_detection_without_tirgger/tests/test_metric.py" ]
[ "#!/usr/bin/env python 3\n# -*- coding: utf-8 -*-\n\n#\n# Copyright (c) 2020 PanXu, Inc. All Rights Reserved\n#\n\"\"\"\n测试 metric\n\nAuthors: panxu(panxu@baidu.com)\nDate: 2020/06/17 09:35:00\n\"\"\"\nimport logging\nimport pytest\n\nimport torch\n\nfrom easytext.tests import ASSERT\nfrom easytext.data import V...
[ [ "torch.tensor" ] ]
eejbyfeldt/spark
[ "5edbbd1711402735623fa1fc9b86ff41c28996e9" ]
[ "python/pyspark/pandas/data_type_ops/num_ops.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...
[ [ "numpy.dtype" ] ]
RickyDoge/WFGN
[ "88c70ad623f370fa76eb0b75a452c8f2c527ca6e" ]
[ "autoencoder/decoder.py" ]
[ "import torch\nfrom torch import nn\n\n\nclass AEDecoder(nn.Module):\n def __init__(self, encoder):\n super(AEDecoder, self).__init__()\n self.decoder = nn.ModuleList()\n for module in reversed(encoder.encoder):\n if isinstance(module, nn.Conv2d):\n self.decoder.app...
[ [ "torch.nn.ConvTranspose2d", "torch.nn.MaxUnpool2d", "torch.nn.ModuleList", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
AJueling/melt
[ "3b55d7b021f67f56d5c7503ccc5a1670acc45591" ]
[ "src/advect.py" ]
[ "import numpy as np\nimport xarray as xr\nimport matplotlib.pyplot as plt\nfrom tqdm.autonotebook import tqdm\n\n\nzgl = r'$z_{gl}(x,y)'\n\ndef advect_grl(ds, eps, T, verbose=True, plots=True):\n \"\"\" function to advect grounding line depth as described in Pelle at al (2019) \n using centered finite differe...
[ [ "matplotlib.pyplot.axhline", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
aouyang1/covid-jhu
[ "6c03cc5813e2e8fe9aacf123e0e0fd321b0a0e55" ]
[ "study.py" ]
[ "import pandas as pd\nimport requests\nimport io\nimport os\n\nfrom sqlalchemy import create_engine\n\ndef init_sql_conn():\n user = \"root\"\n host = os.getenv('MYSQL_HOST')\n db = \"covid\"\n engine = create_engine(f'mysql://{user}@{host}/{db}')\n conn = engine.connect()\n return conn\n\nif __na...
[ [ "pandas.merge", "pandas.to_datetime", "pandas.DataFrame" ] ]
matham/glitter2
[ "ebede5a18edb1b2e34f1824e4262d01a148cf2f3" ]
[ "examples/add_data_to_data_file.py" ]
[ "\"\"\"Demo example file that shows how to add or duplicate data channels in a\nNixIO Glitter2 h5 file.\n\"\"\"\n\nimport nixio\nfrom glitter2.storage.data_file import DataFile\nfrom os.path import join, dirname\nimport shutil\nfrom kivy_garden.painter import PaintCircle\nimport numpy as np\nimport math\n\n# first ...
[ [ "numpy.array" ] ]
AmineKheldouni/Object-Recognition
[ "047367e9506a9f46dae0daaf74404e660176997f" ]
[ "A3 - Bird Classification Challenge/model.py" ]
[ "import numpy as np\nfrom torch import nn\nfrom torchvision import models\n\n\nclass FineTuneModel(nn.Module):\n \"\"\"Model used to test a ResNet50 with finetuning FC layers\"\"\"\n def __init__(self, num_classes):\n super(FineTuneModel, self).__init__()\n # Everything except the last linear la...
[ [ "torch.nn.Linear", "torch.nn.ReLU" ] ]
USF-GT-Molecular-Modeling/hoomd-blue
[ "2ba2f9e60b0320746d21aa8219bfc9df119c053f" ]
[ "hoomd/pytest/test_syncedlist.py" ]
[ "# Copyright (c) 2009-2022 The Regents of the University of Michigan.\n# Part of HOOMD-blue, released under the BSD 3-Clause License.\n\nimport numpy as np\nimport pytest\nfrom hoomd.conftest import BaseListTest, pickling_check\nfrom hoomd.pytest.dummy import DummyOperation, DummySimulation\nfrom hoomd.data.syncedl...
[ [ "numpy.random.default_rng" ] ]
daikon899/PRNU
[ "6ea64c54169f087d66d5e9b17039945145e03ee5" ]
[ "prnu/VDNet/utils.py" ]
[ "#!/usr/bin/env python\n# -*- coding:utf-8 -*-\n# Power by Zongsheng Yue 2019-01-22 22:07:08\n\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Function as autoF\nfrom scipy.special import gammaln\nfrom skimage.measure import compare_psnr, compare_ssim\nfrom skimage import img_as_ubyte\nimport numpy...
[ [ "numpy.linspace", "numpy.arange", "torch.digamma", "numpy.cos", "torch.from_numpy", "numpy.sin", "scipy.special.gammaln", "numpy.exp", "numpy.random.uniform", "numpy.meshgrid", "numpy.zeros" ] ]
femtotrader/alpha_vantage
[ "aea5da8271a983cd12b655b72f8ebfee9fb75233" ]
[ "alpha_vantage/alphavantage.py" ]
[ "try:\n # Python 3 import\n from urllib.request import urlopen\nexcept ImportError:\n # Python 2.* import\n from urllib2 import urlopen\n\nfrom simplejson import loads\nfrom functools import wraps\nimport inspect\nimport pandas\nimport re\n\n\nclass AlphaVantage:\n \"\"\" Base class where the decorat...
[ [ "pandas.DataFrame.from_dict" ] ]
NAnand-TUD/open-moc
[ "1d4808b96366d77e4b8b7b56c3fe0940390b1e18" ]
[ "Tools/MoCTool/srcMOC/CLASSES.py" ]
[ "####################FILE NAME: CLASSES.py#######################\r\n#================================================================\r\n# author: Nitish Anand\t& Jozef Stuijt\t\t\t\t\t\t\t|\r\n# \t:Master Student, \t\t\t\t\t\t\t\t\t\t\t|\r\n#\t:Process and Energy Departmemt,\t\t\t\t\t\t\t\t|\r\n#\t:TU Delft,\t\t\...
[ [ "numpy.arange", "numpy.loadtxt" ] ]
kentnagumo/LoadSeqFile
[ "5d0efbfb9230442ed4813637c0dbb3b366bfa4e3" ]
[ "util/raw.py" ]
[ "import numpy as np\nimport math\n\ndef raw2temp(raw, meta, out_temp, out_rh, distance):\n \"\"\"\n Convert raw pixel values to temperature, if calibration coefficients are known. The\n equations for atmospheric and window transmission are found in Minkina and Dudzik, as \n well as some of FLIR's docume...
[ [ "numpy.log", "numpy.exp", "numpy.sqrt" ] ]
Ahmad1s/FastSpeech2
[ "d31802ffcd74bb2c2ca57b53e481917989ded6b9" ]
[ "utils/model.py" ]
[ "import os\nimport json\n\nimport torch\nimport numpy as np\n\nimport hifigan\nfrom model import FastSpeech2, ScheduledOptim\nimport gdown\n\n\n\ndef get_model(args, configs, device, train=False):\n (preprocess_config, model_config, train_config) = configs\n\n model = FastSpeech2(preprocess_config, model_conf...
[ [ "numpy.log", "torch.hub.load", "torch.no_grad", "torch.load" ] ]
leondz/datasets
[ "4110fb6034f79c5fb470cf1043ff52180e9c63b7" ]
[ "metrics/matthews_correlation/matthews_correlation.py" ]
[ "# Copyright 2021 The HuggingFace Datasets Authors and the current dataset script contributor.\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/licens...
[ [ "sklearn.metrics.matthews_corrcoef" ] ]
losvedir/gtfs_kit
[ "814ae754a8b048455c6c9c8d33b3e3384e79ce9e" ]
[ "tests/test_validators.py" ]
[ "import pandas as pd\n\nfrom .context import gtfs_kit, sample\nfrom gtfs_kit import *\n\n\ndef test_valid_str():\n assert valid_str(\"hello3\")\n assert not valid_str(np.nan)\n assert not valid_str(\" \")\n\n\ndef test_valid_time():\n assert valid_time(\"2:43:00\")\n assert valid_time(\"22:43:00\")\n...
[ [ "pandas.DataFrame" ] ]
JimStearns206/kivy
[ "f6958b4f9871dd2942d4299276fcab45ef73943b" ]
[ "kivy/core/camera/camera_picamera.py" ]
[ "'''\nPiCamera Camera: Implement CameraBase with PiCamera\n'''\n\n#\n# TODO: make usage of thread or multiprocess\n#\n\n__all__ = ('CameraPiCamera', )\n\nfrom math import ceil\n\nfrom kivy.logger import Logger\nfrom kivy.clock import Clock\nfrom kivy.graphics.texture import Texture\nfrom kivy.core.camera import Cam...
[ [ "numpy.empty" ] ]
ageron/addons
[ "c2faddd818280815bd5e47b81742efdfc90e7aaf" ]
[ "tensorflow_addons/seq2seq/beam_search_decoder.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.convert_to_tensor", "tensorflow.concat", "tensorflow.nn.log_softmax", "tensorflow.Assert", "tensorflow.zeros", "tensorflow.stack", "tensorflow.cast", "tensorflow.equal", "tensorflow.minimum", "tensorflow.python.ops.rnn_cell_impl.assert_like_rnncell", "tensor...
surajpaib/vissl
[ "2aea1d73d51e2a5e3fcbfa6b5d025d17c7aaa748" ]
[ "vissl/utils/misc.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport collections\nimport importlib\nimport logging\nimport os\nimport random\nimport sys\nimport tempfile\nimport time\nfrom functo...
[ [ "torch.set_rng_state", "torch.__version__.split", "torch.cat", "torch.no_grad", "torch.cuda.is_available", "torch.cuda.manual_seed_all", "torch.multiprocessing.set_start_method", "numpy.arange", "torch.utils.data.get_worker_info", "numpy.unravel_index", "torch.cuda.set_...
amcdawes/maxwellbloch
[ "48b5301ccfa24704a4240125d377b1448d5591d9", "48b5301ccfa24704a4240125d377b1448d5591d9" ]
[ "maxwellbloch/tests/test_hyperfine.py", "maxwellbloch/tests/test_t_funcs.py" ]
[ "\"\"\" \nUnit tests for the hyperfine module. \n\nThomas Ogden <t@ogden.eu>\n\"\"\"\n\nimport unittest\n\nimport numpy as np\n\nfrom maxwellbloch import hyperfine\n\n \nclass TestAtom1eAddFLevel(unittest.TestCase):\n \"\"\" Unit tests of the Atom1e.add_F_level method. \"\"\"\n\n def test_Rb87_5s12_5p1...
[ [ "numpy.sum" ], [ "numpy.log", "numpy.linspace" ] ]
shyam-patel-kira/LA-CO-SS
[ "76ace6159b5fcf60063e52809b7dac76ccf4952d" ]
[ "api2/Preprocessing.py" ]
[ "from collections import OrderedDict\nimport helpers as hp\nimport configparser as cp\nimport os\nimport scipy.sparse\nimport numpy as np\nfrom scipy.linalg import pinv\nfrom scipy.sparse import csr_matrix\n\n\nconfig = cp.ConfigParser();\nconfig.read(os.getcwd()+'/config.ini')\n# degree of freedom\nk = int(config[...
[ [ "scipy.linalg.pinv", "numpy.eye", "scipy.sparse.csr_matrix.dot", "numpy.array", "numpy.sum" ] ]
meet-minimalist/FCOS-Pytorch-Implementation
[ "e8ac1c6230174902732dbe8bcff3a87034f99517" ]
[ "TrainingHelper.py" ]
[ "\nimport os\nimport cv2\nimport time\nimport torch\nimport numpy as np\nfrom tqdm import tqdm\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torchinfo import summary\n\nfrom LRHelper import LRHelper\nfrom DatasetHelper import get_train_loader, get_test_loader\n\nfrom models.FCOS import FCOS\nfrom mo...
[ [ "torch.load", "numpy.uint8", "torch.randn", "torch.tensor", "torch.cuda.amp.autocast", "torch.cuda.amp.GradScaler", "torch.no_grad", "torch.square", "numpy.transpose", "torch.device" ] ]
romellfudi/dataset_currency
[ "19a950e88fa724171cf93c47369b6fc61a57477f" ]
[ "export_inference_graph.py" ]
[ "import tensorflow as tf\nfrom google.protobuf import text_format\nimport sys\nsys.path.append(\"models/research/\")\nsys.path.append(\"models/research/slim/\")\nfrom object_detection import exporter\nfrom object_detection.protos import pipeline_pb2\n\nslim = tf.contrib.slim\nflags = tf.app.flags\n\nflags.DEFINE_st...
[ [ "tensorflow.gfile.GFile", "tensorflow.app.flags.mark_flag_as_required", "tensorflow.app.run" ] ]
okviman/SEM
[ "609fdd94874e02b02101649033390335e34c43cb" ]
[ "unit_testing/test_sem.py" ]
[ "from sem import sem\nimport unittest\nimport numpy.random as npr\nimport computations as cmp\nfrom data_utils import simulate_seq, get_char_data\nfrom substitution_models import JukesCantor\nfrom tree_utils import create_tree\nfrom plot_utils import plot_loglikelihood\n\n\nclass SEMTestCase(unittest.TestCase):\n ...
[ [ "numpy.random.seed" ] ]
PeterPirog/PRT_calculations
[ "7e1e72173700fbfd624a67c7b6984256de878f42" ]
[ "GTCext.py" ]
[ "import GTC\nimport numpy as np\n\n\ndef inv(a): #this function is added cause of error in original linear algebra file\n b = np.identity(a.shape[0], a.dtype)\n return GTC.LU.invab(a, b)\n\ndef python_list_transposition(list_2D):\n np_list=np.array(list_2D)\n return np.transpose(np_list).tolist()\n\ndef...
[ [ "numpy.array", "numpy.identity", "numpy.transpose" ] ]
JadeKim/2021QuantumHackatonKorea
[ "dec44087af4e843b33483e8d53c4725916e4b24b" ]
[ "jade_plot.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\n\ncnn = pd.read_pickle('cnn_10.pkl')\nnl_cnn = pd.read_pickle('nl-cnn_10.pkl')\nqnn = pd.read_pickle('qnn_100_1280_5.pkl')\n\nprint(cnn['train_loss'])\nprint(nl_cnn['train_loss'])\nprint(qnn['train_loss'])\n\nplt.figure(1, figsize=(8, 4.5))\...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.ylim", "numpy.arange", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlim", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "pandas.read_pickle", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
Cadene/bootstrap.pytorch
[ "43b0be90e39fdb96018411cb5bfad6bc9d29f023" ]
[ "bootstrap/datasets/transforms.py" ]
[ "import collections\nimport torch\nfrom torch.autograd import Variable\n\n\nclass Compose(object):\n \"\"\"Composes several collate together.\n\n Args:\n transforms (list of ``Collate`` objects): list of transforms to compose.\n \"\"\"\n\n def __init__(self, transforms):\n self.transforms ...
[ [ "torch.Size", "torch.cat", "torch.is_tensor", "torch.stack", "torch.autograd.Variable" ] ]
GiacobboNicola/PeTar
[ "ed40946abbe346e2b0e72ae836add7e38bf851c1" ]
[ "tools/analysis/base.py" ]
[ "# base class and functions\nimport numpy as np\n\nclass DictNpArrayMix:\n \"\"\" The basic class of data structure\n The member functions are initialized by provided keys in initial function\n Member functions can be accessed by using the stype of either Dictonary or numpy.ndarray\n \"\"\"\n ...
[ [ "numpy.log", "numpy.fromfile", "numpy.minimum", "numpy.sqrt", "numpy.maximum", "numpy.empty", "numpy.savetxt", "numpy.zeros", "numpy.sum", "numpy.loadtxt" ] ]
tdcosim/SolarPV-DER-simulation-utility
[ "03fb1cfd4d255117faced84cf61cd5b7ae59f69f" ]
[ "pvder/DER_components_single_phase_constant_Vdc.py" ]
[ "\"\"\"Single phase constant Vdc PV-DER code.\"\"\"\n\nfrom __future__ import division\nimport numpy as np\nimport math\nimport cmath\nimport scipy\nimport six\nimport pdb\nimport warnings\n\nfrom pvder.DER_components import SolarPVDER,PVModule\nfrom pvder.grid_components import BaseValues\n\nfrom pvder import util...
[ [ "numpy.sign", "numpy.array" ] ]
SidGoyal2014/Real-Estate-Price-Estimator
[ "f97356c7a911853cc9c40640298f6a5ae0f04cb8" ]
[ "app.py" ]
[ "import streamlit as st\r\nimport joblib\r\nimport numpy as np\r\nfrom flask import Flask,jsonify,request\r\nimport requests\r\nimport pandas as pd\r\nfrom sklearn.preprocessing import PolynomialFeatures\r\nimport os\r\nimport random\r\n\r\ndef main():\r\n st.title(\"Know the exact price of the house, if you are...
[ [ "sklearn.preprocessing.PolynomialFeatures", "pandas.DataFrame", "pandas.get_dummies" ] ]
nicolas-hbt/Scratch-ML
[ "799c93d68aa33731cc1b17e8f9c62597bd5d8200" ]
[ "multi-class_classification_lda.py" ]
[ "from __future__ import print_function, division\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom sklearn import preprocessing\n\nclass MultiClassLDA():\n\n def __init__(self):\n self.W = None\n\n def fit_transform(self, X, y, n_components):\n X = X.values if type(X) is not np.ndarray ...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.scatter", "numpy.unique", "matplotlib.pyplot.title", "numpy.linalg.inv", "matplotlib.pyplot.ylabel", "numpy.mean", "numpy.shape", "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "numpy.ze...
nguyenhuy1209/espnet
[ "67db7a46c701c96398bb839375da4f1d899c9c38", "67db7a46c701c96398bb839375da4f1d899c9c38" ]
[ "espnet/nets/pytorch_backend/transducer/transformer_decoder_layer_for_tt.py", "espnet/nets/beam_search_transducer_for_tt.py" ]
[ "\"\"\"Decoder layer definition for transformer-transducer models.\"\"\"\n\nimport torch\nfrom torch import nn\n\nfrom espnet.nets.pytorch_backend.transformer.layer_norm import LayerNorm\n\n\nclass DecoderLayer(nn.Module):\n \"\"\"Single decoder layer module for transformer-transducer models.\n\n Args:\n ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.cat" ], [ "torch.stack", "torch.max", "numpy.logaddexp" ] ]
neon-cyan/quantpy
[ "51b462cf0ef28fdd6bcf6b50ee3102209689724a" ]
[ "analysis/plotter.py" ]
[ "import mathutils\nimport numpy as np\nimport sys\nimport os\nimport json\n\nif len(sys.argv) < 5:\n print(f\"\"\"Not enough arguemnts!\\n Use : {sys.argv[0]}\n [/path/manifest.json] \n => [BL=1-2,2-3]\n => [PBL=1-2,2-3]\n => [NM=1,2,3]\n => [CIs=A|1,2,3]\n => [CSFs=A|1,2,3]\n => [CSFv=label...
[ [ "numpy.dot", "numpy.fft.fft", "matplotlib.pyplot.savefig", "numpy.fft.fftfreq", "numpy.repeat", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
onnoeberhard/eremenko-i
[ "92982f178274c2c92fdd4b69791bb10d2bc9720c" ]
[ "Part 2 - Regression/Section 4 - Simple Linear Regression/section.py" ]
[ "\"\"\"\nSimple Linear Regression\nSection\n\"\"\"\n\n# Importing the libraries\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport pandas as pd\n\n# Importing the dataset\ndataset = pd.read_csv('Salary_Data.csv')\nX = dataset.iloc[:, :-1].values\ny = dataset.iloc[:, -1:].values.ravel() # oder auch y = dat...
[ [ "pandas.read_csv", "matplotlib.pyplot.scatter", "matplotlib.pyplot.title", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.plot", "sklearn.linear_model.LinearRegression", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
lschlessinger1/MS-project
[ "e1c02d1d1a7a2480ff6f14f30625dc42ee3417e3" ]
[ "src/autoks/postprocessing/summarize_group.py" ]
[ "import argparse\nfrom pathlib import Path\nfrom typing import List\n\nimport numpy as np\n\nfrom src.autoks.postprocessing.summary import _parse_experiment\nfrom src.evalg.visualization import plot_distribution\n\n\ndef summarize_exp_group(experiment_group_dir_name):\n \"\"\"Summarize a group of experiments.\"\...
[ [ "numpy.std", "matplotlib.pyplot.show", "numpy.mean", "matplotlib.pyplot.gcf" ] ]
cipheraxat/buildlytics
[ "9d195e5dd7aa1c222bef430da0a764a0bcdd960f" ]
[ "EDALIB/__init__.py" ]
[ "\nfrom __future__ import division\nfrom collections import OrderedDict\nimport numpy as np\nimport pandas as pd\nimport numpy as np\nimport seaborn as sn\nimport matplotlib.pyplot as plt\nfrom pandas.api import types\nfrom six import string_types\n\n\nclass DataFrameSummary(object):\n ALL = 'ALL'\n INCLUDE =...
[ [ "pandas.concat", "pandas.api.types.is_datetime64_dtype", "pandas.Series", "pandas.Index", "pandas.api.types.is_numeric_dtype", "numpy.count_nonzero", "pandas.value_counts", "numpy.array", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
MixXxyZ/RITnet
[ "08241800841ddded3b7acbeb2e4598651ad66932" ]
[ "mixnet.py" ]
[ "import torch\nfrom torch import nn\nimport math\n\nclass _GlobalConvModule(nn.Module):\n def __init__(self, in_dim, out_dim, kernel_size, squeeze_ratio=8):\n super(_GlobalConvModule, self).__init__()\n\n assert(kernel_size[0] % 2 != 0 and kernel_size[1] % 2 != 0) # to prevent incompatible pad ...
[ [ "torch.nn.Dropout2d", "torch.nn.ConvTranspose2d", "torch.nn.MaxUnpool2d", "torch.cat", "torch.nn.PReLU", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
juijan/banddownfolder
[ "889e9542f46a4647e2ced0eda9a2035a0197e3f8" ]
[ "banddownfolder/wrapper/ijR.py" ]
[ "import os\nimport pickle\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport copy\nfrom scipy.linalg import eigh\nfrom scipy.sparse import csr_matrix\nfrom netCDF4 import Dataset\nfrom collections import defaultdict\nfrom scipy.optimize import curve_fit\nfrom banddownfolder.utils.supercell import Supercel...
[ [ "numpy.dot", "numpy.conj", "numpy.nonzero", "numpy.reshape", "numpy.eye", "matplotlib.pyplot.subplots", "numpy.round", "numpy.fill_diagonal", "numpy.repeat", "numpy.array", "numpy.zeros" ] ]
Tecnarca/patectsdgym
[ "7ed2c7a7d37d5d0c2a44b050d74958284cf9493d" ]
[ "evaluation/dpbench/metrics/sra.py" ]
[ "import numpy as np\nimport pandas as pd\n\ndef sra(real, synth):\n \"\"\"\n SRA can be thought of as the (empirical) probability of a\n comparison on the synthetic data being ”correct” (i.e. the same as\n the comparison would be on the real data).\n\n From \"Measuring the quality of Synthetic data f...
[ [ "numpy.array", "numpy.sum" ] ]
GalAvineri/MelMedic
[ "af9142d0fabd86b6c87a345a49dfb167b9765225" ]
[ "main.py" ]
[ "from data.dataset import Dataset\nfrom auxilleries import IO\nfrom metrics import Precision, Recall, F1\n\nfrom tensorflow import keras\nfrom tensorflow.keras.applications.inception_v3 import InceptionV3\nfrom tensorflow.keras.models import Model\nfrom tensorflow.keras.layers import Dense, GlobalAveragePooling2D\n...
[ [ "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.layers.GlobalAveragePooling2D", "tensorflow.keras.models.Model", "numpy.unique", "tensorflow.keras.layers.Dense", "tensorflow.keras.callbacks.ReduceLROnPlateau", "numpy.argmax", "tensorflow.keras.callbacks.EarlyStoppin...
frodofine/lemon
[ "f874857cb8f1851313257b25681ad2a254ada8dc" ]
[ "dubs/dubs.py" ]
[ "from candiy_lemon import lemon\nimport sys, os\nimport numpy as np\nimport pandas as pd\n\n# List of dictionaries to keep track of parts of the file\n\n# Key: reference pdbid, Value: path to .mmtf file\npathDict = {}\n# Key: reference pdbID, Value: chemical ID of ligand bound to reference protein for removal\nrefe...
[ [ "pandas.isna", "pandas.read_csv" ] ]
majedelhelou/PriorLearning
[ "f66d25993c3b99dd31d9d62abeb3e0a5623e034d" ]
[ "models.py" ]
[ "import torch\nimport torch.nn as nn\nimport os\nfrom util import Kernels\n\nclass CNN_Model(nn.Module):\n def __init__(self, num_of_layers=10, kernel_size=3, padding=1, features=64, gksize=11, gsigma=3):\n super(CNN_Model, self).__init__()\n # We are only interested in grayscale\n channels ...
[ [ "torch.nn.Sequential", "torch.nn.Parameter", "torch.ones", "torch.nn.Conv2d", "torch.from_numpy", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
msteijaert/smurff
[ "e6066d51e1640e9aad0118628ba72c9d662919fb" ]
[ "python/data/synthetic/make.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nfrom scipy import sparse\nimport scipy.io as sio\nimport argparse\nimport os\nimport itertools\nimport matrix_io as mio\nfrom sklearn import preprocessing\n\n#parser = argparse.ArgumentParser(description='SMURFF tests')\n#parser.add_argument('--envdir', metavar='DIR', ...
[ [ "numpy.array", "scipy.sparse.coo_matrix", "scipy.sparse.issparse", "scipy.sparse.find", "numpy.random.choice", "numpy.arange", "numpy.indices", "scipy.io.mmwrite", "numpy.ones", "numpy.random.normal", "numpy.mean", "sklearn.preprocessing.scale", "numpy.repeat", ...
douding123986/aiostar
[ "a7fa73820ea13c81062081ea9b8445c2dab1986f" ]
[ "aiostar/spiders/yz/demo.py" ]
[ "\"\"\"\nAuthor : blu\n@Description : demo\n数据源:http://www.boyar.cn/column/5.html\n\"\"\"\nimport aiohttp\nimport asyncio\nfrom lxml import etree\nfrom aiostar.spiders import BaseSpider\nfrom urllib.parse import urljoin\nfrom aiostar.tasks.Request import Request\nfrom aiostar.tasks.Result import ResultTask\nimport ...
[ [ "pandas.read_html", "pandas.DataFrame" ] ]
susumuasaga/Python-Web-Scraping-Cookbook
[ "dcb6241c5ead11070648b9c829b18f4e0d90f464" ]
[ "Chapter08/04_so_word_cloud.py" ]
[ "from bs4 import BeautifulSoup\nimport json\nfrom nltk.tokenize import word_tokenize\nfrom nltk.corpus import stopwords\nfrom tech2grams import tech_2grams\nfrom punctuation import remove_punctuation\n\nwith open(\"spacex-job-listing.html\", \"r\") as file:\n content = file.read()\n\nbs = BeautifulSoup(content, ...
[ [ "matplotlib.pyplot.imshow", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
Iam-prog/Optimum_Number_of_Cluster_Machine_learning
[ "9a42a1951efc0d350a09e94a5150185dcae89c83" ]
[ "Clustering.py" ]
[ "# Finding the optimum number of clusters for the given dataset using Elbow Method.\n\n# Instruction\n\n# Use Switch ( -d ) for Dataset\n# Use Switch ( -sk ) to start Number of K\n# Use Switch ( -sk ) to end Number of K\n# Use Switch ( -xl ) for xLevel; like what is X point\n# Use Switch ( -ol ) for Outp...
[ [ "matplotlib.pyplot.ylim", "matplotlib.pyplot.show" ] ]
JKrehl/Electrons.py
[ "33d2b84a668b60009e731643214d826422d06ae3" ]
[ "Electrons/Scattering/Operators/Propagators/FresnelFourier.py" ]
[ "#!/usr/bin/env python\n\"\"\"\nCopyright (c) 2015 Jonas Krehl <Jonas.Krehl@triebenberg.de>\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted, provided that the above\ncopyright notice and this permission notice appear in all copies.\n\nTHE SO...
[ [ "numpy.add.outer" ] ]
jackz314/openpilot
[ "60f6d700dda07807bac12370e6b3706d77f961ca" ]
[ "selfdrive/camerad/test/frame_test.py" ]
[ "#!/usr/bin/env python3\nimport numpy as np\nimport cereal.messaging as messaging\nfrom PIL import ImageFont, ImageDraw, Image\n\n# font = ImageFont.truetype(\"arial\", size=72)\ndef get_frame(idx):\n img = np.zeros((874, 1164, 3), np.uint8)\n img[100:400, 100:100+(idx % 10) * 100] = 255\n\n # big number\n im2 ...
[ [ "numpy.zeros" ] ]
jonathanzjl/cam-vision
[ "d1bd865b147ea1137979b624c64a6baa4a4b0714" ]
[ "lib/mobilenet.py" ]
[ "#! /usr/bin/env python3\n# Copyright (C) 2018 Zhijin Li\n\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are\n# met:\n\n# * Redistributions of source code must retain the above copyright\n# n...
[ [ "tensorflow.keras.models.Model", "tensorflow.keras.layers.Conv2D", "tensorflow.keras.layers.Reshape", "tensorflow.keras.applications.mobilenet.MobileNet", "tensorflow.keras.layers.Flatten" ] ]
eliavw/nba-anomaly-generator
[ "a1e162095b76a3406411925093381e9ace9258c7" ]
[ "src/nba_anomaly_generator/anom/utils.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\n# Prepare dataframe\ndef assert_and_rng_and_prep_df(df, rng=None, random_state=42):\n \"\"\"These steps are always identical\n \"\"\"\n assert isinstance(random_state, int)\n assert isinstance(df, pd.DataFrame)\n\n # Fix dataframe\n df = _init_df(df)\n...
[ [ "numpy.random.default_rng", "numpy.ones" ] ]
ZJULiHongxin/two-hand-pose-est
[ "e531faacd9cdddcb716b614b832038d079b9663f" ]
[ "lib/fp16_utils/core/inference.py" ]
[ "# ------------------------------------------------------------------------------\n# Copyright (c) Microsoft\n# Licensed under the MIT License.\n# Written by Bin Xiao (Bin.Xiao@microsoft.com)\n# ------------------------------------------------------------------------------\n\nfrom __future__ import absolute_import\...
[ [ "numpy.amax", "numpy.greater", "numpy.tile", "numpy.sign", "numpy.argmax", "numpy.floor", "numpy.array" ] ]
andrewjh9/CenBench
[ "afd960b77ade05be2d2368bed3b47d54f7e229b6" ]
[ "plot_creation_scripts/centrality_historgrams/MLP_lap_cen_dis_400_epochs_cifar10.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport tikzplotlib\n\n\naxis_label_size = 14\nfont = {'family' : 'normal',\n 'weight' : 'bold',\n 'size' : axis_label_size}\n\nplt.rc('font', **font)\n\nread_dataset_0_cifar10 = np.genfromtxt('results/base_line_MLP/cifar10/MLP__cifar10_for_400_ep...
[ [ "matplotlib.pyplot.tight_layout", "numpy.arange", "matplotlib.pyplot.rc", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.genfromtxt", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
warthan07/Nemaktis
[ "54b1e64c1d40668e6dc22b11eac5487a09b58478" ]
[ "HighLevelPythonInterface/examples/benchmarks/3D/03_plot_errors.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nerr_idx = 3\nlabels = []\ndata = []\nfor diff in [1,3,5]:\n raw = np.loadtxt(\"results/errors_and_times_dtmm_diff=%d.dat\" % (diff,))\n data.append({\"dy\":raw[:,1],\"t\":raw[:,2],\"err\":raw[:,err_idx]})\n labels.append(\"DTMM(%d)\" % (diff,))\n\nraw...
[ [ "matplotlib.pyplot.gca", "numpy.arange", "matplotlib.pyplot.subplot", "matplotlib.pyplot.bar", "matplotlib.pyplot.show", "numpy.loadtxt" ] ]
YerongLi2/ContrastiveLosses4VRD
[ "33a859bc24b776cb16326b96ada70d2c5d2bc144" ]
[ "lib/datasets_rel/task_evaluation_vg_and_vrd.py" ]
[ "\"\"\"\nWritten by Ji Zhang, 2019\nSome functions are adapted from Rowan Zellers\nOriginal source:\nhttps://github.com/rowanz/neural-motifs/blob/master/lib/evaluation/sg_eval.py\n\"\"\"\n\nimport os\nimport numpy as np\nimport logging\nfrom six.moves import cPickle as pickle\nimport json\nimport csv\nfrom tqdm imp...
[ [ "numpy.hstack", "numpy.set_printoptions", "numpy.vstack", "numpy.sort", "numpy.argsort", "numpy.where", "numpy.zeros" ] ]
diffiii/DFX
[ "ac7581b0a3d1adef1da7176f94abb7f9301a03c0" ]
[ "main.py" ]
[ "from src.core import Core\nfrom tools.compile import Compile\nfrom tools.execute import Execute\nfrom tools.run import Run\nfrom numpy import zeros, ubyte\n\n\nif __name__ == '__main__':\n memory = zeros(256, ubyte)\n core = Core(memory)\n Compile('tools/settings.json', 'program.txt')\n Run(core, 'bin/...
[ [ "numpy.zeros" ] ]
YusukeKaihara/Graduate-Research-2021
[ "a95e88cbd28a19e68dc5fb93f6707999bb1bb52f" ]
[ "KoheiNagao/program/LZT_classification.py" ]
[ "import os, sys, json, shutil, random, copy, pickle, numpy\r\nimport pandas as pd\r\nfrom tqdm import tqdm\r\nfrom collections import defaultdict\r\nfrom sklearn import svm, preprocessing, metrics\r\nfrom sklearn.metrics import confusion_matrix, precision_score, recall_score\r\nfrom sklearn.model_selection import G...
[ [ "sklearn.model_selection.GridSearchCV", "pandas.read_csv", "sklearn.ensemble.RandomForestClassifier", "sklearn.metrics.precision_score", "pandas.DataFrame", "sklearn.svm.SVC", "sklearn.preprocessing.StandardScaler", "numpy.array", "sklearn.metrics.recall_score", "sklearn.me...
CruddyShad0w/StockBot
[ "e8e321bc7c6c694afc04fa2d48690a96c49a680c" ]
[ "quantopian/algo.py" ]
[ "from pylivetrader.api import (\n attach_pipeline,\n date_rules,\n get_datetime,\n time_rules,\n order,\n get_open_orders,\n cancel_order,\n pipeline_output,\n schedule_function,\n)\nfrom pipeline_live.data.iex.pricing import USEquityPricing\nfrom pipeline_live.data.iex.fundamentals impor...
[ [ "numpy.isnan" ] ]
denred0/action-recognition-pytorch
[ "a66766689c68eb93fad0722ea3c6fd4976a1a248" ]
[ "models/twod_models/temporal_modeling.py" ]
[ "\nimport torch\nimport torch.nn.functional as F\nimport torch.nn as nn\n\n\nclass SEModule(nn.Module):\n\n def __init__(self, channels, dw_conv):\n super().__init__()\n ks = 1\n pad = (ks - 1) // 2\n self.fc1 = nn.Conv2d(channels, channels, kernel_size=ks,\n ...
[ [ "torch.max", "torch.nn.Conv2d", "torch.sum", "torch.stack", "torch.nn.ReLU", "torch.nn.functional.pad" ] ]
amandadumi/chemreps
[ "717796d7ef0b56803407147ff72921329fa91d79" ]
[ "tests/just_bonds_test.py" ]
[ "import numpy as np\nimport pytest as pt\nfrom collections import OrderedDict\nimport chemreps.just_bonds as jb\nfrom chemreps.bagger import BagMaker\n\n\ndef test_just_bonds():\n bags_true = OrderedDict([('C', 16), ('CC', 13), ('H', 18), ('HC', 16), ('N', 2),\n ('NC', 5), ('NH', 1), ('O', 5), ('OC', 6), ('OH...
[ [ "numpy.array", "numpy.allclose" ] ]
PouyaGhahramanian/goowe-python
[ "926e36061cc8d20ce0164c4fae3dfa2f492bc487" ]
[ "Goowe.py" ]
[ "import numpy as np\r\nfrom skmultiflow.core.base import StreamModel\r\n#from skmultiflow.core.base import BaseEstimator\r\nfrom skmultiflow.trees import HoeffdingTree\r\nfrom skmultiflow.utils.data_structures import InstanceWindow, FastBuffer\r\n\r\n\r\nclass Goowe(StreamModel):\r\n#class Goowe(BaseEstimator):\r\n...
[ [ "numpy.dot", "numpy.amax", "numpy.amin", "numpy.exp", "numpy.linalg.lstsq", "numpy.argmax", "numpy.argmin", "numpy.savetxt", "numpy.array", "numpy.zeros", "numpy.empty" ] ]
huschen/walk_prosthetics
[ "436deecf2d70cc7766099f2ff7682c47c5a2d437" ]
[ "ddpg/training.py" ]
[ "import os\nimport time\nimport datetime\n\nimport numpy as np\nfrom mpi4py import MPI\n\nfrom common import logger\nfrom common.misc_util import dbg_tf_init\nimport common.tf_util as tf_util\nfrom ddpg.pretrain import pretrain_demo, load_history\n\n\ndef train(env, eval_env, agent, render=False, render_eval=False,...
[ [ "numpy.divide", "numpy.isscalar" ] ]
AtsushiSakai/PyOptSamples
[ "c498e8978c64496be2dfe3c6a3b328b33da4b2c1" ]
[ "NonlinearOptimization/NewtonMethod/NewtonMethod.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport random\n\ndelta = 0.1\nminXY=-5.0\nmaxXY=5.0\nnContour=50\nalpha=0.01\n\ndef Hessian(state):\n u\"\"\"\n Hessian matrix of Himmelblau's function\n \"\"\"\n x=state[0]\n y=state[1]\n dxx=12*x*...
[ [ "numpy.meshgrid", "numpy.linalg.inv", "numpy.arange", "numpy.vstack", "matplotlib.pyplot.plot", "matplotlib.pyplot.contour", "numpy.array", "matplotlib.pyplot.show" ] ]
gdahia/ufba-ai-minesweeper
[ "ba87df32c430481672a55a5b2c421cd6f97ad443" ]
[ "plot.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom six.moves import range\n\nimport os\nimport sys\nimport json\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n\ndef plot(board_spec,\n n_mines,\n tl_spec,\n n_samples,...
[ [ "matplotlib.pyplot.legend", "numpy.arange", "matplotlib.pyplot.bar", "matplotlib.pyplot.xticks", "numpy.array", "matplotlib.pyplot.ylabel" ] ]
jzuhone/kadi
[ "de4885327d256e156cfe42b2b1700775f5b4d6cf" ]
[ "kadi/commands/observations.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\nimport os\nfrom collections import defaultdict\nimport logging\nfrom pathlib import Path\n\nimport numpy as np\nfrom cxotime import CxoTime\nimport astropy.units as u\nfrom astropy.table import Table, unique as table_unique\n\n# kadi.commands.command...
[ [ "numpy.abs", "numpy.arange", "numpy.concatenate", "numpy.argmin", "numpy.any", "numpy.searchsorted", "numpy.where", "numpy.isin" ] ]
jeromechiu/Travel_Salesman_Proble
[ "dd447600b8e1426d99f891936cd47bafff578417" ]
[ "travel_point_grouping.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom sklearn.cluster import KMeans\nimport matplotlib.pyplot as plt\n\n\ndest_coord = [[0, (24.993484, 121.497134)], \n [1, (25.0007671, 121.4879088)], \n [3, (24.9986295, 121.5007544)], \n [2, (24.99663, 121.4869139)]]\n\ndef ge...
[ [ "sklearn.cluster.KMeans", "matplotlib.pyplot.scatter", "numpy.cos", "pandas.DataFrame", "numpy.sin", "numpy.deg2rad", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
armsp/covid19-vis
[ "18fb10ab100bae13033b3a033b6612a8dab10d53" ]
[ "map.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport os\nimport glob\nfrom datetime import date\n#import webbrowser\nimport pandas as pd\nimport folium\nfrom folium import plugins\nmap_kwargs = {\"zoomSnap\": 0.5}\nm = folium.Map(location=[22.7041, 79.1025], tiles='CartoDB Positron', zoom_start=4.5, **map_kwarg...
[ [ "pandas.read_csv" ] ]
KAIST-AILab/End-to-End-Enc-Dec_DSTC9
[ "43882de251866c3793009293c7d190c0a3714797" ]
[ "gpt2/models.py" ]
[ "from torch.nn import BCEWithLogitsLoss, CrossEntropyLoss\nimport torch.nn as nn\nfrom transformers import GPT2Model, GPT2PreTrainedModel\nfrom transformers.modeling_utils import SequenceSummary\n\n\nclass GPT2End2EndModel(GPT2PreTrainedModel):\n def __init__(self, config):\n super().__init__(config)\n ...
[ [ "torch.nn.CrossEntropyLoss", "torch.nn.Linear", "torch.nn.BCEWithLogitsLoss" ] ]
lehy/chainertools
[ "0df54f10a7ef5624380fbcdb180d59fa121d910d" ]
[ "chainertools/train.py" ]
[ "import gc\nimport os\nimport copy\nimport glob\nimport chainer\nimport logging\nimport functools\nimport numpy as np\nimport pandas as pd\nfrom . import utils\n\nlog = logging.getLogger(__name__)\n\n\nclass OnlineEvaluator(chainer.training.extensions.Evaluator):\n \"\"\"An evaluator that evaluates one batch at ...
[ [ "pandas.Series", "numpy.isfinite" ] ]
samchan2022/pytorch
[ "bcf6974c207ac0339bfb8bdfdb0b0ec348f7a22f" ]
[ "test/test_torch.py" ]
[ "# -*- coding: utf-8 -*-\n# Owner(s): [\"module: tests\"]\n\nimport torch\nimport torch.utils.data\nimport numpy as np\n\nimport contextlib\nimport gc\nimport io\nimport inspect\nimport itertools\nimport math\nimport random\nimport re\nimport copy\nimport os\nimport tempfile\nimport unittest\nimport warnings\nimpor...
[ [ "torch.all", "torch.set_default_tensor_type", "torch.fmod", "torch.BoolTensor", "torch.randint", "torch.max", "torch.zeros", "torch.set_vital", "torch.multinomial", "torch.cumprod", "torch.IntStorage", "torch.device", "torch.__config__._cxx_flags", "torch.ge...
amarack/dqn_zoo
[ "465aedaee48a6e13cb141808abf23876a1b21e4e" ]
[ "dqn_zoo/prioritized/run_atari.py" ]
[ "# Copyright 2019 DeepMind Technologies Limited. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unle...
[ [ "numpy.amin", "numpy.random.RandomState" ] ]
NV-jpt/cucim
[ "4d861fe38bfa5f2fcaedcc029d51c93fd33456a2" ]
[ "python/cucim/src/cucim/core/operations/intensity/tests/test_zoom.py" ]
[ "import os\n\nimport cupy\nimport numpy as np\nimport pytest\nimport skimage.data\nfrom PIL import Image\n\nimport cucim.core.operations.intensity as its\n\n\ndef get_input_arr():\n img = skimage.data.astronaut()\n arr = np.asarray(img)\n arr = np.transpose(arr)\n return arr\n\n\ndef get_zoomed_data():\...
[ [ "numpy.asarray", "numpy.allclose", "numpy.stack", "numpy.transpose" ] ]
OskarLiew/modAL
[ "c95fb1d3be63176bb1c226ac6de5cb4ddce87dd6" ]
[ "tests/core_tests.py" ]
[ "import random\nimport unittest\nimport numpy as np\n\nimport mock\nimport modAL.models.base\nimport modAL.models.learners\nimport modAL.utils.selection\nimport modAL.utils.validation\nimport modAL.utils.combination\nimport modAL.acquisition\nimport modAL.batch\nimport modAL.density\nimport modAL.disagreement\nimpo...
[ [ "numpy.linspace", "numpy.asarray", "numpy.concatenate", "scipy.sparse.random", "numpy.max", "numpy.mean", "scipy.sparse.vstack", "numpy.random.randint", "numpy.testing.assert_equal", "scipy.special.ndtr", "sklearn.ensemble.RandomForestClassifier", "numpy.unique", ...
tsalo/neuropower-core
[ "5f3534063263ac2cb99c71b58ad2a482aa382f03" ]
[ "neuropower/tests/test_cluster.py" ]
[ "from unittest import TestCase\nfrom neuropower import cluster\nimport numpy as np\n\nclass TestCluster(TestCase):\n def test_cluster_output(self):\n np.random.seed(seed=100)\n testSPM = np.random.rand(4,4,4)\n mask = np.zeros((4,4,4))+1\n tab = cluster.cluster(testSPM,0.5,mask)\n ...
[ [ "numpy.around", "numpy.zeros", "numpy.random.rand", "numpy.random.seed" ] ]
henry-li-06/march-madness-bracket
[ "17b4eb83128153a8406893547c70198114f82636" ]
[ "bracket/bracket.py" ]
[ "from model import model, all_games_19\r\nfrom sklearn.preprocessing import StandardScaler, MinMaxScaler\r\nfrom sklearn.decomposition import PCA\r\nimport pandas as pd\r\n\r\n\r\nclass Node:\r\n '''\r\n Data should be \"N/A\" if the winner hasn't been predicted yet\r\n '''\r\n # vertical separation bet...
[ [ "pandas.read_csv", "sklearn.decomposition.PCA", "sklearn.preprocessing.MinMaxScaler" ] ]
r-kapoor/dig-network
[ "1e17132140d28cc1e302d4749833700c86927c9b" ]
[ "sampling_experiments.py" ]
[ "import json\nimport codecs\nimport tldextract\nimport pickle\nimport random\nimport copy\nimport matplotlib.pyplot as plt\n\n# One of 'city', 'name', 'phone'\nVARIABLE = 'phone'\n\nwith open('backpage.com/nebraska.json', \"rb\") as fp:\n urls = pickle.load(fp)\n\ncount = 0\n\ndef preprocess(urls):\n ad_to_ex...
[ [ "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
swemoney/adventofcode2020
[ "94c3c032e68b182881dc545771a79fd884b7cf93" ]
[ "day/day11part1.py" ]
[ "from functools import cached_property\nfrom puzzle import Puzzle # pylint: disable=import-error\nfrom enum import Enum, auto\nimport numpy as np\n\nclass SeatStatus(Enum):\n occupied = \"#\"\n unoccupied = \"L\"\n floor = \".\"\n \nclass Seat:\n status: SeatStatus\n\n def __init__(self, seat_stri...
[ [ "numpy.array_equal" ] ]
spencels/mnist_cnn
[ "80ffcae1a453e38c571b62d3e70dd69dc32bfced" ]
[ "process_data.py" ]
[ "#!/usr/bin/env python\n# MNIST data pre-processing script.\nimport gzip\nimport struct\nimport sys\nimport functools\nimport subprocess\nfrom distutils import sysconfig\nimport imp\nimport cProfile as profile\nimport pstats\nimport io\n\nimport cv2\nimport numpy as np\nimport scipy as sp\nfrom scipy import ndimage...
[ [ "matplotlib.pyplot.imshow", "numpy.tile", "scipy.ndimage.filters.gaussian_filter", "numpy.random.uniform", "matplotlib.pyplot.show", "numpy.empty", "matplotlib.pyplot.figure" ] ]
zlazow/cclabel
[ "06510f09decd52a77a20780e0ac8378f3aad6a5c" ]
[ "Miscel/Image Histogram and Check Pixels Script.py" ]
[ "from PIL import Image\nimport numpy as np\nfrom numpy import array\nimport matplotlib.mlab as mlab\nimport matplotlib.pyplot as plt\n\n\nfilename = raw_input(\"Filename: \")\nimg = Image.open(filename)\narr = array(img)\n\n\n# the histogram of the data\nn, bins, patches = plt.hist(arr, 50, normed=1, facecolor='gre...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.grid", "matplotlib.pyplot.axis", "matplotlib.pyplot.xlabel", "numpy.array", "matplotlib.pyplot.hist", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
9465565598/ThaparWorkshopANN
[ "e141cd8f3e600f35826516738188e87ac3480fc3" ]
[ "scikit-learn/figures/plot_interactive_tree.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom sklearn.datasets import make_blobs\nfrom sklearn.tree import DecisionTreeClassifier\n\nfrom scipy import ndimage\n\nfrom .tree_plotting import plot_tree as plot_tree_mpl\n\nX, y = make_blobs(centers=[[0, 0], [1, 1]], random_state=61526, n_samples=50)\n\n\...
[ [ "scipy.ndimage.laplace", "numpy.arange", "matplotlib.pyplot.subplots", "sklearn.tree.DecisionTreeClassifier", "numpy.array", "sklearn.datasets.make_blobs" ] ]