repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
ZohebAbai/bert-extractive-summarizer
[ "f251a1d435efb11078a4448afeb5ebee2158bf88" ]
[ "summarizer/qa_pipelines.py" ]
[ "# Borrowed from https://github.com/patil-suraj/question_generation but Modified\n\nfrom typing import Optional, Dict, Union\nimport itertools\nimport logging\nimport spacy\n# create spacy pipeline\nnlp = spacy.load(\"en_core_web_md\")\nnlp.add_pipe(nlp.create_pipe('sentencizer'))\n\nimport torch\nfrom transformers...
[ [ "torch.cuda.is_available" ] ]
AustinHartman/ingest-pipeline
[ "788d9310792c9396a38650deda3dad11483b368c" ]
[ "src/ingest-pipeline/misc/tools/split_and_create.py" ]
[ "#! /usr/bin/env python\n\nimport sys\nimport argparse\nimport re\nfrom pprint import pprint\nfrom datetime import date\nfrom pathlib import Path\nfrom shutil import copytree, copy2\nfrom typing import TypeVar, List\nimport pandas as pd\nimport numpy as np\nimport time\nimport json\n\nfrom hubmap_commons.globus_gro...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
matzegltg/miau
[ "89b580baccbd258fbfd81bc19b46603a07873f14", "89b580baccbd258fbfd81bc19b46603a07873f14" ]
[ "numerikKlausur.py", "gruwi22.py" ]
[ "import numpy as np\nimport math as m\n\ndef transpose(Q):\n for i in range(0,4):\n for j in range(0,i):\n copy = Q[i][j]\n Q[i][j] = Q[j][i]\n Q[j][i] = copy\n return Q\n\nA = np.array([[1, 0],\n [1, 1],\n [1, 2],\n [1,3]])\...
[ [ "numpy.identity", "numpy.array", "numpy.matmul", "numpy.linalg.solve" ], [ "numpy.concatenate", "numpy.full", "numpy.zeros", "numpy.eye", "matplotlib.pyplot.figure", "numpy.arange", "numpy.linalg.solve", "matplotlib.pyplot.show", "numpy.meshgrid" ] ]
897615138/tfsnippet-jill
[ "2fc898a4def866c8d3c685168df1fa22083bb143" ]
[ "tests/layers/flows/test_split.py" ]
[ "import numpy as np\nimport pytest\nimport tensorflow as tf\n\nfrom tests.layers.flows.helper import (quadratic_transform, QuadraticFlow,\n npyops, invertible_flow_standard_check)\nfrom tfsnippet.layers import SplitFlow, SequentialFlow, ReshapeFlow\n\n\nclass SplitFlowTestCase(...
[ [ "numpy.concatenate", "numpy.testing.assert_allclose", "numpy.zeros_like", "tensorflow.zeros", "numpy.random.normal", "numpy.random.seed", "numpy.sum", "numpy.split", "tensorflow.placeholder" ] ]
RaphaelHippe/Machine-Learning-Project-Template
[ "d8d6df12cba57de6b8a582385294372a6bc163f0" ]
[ "util/machine_learning.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.utils import shuffle\n\nfrom util.exceptions import DataSplitError, DataFrameTypeError\n\n'''\nNAME: train_test_split\nPARAMS:\n- df: A pandas DataFrame containing the whole data set.\n- label: A string of the column to use as the label of the classification pr...
[ [ "numpy.sum", "sklearn.utils.shuffle" ] ]
microsoft/MixingBoard
[ "4383b382ffd9493007ac484c54d2aea2b64762a8", "4383b382ffd9493007ac484c54d2aea2b64762a8" ]
[ "src/demo_doc_gen.py", "src/onmt/modules/GlobalAttention.py" ]
[ "#// Copyright (c) Microsoft Corporation.// Licensed under the MIT license. \n\nimport json, subprocess, torch, os, time, pdb\nimport numpy as np\nfrom knowledge import KnowledgeBase\nimport base64\nfrom flask import Flask, request, render_template\nfrom lm import LanguageModel\nfrom grounded import ContentTransfer...
[ [ "torch.no_grad" ], [ "torch.nn.Linear", "torch.cat", "torch.nn.Softmax", "torch.nn.Tanh", "torch.bmm" ] ]
dkkim93/meta-mapg
[ "98d4d1be3f5fd628b42e451bed99004f02f553d0" ]
[ "misc/rl_utils.py" ]
[ "import torch\nimport numpy as np\nfrom misc.replay_memory import ReplayMemory\n\n\ndef collect_trajectory(agents, actors, env, args):\n \"\"\"Collect batch of trajectories\n\n Args:\n agents (list): Contains agents that act in the environment\n actors (list): Contains parameters that agents use...
[ [ "torch.zeros", "torch.stack", "numpy.mean", "torch.mean", "torch.sum" ] ]
acr-iitkgp/swarm_search
[ "3857edde0238c2f5d83a33c8969e6e3e3b9a3dcf" ]
[ "Detection/detection/src/shrey-hp-pavilion-notebook@192.168.0.21/src/roi_detect.py" ]
[ "#!/usr/bin/env python\n\n\n# sys.path.remove(\"/opt/ros/kinetic/lib/python2.7/dist-packages\")\n\nimport cv2\nimport numpy as np\n\nimport numpy as np\nimport argparse\nimport roi_detect_help\n\nimport cv2\nfont = cv2.FONT_HERSHEY_COMPLEX\n\n\n# from cv_bridge import CvBridge, CvBridgeError\n\ndef kalman_xy(x, P, ...
[ [ "numpy.array", "numpy.matrix", "numpy.matmul", "numpy.zeros", "numpy.sum", "numpy.eye", "numpy.arange", "numpy.var" ] ]
uberkinder/Robusta-AutoML
[ "9faee4c17ad9f37b09760f9fffea715cdbf2d1fb" ]
[ "selector/_plot.py" ]
[ "import matplotlib.pylab as plt\nfrom matplotlib.ticker import MaxNLocator\n\nimport numpy as np\n\n\n\ndef _plot_subset(fs, **kwargs):\n\n fig, ax = plt.subplots(1,1)\n\n ax.set_title(type(fs).__name__)\n ax.set_xlabel('# features')\n ax.set_ylabel('score')\n\n forward = getattr(fs, 'forward', True)...
[ [ "matplotlib.pylab.gca", "matplotlib.pylab.subplots", "matplotlib.ticker.MaxNLocator" ] ]
philianeles/compas
[ "129a5a7e9d8832495d2bbee6ce7c6463ab50f2d1" ]
[ "src/compas_hpc/linalg/linalg_numba.py" ]
[ "\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nfrom numba import f8\nfrom numba import c16\nfrom numba import jit\n\ntry:\n from numba import prange\nexcept ImportError:\n prange = range\n\nfrom numpy import zeros\n\n\n__author__ = ['And...
[ [ "numpy.zeros" ] ]
Sager611/ofco
[ "84d8fa4bda688e5e2eaf306b3788cf32cfdf7a51" ]
[ "tests/test_utils.py" ]
[ "\"\"\"\nThis module provides unit tests for the function in ofco.utils.\n\"\"\"\n\nimport numpy as np\nfrom scipy.signal import correlate2d\n\nfrom ofco.utils import *\n\n\ndef test_partial_deriv():\n \"\"\"\n Tests for the partial derivative function.\n \"\"\"\n imgs = np.zeros((50, 50, 2))\n w = n...
[ [ "numpy.allclose", "numpy.array", "numpy.zeros", "scipy.signal.correlate2d" ] ]
bhishanpdl/dabl
[ "96693a8e5655b0aec18cacfaa334584eb8e57f53" ]
[ "dabl/pipelines.py" ]
[ "from sklearn.dummy import DummyClassifier, DummyRegressor\nfrom sklearn.preprocessing import MinMaxScaler\nfrom sklearn.naive_bayes import GaussianNB, MultinomialNB\nfrom sklearn.tree import DecisionTreeClassifier, DecisionTreeRegressor\nfrom sklearn.pipeline import make_pipeline\nfrom sklearn.linear_model import ...
[ [ "sklearn.linear_model.Lasso", "sklearn.dummy.DummyRegressor", "sklearn.naive_bayes.GaussianNB", "sklearn.linear_model.Ridge", "sklearn.naive_bayes.MultinomialNB", "sklearn.linear_model.LogisticRegression", "sklearn.dummy.DummyClassifier", "sklearn.tree.DecisionTreeClassifier", ...
evelinehong/CLL-NeSy
[ "a8bd7aab90c34df47f647976dcd449cd203d1f64" ]
[ "jointer.py" ]
[ "import perception, syntax, semantics\nimport numpy as np\nfrom copy import deepcopy\nimport sys\nfrom func_timeout import func_timeout, FunctionTimedOut\nfrom utils import SYMBOLS\nfrom collections import Counter\nfrom time import time\nimport torch\n\nclass Node:\n def __init__(self, symbol, smt):\n sel...
[ [ "numpy.array", "numpy.log", "torch.save", "numpy.argmax", "torch.utils.data.DataLoader", "torch.load", "numpy.argsort" ] ]
dzankov/3D-MIL-QSSR
[ "a66dd78412188d43843cb253736af63f9318d8c8" ]
[ "miqssr/estimators/base_nets.py" ]
[ "import torch\nimport numpy as np\nfrom torch import nn\nimport torch_optimizer as optim\nfrom torch.utils.data import DataLoader\nfrom torch.nn import Sigmoid\nfrom sklearn.model_selection import train_test_split\nfrom .utils import MBSplitter\n\nclass BaseClassifier:\n def loss(self, y_pred, y_true):\n ...
[ [ "torch.nn.MSELoss", "numpy.asarray", "numpy.zeros", "torch.nn.Sigmoid", "torch.no_grad", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "sklearn.model_selection.train_test_split", "numpy.vstack" ] ]
supersteph/slippi-ai
[ "97e0845789e95c1511295bad626a514fff46ce74" ]
[ "tests/unit_tests.py" ]
[ "import unittest\n\nimport numpy as np\nimport tensorflow as tf\n\nimport embed\nimport utils\n\ndef static_rnn(core, inputs, initial_state):\n unroll_length = tf.nest.flatten(inputs)[0].shape[0]\n\n def get_input(i):\n return tf.nest.map_structure(lambda t: t[i], inputs)\n\n state = initial_state\n outputs ...
[ [ "tensorflow.random.uniform", "tensorflow.nest.flatten", "tensorflow.nest.map_structure", "tensorflow.constant", "tensorflow.stack" ] ]
MarieRoald/matcouply
[ "c07350705fc9b34eb884c9dc971e0103cdef9df5" ]
[ "examples/plot_custom_penalty.py" ]
[ "\"\"\"\nExample with custom penalty class for unimodality for all but one component\n---------------------------------------------------------------------------\n\nIn this example, we first demonstrate how to specify exactly how the penalties are imposed in the AO-ADMM fitting\nprocedure. Then, we create a custom ...
[ [ "numpy.concatenate", "scipy.stats.norm.pdf", "numpy.random.default_rng", "numpy.roll", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "numpy.linspace" ] ]
oliverdutton/pyquil
[ "854bf41349393beeeedad7a4481797ad78ae36a5" ]
[ "pyquil/quilbase.py" ]
[ "##############################################################################\n# Copyright 2016-2018 Rigetti Computing\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#\...
[ [ "numpy.log2", "numpy.asarray", "numpy.eye" ] ]
scalabel/scalabel
[ "857a32e1c08e5b9a7ab346468940621c2fe2226a" ]
[ "scalabel/label/transforms.py" ]
[ "\"\"\"General utils functions.\"\"\"\n\nfrom typing import Dict, List, Optional, Tuple\n\nimport matplotlib\nimport matplotlib.patches as mpatches\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.path import Path\nfrom nanoid import generate # type: ignore\nfrom pycocotools import mask as mas...
[ [ "matplotlib.use", "matplotlib.path.Path", "numpy.max", "numpy.array", "numpy.zeros", "numpy.sum", "matplotlib.pyplot.close", "numpy.min", "matplotlib.pyplot.figure" ] ]
ICWallis/fractoolbox
[ "b4b9a8e3f9ed84fc7b099e502070c3a55e4e2898" ]
[ "fractoolbox/transform_stress_tensor.py" ]
[ "\n\nimport numpy as np\nimport math\nimport pandas as pd\n\n\n\ndef Rs(alpha,beta,gamma):\n '''Generates an array that's used to transform (rotate) the stress tensor into a geographic coordinate system \n \n Geographic coordinates are X North, Y East, and Z Down.\n Input Euler angles alpha, beta, gamma...
[ [ "numpy.array", "numpy.arctan", "numpy.sin", "numpy.cos" ] ]
ioannisa92/scanpy
[ "f428848ece1d7a4794090eb70a34a3b8f1953dee" ]
[ "scanpy/tests/test_rank_genes_groups_logreg.py" ]
[ "import pandas as pd\nimport numpy as np\nimport scanpy as sc\n\ndef test_rank_genes_groups_with_renamed_categories():\n adata = sc.datasets.blobs(n_variables=4, n_centers=3, n_observations=200)\n assert np.allclose(adata.X[1], [9.214668, -2.6487126, 4.2020774, 0.51076424])\n \n sc.tl.pca(adata)\n sc...
[ [ "numpy.allclose" ] ]
vpeopleonatank/pytorch_lightning_segmentation_template
[ "4637062d9de840714b2914583c51c4694646a6ab" ]
[ "prostate_cancer_segmentation/train.py" ]
[ "from typing import Any, List\n\nimport hydra\nimport numpy as np\nimport pytorch_lightning as pl\nimport wandb\nfrom omegaconf import DictConfig, OmegaConf\nfrom pytorch_lightning import loggers as pl_loggers\n\nfrom prostate_cancer_segmentation import metrics\nfrom prostate_cancer_segmentation.callbacks.log_media...
[ [ "numpy.stack", "numpy.arange" ] ]
socom20/pix2pix_client-server
[ "5a32bca614759769c7b1d0ee9133e6ed243e9361" ]
[ "websocket_server.py" ]
[ "import sys, os\nimport io\nfrom PIL import Image\n\nimport threading\nimport signal\nimport ssl\nfrom SimpleWebSocketServer import WebSocket, SimpleWebSocketServer, SimpleSSLWebSocketServer\nfrom optparse import OptionParser\n\nimport numpy as np\nimport json\n\nsys.path.append('../pix2pix_wrapper')\nfrom pix2pix_...
[ [ "numpy.repeat", "numpy.array" ] ]
hongningsg/Machine-Learning-and-Deep-Learning
[ "84233a77ac8e736ad4fb26fb8c82995c4de64047" ]
[ "logistic_regression/logistic.py" ]
[ "import numpy as np\nimport time\nfrom copy import deepcopy\nfrom utils.sigmoid import sigmoid, step_function\nfrom utils.check_data import check_data\nfrom sklearn.datasets import load_iris\n\n# Author: Zhengting Li <heyimzhengting@gmail.com>\n\nclass Logistic_Regression():\n\n def __init__(self, early_stop=Fa...
[ [ "numpy.array", "numpy.dot", "numpy.log", "numpy.zeros", "numpy.sum", "numpy.argmax", "sklearn.datasets.load_iris" ] ]
rpc21/tacotron2
[ "93a2c4e648ea76c0ef657b4e811e52147c19d661" ]
[ "classification.py" ]
[ "import os\nimport sys\nimport time\nimport argparse\nimport math\nimport wavio\nimport pdb\nimport numpy as np\nfrom numpy import finfo\nfrom waveglow.glow import WaveGlow\n\nimport torch\nfrom distributed import apply_gradient_allreduce\nimport torch.distributed as dist\nfrom torch.utils.data.distributed import D...
[ [ "torch.cuda.manual_seed", "torch.distributed.init_process_group", "torch.no_grad", "torch.cuda.device_count", "torch.manual_seed", "numpy.finfo", "torch.from_numpy", "torch.cuda.is_available", "torch.distributed.all_reduce", "torch.load", "torch.utils.data.DataLoader", ...
TRUMANCFY/wolf
[ "1a21479256e4f51885e2d2fdd449b1faa61277a6" ]
[ "wolf/modules/discriminators/multi_label.py" ]
[ "__author__ = 'fengyu'\n\nfrom typing import Dict\nfrom overrides import overrides\nimport math\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\nfrom torch.distributions import Bernoulli\n\nfrom wolf.modules.discriminators.discriminator import Discriminator\n\nclass MultiLabelDiscriminator...
[ [ "torch.nn.Linear", "torch.device", "torch.no_grad", "torch.nn.LeakyReLU", "torch.nn.ReLU", "torch.distributions.Bernoulli", "torch.full", "torch.tensor", "torch.nn.init.uniform_", "torch.nn.Embedding", "torch.nn.ELU" ] ]
asif-nuaa/simple_lstm
[ "518d25ab0d79f21da0f662830b09363da8c65581" ]
[ "dataset/clean_data.py" ]
[ "import os\n\nimport pandas as pd\nfrom datetime import datetime\n\n\ndef clean_data():\n file_name = os.path.join(os.path.dirname(os.path.realpath(__file__)), \"data.csv\")\n pd_frame = pd.read_csv(file_name, delimiter=\",\", index_col=False)\n\n pd_frame.drop(labels=pd_frame.columns[[0, 9]], inplace=True...
[ [ "pandas.read_csv" ] ]
piofthings/mini-mecanum
[ "ecab94871ca5f219bdfeb57cb1d101dcf6572198" ]
[ "dev/pi/samples/yuv_to_jpeg.py" ]
[ "from PIL import Image\nfrom PIL import ImageDraw\nfrom PIL import ImageFont\nimport sys\nfrom struct import *\nimport array\nimport numpy as np\nimport os \n\nthisdir = os.getcwd()\nfor r, d, f in os.walk(thisdir):\n for file in f:\n if file.endswith(\".data\"):\n image...
[ [ "numpy.array", "numpy.set_printoptions", "numpy.ones", "numpy.fromfile", "numpy.dstack", "numpy.hstack" ] ]
cadgip/detr
[ "a032506f145d0f5e7951e002b3100b30de6a7d58" ]
[ "main.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved\nimport argparse\nimport datetime\nimport json\nimport random\nimport time\nfrom pathlib import Path\n\nimport numpy as np\nimport torch\nfrom torch.utils.data import DataLoader, DistributedSampler\n\nimport datasets\nimport util.misc as utils\...
[ [ "torch.device", "torch.optim.AdamW", "torch.optim.lr_scheduler.StepLR", "torch.utils.data.RandomSampler", "numpy.random.seed", "torch.utils.data.DistributedSampler", "torch.save", "torch.utils.data.SequentialSampler", "torch.nn.parallel.DistributedDataParallel", "torch.manu...
Little0o0/FedML
[ "720015c90fcfec88d465a81b1e8fb45676dce9fb" ]
[ "fedml_api/model/mobile/torch_lenet.py" ]
[ "import torch\nimport torch.nn as nn\n\n\nclass LeNet(nn.Module):\n def __init__(self):\n super(LeNet, self).__init__()\n self.fc2 = nn.Linear(500, 10)\n self.fc1 = nn.Linear(800, 500)\n self.dp = nn.Dropout(p=0.5)\n self.conv2 = nn.Conv2d(20, 50, (5, 5))\n self.conv1 = ...
[ [ "torch.nn.Linear", "torch.nn.Dropout", "torch.nn.Softmax", "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.reshape" ] ]
TomMakkink/transformers-for-rl
[ "9d025f92611e957004030af9ef05a07e320856a7", "9d025f92611e957004030af9ef05a07e320856a7" ]
[ "utils/logging.py", "agents/a2c.py" ]
[ "import comet_ml\nimport torch\nimport gc\nimport sys\nimport psutil\nimport os\n\n\ndef memReport():\n for obj in gc.get_objects():\n if torch.is_tensor(obj):\n print(type(obj), obj.size())\n\n\ndef cpuStats():\n print(sys.version)\n print(psutil.cpu_percent())\n print(psutil.virtual_...
[ [ "torch.is_tensor" ], [ "numpy.array", "torch.cat", "torch.from_numpy", "torch.sum" ] ]
yanikou19/pymatgen
[ "8ee0d9ff35a9c2fa4f00da5d423e536ed8914e31" ]
[ "pymatgen/electronic_structure/boltztrap.py" ]
[ "# coding: utf-8\n\nfrom __future__ import division, unicode_literals, print_function\n\n\"\"\"\nThis module provides classes to run and analyze boltztrap on pymatgen band\nstructure objects. Boltztrap is a software interpolating band structures and\ncomputing materials properties from this band structure using Bol...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "numpy.linalg.eigh", "matplotlib.pyplot.legend", "matplotlib.pyplot.yticks", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.axvline", "numpy.linalg.inv", "matplotlib.pyplot.xticks" ] ]
LunaLovegoood/traffic-flow
[ "1ae7eab2944f5013f45c7e105409b3a0965aa658" ]
[ "src/plotter.py" ]
[ "# Traffic flow\n#\n# Copyright (c) 2018 Yurii Khomiak\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy...
[ [ "numpy.array", "matplotlib.pyplot.annotate", "scipy.interpolate.make_interp_spline", "matplotlib.pyplot.get_current_fig_manager", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "matplotl...
tho-wa/virushack
[ "2bb057b4557969d4bf8899b78fe9fc2d5ef5ae13" ]
[ "WebcamCounter/WebcamCounter.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# Einkommentieren, falls nur CPU genutzt werden soll\n\n#import os\n#os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"-1\"\n\nimport numpy as np\nimport tensorflow.compat.v1 as tf\nimport cv2\nimport urllib\nfrom datetime import datetime\n\n# Geklaut von https://gist.github.com/ma...
[ [ "tensorflow.compat.v1.Graph", "tensorflow.compat.v1.GraphDef", "tensorflow.compat.v1.Session", "tensorflow.compat.v1.import_graph_def", "numpy.expand_dims", "tensorflow.compat.v1.gfile.GFile" ] ]
lenny93/tensorflow
[ "484e8acedceebec8d7ea5fb008d4c367041c9cff", "e503d9fed6138133fd4e18f23b7cec92dce40ea0" ]
[ "tensorflow/python/keras/losses_test.py", "tensorflow/python/kernel_tests/gather_op_test.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.keras.backend.sigmoid", "tensorflow.python.keras.losses.LogCosh", "numpy.random.rand", "tensorflow.python.keras.losses.mae", "numpy.minimum", "tensorflow.python.keras.losses.deserialize", "tensorflow.python.keras.losses.CosineSimilarity", "tensorflow.python.keras...
BadenLab/2Panalysis
[ "8b23b3eaa1700f4fb5729eb7e89bfd55e7b4811a" ]
[ "quantitative_beta.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Feb 9 11:39:06 2022\n\n@author: SimenLab\n\"\"\"\nimport pathlib\nimport numpy as np \nimport pandas as pd\n\nimport utilities\nimport qualitative\n# data_path = r\"./Data/data_save/1_8dfp_ntc3_512_1.npz\"\n\ndef load_data(path):\n load_path = pathlib.Path(path)\...
[ [ "numpy.max", "numpy.empty", "numpy.min", "numpy.where", "numpy.average", "numpy.expand_dims" ] ]
stephenmac98/cheesepi_python3
[ "d894117938deee8ba676d9872bed5eae388310d1" ]
[ "tests/plot_csv_histogram.py" ]
[ "import math\nimport numpy as np\nimport matplotlib.pyplot as plt\n\ndata = []\n\ndef parse_ping_csv(filename):\n data = np.genfromtxt(filename, delimiter=',', skip_header=1, skip_footer=3)\n # Remove any NaN occurence\n data = data[~np.isnan(data)]\n return data\n\ndef histplot(data, xmin=0, xmax=1000,...
[ [ "numpy.isnan", "matplotlib.pyplot.grid", "numpy.genfromtxt", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.bar" ] ]
tdude92/Acreage-Contour
[ "4f6a6883c32aa15e2aca7a9e1af0d8d8cf69b42d" ]
[ "ml/train.py" ]
[ "import torch\nimport torch.nn as nn\nimport numpy as np\nimport cv2\nimport random\nimport os\n\nfrom model_old import UNet, LC2RGB\n\nos.makedirs(\"out\", exist_ok=True)\n\n# Constants\nMODEL_ID = \"0\"\nCLIP_VALUE = 1\nON_CUDA = torch.cuda.is_available()\n\nN_EPOCHS = 500\nBATCH_SIZE = 16\nLEARN_RATE = 0.001\n\n...
[ [ "torch.nn.NLLLoss", "numpy.zeros", "numpy.stack", "torch.cuda.is_available", "torch.load" ] ]
WeazelDev/ML_Project
[ "8963f15712bd0aa4fbafa96e6dafd0a59d616a53" ]
[ "dataIO/ratingsValidation.py" ]
[ "#-*-coding:Utf-8 -*\n\"\"\"Data validation, to be sure that rating data was imported correctly\"\"\"\n\nimport numpy as np\nimport os\nimport pickle\n\nstart_offset = 0\nchecks = 81\nprint_errors = False\nbase_path = '../TreatedData/0_to_81/'\n\n\ndef sorted_search(ar, x, get_closest=False):\n\tif len(ar) == 0:\n\...
[ [ "numpy.zeros" ] ]
Conzel/CompressAI
[ "55be017e93e25fc936fe0fb4fa5851b3c1032dfc" ]
[ "compressai/models/video/google.py" ]
[ "# Copyright (c) 2021-2022, InterDigital Communications, Inc\n# All rights reserved.\n\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted (subject to the limitations in the disclaimer\n# below) provided that the following conditions are met:\n\n# * Redistributions o...
[ [ "torch.cat", "torch.nn.functional.avg_pool2d", "torch.cuda.amp.autocast", "torch.nn.functional.interpolate", "torch.nn.ReLU", "torch.is_floating_point" ] ]
PsycheShaman/Keras-GAN
[ "9a1f2576af8f67fad7845421ea5feb53012c1c9f", "9a1f2576af8f67fad7845421ea5feb53012c1c9f" ]
[ "bgan/bgan9/bgan9.py", "bgan/bgan.py" ]
[ "from __future__ import print_function, division\n\nimport tensorflow as tf\n\nfrom tensorflow.keras.datasets import mnist\nfrom tensorflow.keras.layers import Input, Dense, Reshape, Flatten, Dropout, MaxPooling2D\nfrom tensorflow.keras.layers import BatchNormalization, Activation, ZeroPadding2D, Reshape\n#from ten...
[ [ "numpy.load", "tensorflow.keras.models.Model", "tensorflow.keras.layers.Reshape", "tensorflow.keras.layers.Dense", "tensorflow.keras.models.Sequential", "tensorflow.keras.layers.BatchNormalization", "numpy.max", "numpy.random.normal", "matplotlib.pyplot.subplots", "tensorfl...
clalancette/demos
[ "885651b766b4bf22145cb84d4daa84bdd2bb6500" ]
[ "topic_monitor/topic_monitor/scripts/topic_monitor.py" ]
[ "# Copyright 2016 Open Source Robotics Foundation, 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...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "matplotlib.pyplot.pause", "matplotlib.pyplot.show" ] ]
nanpuhaha/SerpentAI
[ "4fa7e5d454dd4f3f33f1d756a2a8659f2e789141", "4fa7e5d454dd4f3f33f1d756a2a8659f2e789141", "4fa7e5d454dd4f3f33f1d756a2a8659f2e789141" ]
[ "site-packages/keras/callbacks.py", "site-packages/keras/utils/test_utils.py", "site-packages/keras/engine/topology.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\n\nimport os\nimport csv\n\nimport numpy as np\nimport time\nimport json\nimport warnings\n\nfrom collections import deque\nfrom collections import OrderedDict\nfrom collections import Iterable\nfrom .utils.generic_utils import Progbar\n...
[ [ "tensorflow.Summary", "numpy.less", "tensorflow.summary.image", "tensorflow.image_summary", "tensorflow.expand_dims", "numpy.median", "tensorflow.summary.histogram", "tensorflow.merge_all_summaries", "tensorflow.histogram_summary", "tensorflow.transpose", "tensorflow.sq...
DreamBoatOve/aia_eis
[ "458b4d29846669b10db4da1b3e86c0b394614ceb" ]
[ "v0/aia_eis_v0/circuits/vogit_1.py" ]
[ "import sys\nsys.path.append('../')\nimport numpy as np\nimport math\nimport copy\nimport os\n\nfrom circuits.elements import ele_C, ele_L\nfrom IS.IS import IS_0\nfrom IS.IS_criteria import cal_ChiSquare_0\nfrom utils.file_utils.pickle_utils import pickle_file\nfrom utils.visualize_utils.IS_plots.ny import nyquist...
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "numpy.sum", "numpy.linalg.pinv", "numpy.abs" ] ]
DEVESHTARASIA/hub
[ "ac2a47051dac4a2e9bd0c93eaa8dac550c350608" ]
[ "tensorflow_hub/tensor_info_test.py" ]
[ "# Copyright 2018 The TensorFlow Hub 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 ...
[ [ "tensorflow.saved_model.signature_def_utils.build_signature_def", "tensorflow.sparse_placeholder", "tensorflow.saved_model.utils.build_tensor_info", "tensorflow.get_default_graph", "tensorflow.placeholder", "tensorflow.test.main" ] ]
azseza/ScriptsPy
[ "f8e6889a3fc93dcd79936dc8f869c926ab616997" ]
[ "momentumStrategy.py" ]
[ "import numpy as np\nimport pandas as pd\nfrom pandas_datareader import data\nimport matplotlib.pyplot as plt\n\ndef load_data(ticker, start_date, end_date, output_file):\n \"\"\"\n a data loading function, using the Yahoo Finance API\n \"\"\"\n try:\n df = pd.read_pickle(output_file)\n pr...
[ [ "pandas.read_pickle", "pandas.DataFrame", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.where", "matplotlib.pyplot.show" ] ]
unx-digital/Age-Gender-CNN-TensorFlow
[ "628d7f3e8391333b8c06e103798defe6407f7edb" ]
[ "demo.py" ]
[ "import os\nimport cv2\nimport dlib\nimport numpy as np\nimport argparse\nimport inception_resnet_v1\nimport tensorflow as tf\nfrom imutils.face_utils import FaceAligner\nfrom imutils.face_utils import rect_to_bb\n\n\ndef get_args():\n parser = argparse.ArgumentParser(description=\"This script detects faces from...
[ [ "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.train.get_checkpoint_state", "numpy.shape", "tensorflow.placeholder", "tensorflow.image.per_image_standardization", "tensorflow.nn.softmax", "tensorflow.local_variables_initializer", "tensorflow.global_variables_initia...
runchida/models
[ "0ba83cf0211401a8505505276c59418f15338d31" ]
[ "official/nlp/xlnet/run_pretrain.py" ]
[ "# Copyright 2019 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.distribute.MirroredStrategy", "tensorflow.version.VERSION.startswith", "tensorflow.distribute.experimental.TPUStrategy", "tensorflow.train.Checkpoint" ] ]
mkmenta/stargan
[ "de72ce62b3c456d3827e3404502f474554026486" ]
[ "data_loaders/celeba.py" ]
[ "import os\nimport random\nimport torch\nfrom PIL import Image\nfrom torch.utils import data\n\n\nclass CelebA(data.Dataset):\n \"\"\"Dataset class for the CelebA dataset.\"\"\"\n\n def __init__(self, image_dir, selected_attrs, transform, mode):\n \"\"\"Initialize and preprocess the CelebA dataset.\"\"...
[ [ "torch.FloatTensor" ] ]
asjacobs92/dtextract
[ "b4637574da0a36d6b693805eeae2f35a3057de48" ]
[ "dtextract/impl/dists.py" ]
[ "# Copyright 2015-2016 Stanford University\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 la...
[ [ "numpy.array", "numpy.random.choice", "numpy.empty", "numpy.zeros", "numpy.sum", "numpy.copy", "numpy.shape", "sklearn.mixture.GaussianMixture", "numpy.arange" ] ]
ndwuhuangwei/py-radio-autoencoder
[ "842cd1f14a17ee0798766dffcf132950a9e745bd" ]
[ "radio_autoencoder.py" ]
[ "# File: radio_autoencoder.py\n# Brief: Simulates a radio link over AWGN channel for Uncoded, Hamming \n# coded and Neural network autoencoded radio links.\n# Reproduces the results obtained in \n# \"An Introduction to Deep Learning for the Physical Layer\",\n# Timothy J. O'Shea, ...
[ [ "matplotlib.pyplot.grid", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.title", "matplotlib.pyplot.semilogy", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.show" ] ]
Octavian-ai/mac-graph
[ "3ef978e8a6f79f2dcc46783d34f01934aabf7f19" ]
[ "macgraph/print_util.py" ]
[ "\nimport tensorflow as tf\nimport numpy as np\n\nfrom colored import fg, bg, stylize\nfrom .const import EPSILON\nimport math\nimport networkx as nx\n\n\nTARGET_CHAR_WIDTH = 80\n\ndef hr_text(text):\n\tt_len = len(text) + 2\n\tpad_len = (TARGET_CHAR_WIDTH - t_len) // 2\n\tpadding = '-'.join([\"\" for i in range(pa...
[ [ "numpy.minimum", "numpy.set_printoptions", "numpy.shape", "numpy.amax", "numpy.abs", "numpy.amin", "numpy.around", "numpy.maximum" ] ]
PhilipeRLeal/xarray_case_studies
[ "b7771fefde658f0d450cbddd94637ce7936c5f52" ]
[ "scripts/regridding/KdTree_IDW.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Thu Dec 10 13:57:10 2020\n\n@author: Philipe_Leal\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport os, sys\nimport geopandas as gpd\nimport cartopy.crs as ccrs\n\npd.set_option('display.max_rows', 5000)\npd.set_option('display.max...
[ [ "numpy.flip", "pandas.set_option" ] ]
nju-websoft/TSQA
[ "d0b3f0c3a5e55a46fc5d281cae09597aa7f76e2e" ]
[ "preprocess_data.py" ]
[ "import argparse\nimport os\nimport threading\n\nfrom sklearn.model_selection import KFold\n\nif not os.path.exists('tmp'):\n os.makedirs('tmp')\nif not os.path.exists('tmp_sh'):\n os.makedirs('tmp_sh')\nif not os.path.exists('outputs'):\n os.makedirs('outputs')\nif not os.path.exists('models'):\n os.ma...
[ [ "sklearn.model_selection.KFold" ] ]
gargiani/VRPG
[ "429fe58b089df2f4cdedab01b05564230e2317ac" ]
[ "VR_REINFORCE/environments.py" ]
[ "import torch\nimport gym\nimport random\nimport numpy as np\n\ntorch.backends.cudnn.deterministic=True\n\nclass Environment:\n\n def __init__(self, render=False, seed=None):\n \n self.render = render\n self.env_seed = seed\n\n def set_seed(self):\n\n if self.env_seed is not None:\n ...
[ [ "torch.cuda.manual_seed", "numpy.asarray", "numpy.random.seed", "torch.manual_seed", "torch.random.manual_seed", "torch.tensor" ] ]
JosemaAlvarez/MoSQITo
[ "95754e91ff42906e6f1899aa3f6b6a4980d34d8a" ]
[ "mosqito/tests/sharpness/test_sharpness.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Dec 16 09:20:41 2020\n\n@author: wantysal\n\"\"\"\n\nimport sys\nsys.path.append('../../..')\n\n#Standard imports\nimport numpy as np\nimport pytest\n\n# Local application imports\nfrom mosqito.functions.shared.load import load\nfrom mosqito.functions.sharpness.comp_...
[ [ "numpy.amax", "numpy.amin" ] ]
CEMES-CNRS/pymodaq_plugins_moke
[ "70bd3c0fed9eabd504d1c49b6412807faa64171c" ]
[ "src/pymodaq_plugins_moke/utils/steps_sequence.py" ]
[ "import numpy as np\nfrom pymodaq.daq_utils.gui_utils.custom_app import CustomApp\nfrom pymodaq.daq_utils.gui_utils.dock import Dock, DockArea\nfrom pymodaq.daq_utils.gui_utils.file_io import select_file\nfrom pymodaq.daq_utils.gui_utils.widgets.table import TableModel, SpinBoxDelegate\n\nfrom qtpy import QtWidgets...
[ [ "numpy.sign", "numpy.array", "numpy.loadtxt", "numpy.abs" ] ]
ishine/asv-subtools
[ "a678b8f3327de0e99c445a79a9e91e5e0e006b11" ]
[ "pytorch/libs/training/lr_finder.py" ]
[ "# -*- coding:utf-8 -*-\n\n# Copyright xmuspeech (Author: Snowdar 2020-02-20)\n\nimport math\nimport logging\nimport numpy as np\nimport progressbar\n\nfrom torch.utils.data import DataLoader\nfrom torch.optim.optimizer import Optimizer\nfrom .reporter import LRFinderReporter\n\nimport libs.support.utils as utils\n...
[ [ "numpy.array", "numpy.vstack" ] ]
carlosruperto/astr-119-hw-2
[ "3a7a043bb56775f7824ea382605415900c777439" ]
[ "Data_types.py" ]
[ "import numpy as np\t\t#import numpy library\r\n\r\n#integers\r\n\r\ni = 10\t\t\t#integer\r\nprint(type(i))\t#print out the data type of i\r\n\r\na_i = np.zeros(i,dtype=int)\t#declare an array of ints\r\nprint(type(a_i))\t\t\t#will return ndarray\r\nprint(type(a_i[0]))\t\t\t#will return int64\r\n\r\n#floats\r\n\r\n...
[ [ "numpy.zeros" ] ]
whitehatty/prophet
[ "23f4209b91a6d8e988c77674f93272506b813b7d" ]
[ "python/fbprophet/forecaster.py" ]
[ "# -*- coding: utf-8 -*-\n# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the BSD-style license found in the\n# LICENSE file in the root directory of this source tree. An additional grant\n# of patent rights can be found in the PATENTS file in the same d...
[ [ "pandas.datetime", "numpy.ones_like", "numpy.random.rand", "pandas.crosstab", "numpy.exp", "numpy.nanmean", "pandas.concat", "numpy.cumsum", "numpy.concatenate", "numpy.random.normal", "pandas.Timedelta", "numpy.log", "numpy.nanpercentile", "pandas.DataFrame...
invincyx/tensorrec
[ "3b10dd53af06526b250ac2e310499d7aded446b0" ]
[ "tensorrec/recommendation_graphs.py" ]
[ "import tensorflow as tf\n\n\ndef project_biases(tf_features, n_features):\n \"\"\"\n Projects the biases from the feature space to calculate bias per actor\n :param tf_features:\n :param n_features:\n :return:\n \"\"\"\n tf_feature_biases = tf.Variable(tf.zeros([n_features, 1]))\n\n # The r...
[ [ "tensorflow.multiply", "tensorflow.zeros", "tensorflow.shape", "tensorflow.expand_dims", "tensorflow.nn.top_k", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.transpose", "tensorflow.reduce_max", "tensorflow.nn.softmax", "tensorflow.stack", "tensorflow.gathe...
violencedetector/realtime
[ "a17655fc3989ab57ce5a1f358fc43ee85a96ed3b" ]
[ "violence_detector.py" ]
[ "#################################################################\n#VIOLENCE DETECTOR PROJECT MORE INFO AT violencedetector.org\n#Usage python3 violence_detector.py -i gun.jpg\n#################################################################\n\nfrom keras.applications.mobilenet import MobileNet\nfrom keras.prepro...
[ [ "numpy.expand_dims" ] ]
StepicOrg/submissions-clustering
[ "d61f4cd24ff165ed9b0cdde79d9dcd1ffae47387" ]
[ "_legacy/score.py" ]
[ "from itertools import takewhile\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport pandas as pd\nimport seaborn as sns\nfrom sklearn.neighbors import NearestNeighbors\nfrom tqdm import tqdm\n\nfrom sc.scorers import ratio\n\n\ndef find_centers(X, y):\n c = []\n for label in range(y.max() + 1):\n ...
[ [ "matplotlib.pyplot.show", "numpy.array", "numpy.ones", "pandas.read_csv" ] ]
DusanSulan/vision
[ "4c058e46b26d0755d42c6c1127ef81ab6d5d12b9" ]
[ "references/detection/engine.py" ]
[ "import math\nimport sys\nimport time\nimport torch\n\nimport torchvision.models.detection.mask_rcnn\n\nfrom coco_utils import get_coco_api_from_dataset\nfrom coco_eval import CocoEvaluator\nimport utils\n\n\ndef train_one_epoch(model, optimizer, data_loader, device, epoch, print_freq):\n model.train()\n metr...
[ [ "torch.device", "torch.cuda.synchronize", "torch.no_grad", "torch.get_num_threads", "torch.set_num_threads" ] ]
cbrummitt/machine_learned_patterns_in_economic_development
[ "1da4c55977a27dd5be101b1c5dfe489d14794b34" ]
[ "scripts/analyze_panel_data/visualization/inferred_model.py" ]
[ "# inferred_model.py contains functions to visualize\n# timeseries, models for predicting them, and their comparison.\n#\n# Authors:\n# Charlie Brummitt <charles_brummitt@hms.harvard.edu>, Github: cbrummitt\n# Andres Gomez <Andres_Gomez@hks.harvard.edu>\nimport itertools\n\nimport matplotlib as mpl\nimport matplotl...
[ [ "numpy.dot", "matplotlib.colorbar.make_axes", "numpy.min", "matplotlib.patches.Ellipse", "scipy.spatial.ConvexHull", "sklearn.utils.check_array", "numpy.max", "numpy.empty", "matplotlib.pyplot.subplots", "numpy.prod", "numpy.sqrt", "numpy.vstack", "numpy.array",...
jithin-mathew/Python-Autocomplete
[ "22eed500f4933420415fdb220454cee9ca7cc730" ]
[ "train.py" ]
[ "import gc\nimport math\nfrom typing import List\n\nimport numpy as np\nimport torch\nimport torch.nn\n\nimport parser.load\nfrom lab.experiment.pytorch import Experiment\nfrom simple_model import SimpleLstmModel\nfrom parser import tokenizer\n\n# Configure the experiment\n\nEXPERIMENT = Experiment(name=\"simple_ls...
[ [ "torch.zeros", "torch.device", "numpy.array", "numpy.concatenate", "numpy.reshape", "numpy.zeros", "numpy.copy", "numpy.random.shuffle", "numpy.random.randint", "numpy.transpose", "torch.tensor", "torch.nn.CrossEntropyLoss" ] ]
mingxuts/multi-center-fed-learning
[ "9262ddaefb79b14ea44b61ffce200b82d31b0af1" ]
[ "models/femnist/cnn.py" ]
[ "import tensorflow as tf\n\nfrom model import Model\nimport numpy as np\n\n\nIMAGE_SIZE = 28\n\ndef get_convolution_extractor_shape(filter_list):\n with tf.Graph().as_default():\n \"\"\"Model function for CNN.\"\"\"\n features = tf.placeholder(\n tf.float32, shape=[None, IMAGE_SIZE * IMA...
[ [ "numpy.array", "tensorflow.layers.max_pooling2d", "tensorflow.argmax", "tensorflow.equal", "tensorflow.Graph", "tensorflow.reshape", "tensorflow.layers.conv2d", "tensorflow.placeholder", "tensorflow.losses.sparse_softmax_cross_entropy", "tensorflow.layers.dense", "tenso...
THU-KEG/NGS
[ "e5854e0be58381c97151ac07ed7be7aa9ab62f62" ]
[ "NGS-DMBERT/Gibbs_an_bert.py" ]
[ "from __future__ import print_function\nfrom constant import *\nfrom models import *\nfrom dataset import *\nfrom utils import f_score\nimport os\nimport sys\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom sklearn.metrics import f1_score,p...
[ [ "numpy.delete", "numpy.array", "numpy.zeros", "torch.max", "torch.FloatTensor", "numpy.where", "torch.cuda.set_device", "torch.cuda.is_available", "torch.LongTensor", "torch.load", "numpy.append", "numpy.insert" ] ]
ishine/acoular
[ "4d790517adb38dc012b1f06966262b94f3625358" ]
[ "acoular/fbeamform.py" ]
[ "# -*- coding: utf-8 -*-\n#pylint: disable-msg=E0611, E1101, C0103, R0901, R0902, R0903, R0904, W0232\n#------------------------------------------------------------------------------\n# Copyright (c) 2007-2021, Acoular Development Team.\n#-----------------------------------------------------------------------------...
[ [ "numpy.dot", "scipy.linalg.eigh", "numpy.tile", "numpy.invert", "numpy.sign", "numpy.size", "scipy.optimize.linprog", "scipy.linalg.eigvals", "numpy.full", "numpy.zeros_like", "numpy.linalg.norm", "numpy.hsplit", "sklearn.linear_model.LassoLarsCV", "scipy.li...
umbratek-application/utra_ros_visual
[ "22af9d1e5b6bfc8155074431638abbc44122d116" ]
[ "scripts/yolov5_ros/utils/datasets.py" ]
[ "# YOLOv5 🚀 by Ultralytics, GPL-3.0 license\n\"\"\"\nDataloaders and dataset utils\n\"\"\"\n\nimport glob\nimport hashlib\nimport json\nimport os\nimport random\nimport shutil\nimport time\nfrom itertools import repeat\nfrom multiprocessing.pool import Pool, ThreadPool\nfrom pathlib import Path\nfrom threading imp...
[ [ "torch.cat", "torch.stack", "numpy.load", "numpy.concatenate", "numpy.full", "numpy.zeros_like", "numpy.save", "numpy.flipud", "torch.tensor", "numpy.arange", "torch.zeros", "numpy.array", "numpy.zeros", "numpy.stack", "numpy.clip", "numpy.fliplr", ...
McGrady00H/Zhusuan-Jittor
[ "e73c6e3081afde305b9caba80858543abf168466" ]
[ "zhusuan/distributions/normal.py" ]
[ "import jittor as jt\nimport numpy as np\n\nfrom zhusuan.distributions.base import Distribution\n\n\nclass Normal(Distribution):\n \"\"\"\n The class of univariate Normal distribution.\n See :class:`~zhusuan.distributions.base.Distribution` for details.\n\n :param mean: A `float` Var. The mean of the No...
[ [ "numpy.log" ] ]
hietalajulius/rlk
[ "41adbfad276c09f78c7ad75d75bee13d0cde2aaf" ]
[ "rlkit/launchers/launcher_util.py" ]
[ "import datetime\nimport json\nimport os\nimport os.path as osp\nimport pickle\nimport random\nimport sys\nimport time\nfrom collections import namedtuple\n\nimport __main__ as main\nimport dateutil.tz\nimport numpy as np\n\nfrom rlkit.core import logger\nfrom rlkit.launchers import conf\nfrom rlkit.torch.pytorch_u...
[ [ "numpy.random.seed" ] ]
zcjl/python-works
[ "20afc0c179d08fc8628eec498862a5e675664b67" ]
[ "py3-work/gravity_sku_selection.py" ]
[ "# coding=utf-8\n\nfrom itertools import combinations\nimport numpy as np\n\n\nclass SKU:\n def __init__(self, name, gravity, deviation):\n self.name = name\n self.gravity = gravity\n self.deviation = deviation\n\n def __repr__(self):\n return \"<SKU name:%s gravity:%d deviation:%d...
[ [ "numpy.unique" ] ]
ShaunHeNJU/DeepRec-1
[ "e280fb19de179f03dc05e1d8e3f4f7459796d96e", "e280fb19de179f03dc05e1d8e3f4f7459796d96e" ]
[ "tensorflow/python/autograph/converters/directives_test.py", "tensorflow/python/training/session_manager.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.autograph.lang.directives.set_loop_options", "tensorflow.python.autograph.converters.directives.transform", "tensorflow.python.platform.test.main", "tensorflow.python.autograph.lang.directives.set_element_type", "tensorflow.python.autograph.converters.directives._map_args", ...
tsutterley/read-ICESat-2
[ "5939e3504185e4e2e7cd070c1728d0fe217bbe88" ]
[ "scripts/MPI_DEM_ICESat2_ATL11.py" ]
[ "#!/usr/bin/env python\nu\"\"\"\nMPI_DEM_ICESat2_ATL11.py\nWritten by Tyler Sutterley (10/2021)\nDetermines which digital elevation model tiles to read for a given ATL11 file\nReads 3x3 array of tiles for points within bounding box of central mosaic tile\nInterpolates digital elevation model to locations of ICESat-...
[ [ "numpy.full", "numpy.array", "numpy.ceil", "numpy.zeros", "numpy.ma.zeros", "numpy.ones", "numpy.shape", "numpy.nonzero", "numpy.arange", "numpy.abs", "numpy.isfinite" ] ]
DrWiki/Pytorch-yolov4
[ "51afcf3ca5167620b8975cde7d548f5c6ddac946" ]
[ "predict.py" ]
[ "#-----------------------------------------------------------------------#\n# predict.py将单张图片预测、摄像头检测、FPS测试和目录遍历检测等功能\n# 整合到了一个py文件中,通过指定mode进行模式的修改。\n#-----------------------------------------------------------------------#\nimport time\n\nimport cv2\nimport numpy as np\nfrom PIL import Image\n\nfrom yolo impo...
[ [ "numpy.uint8" ] ]
diveki/groceryPriceCompare
[ "ad98c7d9d6aa287b1630c1a74f4bca485dfb9c71" ]
[ "virtual/Scripts/f2py.py" ]
[ "#!h:\\zsolt\\python\\grocerypricecompare\\virtual\\scripts\\python.exe\n# See http://cens.ioc.ee/projects/f2py2e/\nfrom __future__ import division, print_function\n\nimport os\nimport sys\nfor mode in [\"g3-numpy\", \"2e-numeric\", \"2e-numarray\", \"2e-numpy\"]:\n try:\n i = sys.argv.index(\"--\" + mode...
[ [ "numpy.f2py.main" ] ]
boostjanbjorge/adventofcode
[ "5cdd540a553550b1000496dfa39cbf7cf431a85f" ]
[ "stian/day2/part2.py" ]
[ "import pandas as pd\ndf = pd.read_csv(\"day2.txt\", names=(\"dir\", \"val\"), delim_whitespace=True)\ndef aim(row):\n if row.dir==\"down\":\n return row.val\n elif row.dir == \"up\":\n return -row.val\n return 0\ndf[\"aim\"] = df.apply(aim, axis=1).cumsum()\ndepth = df.apply(lambda row: row....
[ [ "pandas.read_csv" ] ]
hsilva664/Reinforcement_Learning_Course
[ "6a250bc017965bec76b6fe909068e40127e62fa7" ]
[ "hw1/code/dagger.py" ]
[ "#!/usr/bin/env python\n\nimport os\nimport pickle\nimport tensorflow as tf\nimport numpy as np\nimport tf_util\nfrom model import fc_net\nfrom tensorflow.python import debug as tf_debug\nfrom global_defs import GlobalDefs\nimport load_policy\n\nclass GetBatch(object):\n def __init__(self, obs, act, shuffle, bat...
[ [ "numpy.concatenate", "numpy.array", "tensorflow.train.AdamOptimizer", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.gfile.Exists", "numpy.random.shuffle", "tensorflow.ConfigProto", "tensorflow.gfile.MakeDirs", "numpy.random.randint", "tensorflow.name_scope...
bruinxiong/DisentangledFaceGAN
[ "625e2077493fdc96bcab6105fc4b39185dd820ad" ]
[ "renderer/mesh_renderer.py" ]
[ "# Copyright 2017 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "tensorflow.zeros", "tensorflow.concat", "tensorflow.expand_dims", "tensorflow.matmul", "tensorflow.reshape", "tensorflow.constant", "tensorflow.zeros_like", "tensorflow.clip_by_value", "tensorflow.reduce_sum", "tensorflow.stack", "tensorflow.pow", "tensorflow.add",...
Sanster/lama-cleaner
[ "20acc58435639d6438a962e392ca1cf89b9755f6" ]
[ "lama_cleaner/server.py" ]
[ "#!/usr/bin/env python3\n\nimport io\nimport logging\nimport multiprocessing\nimport os\nimport time\nimport imghdr\nfrom pathlib import Path\nfrom typing import Union\n\nimport cv2\nimport torch\nimport numpy as np\nfrom loguru import logger\n\nfrom lama_cleaner.model_manager import ModelManager\nfrom lama_cleaner...
[ [ "numpy.concatenate", "torch.device", "torch._C._jit_override_can_fuse_on_gpu", "torch.cuda.empty_cache", "torch._C._jit_set_nvfuser_enabled", "torch._C._jit_set_texpr_fuser_enabled", "torch._C._jit_override_can_fuse_on_cpu" ] ]
Soton-Song/valentine
[ "9a47859f912540cdbe961ed3585201d3accd07be" ]
[ "algorithms/embdi/side_scripts/generate_functional_dependencies.py" ]
[ "import pandas as pd\nimport numpy as np\n\n\ndef generate_noisy_dataframe(df, frac_nulls):\n df_mat = df.to_numpy()\n tot_values = df_mat.size\n null_values = int(tot_values * frac_nulls)\n # print(null_values)\n arr = np.array([1] * null_values + [0] * (tot_values - null_values))\n np.random...
[ [ "numpy.array", "numpy.random.shuffle", "pandas.concat", "numpy.ma.masked_array", "pandas.read_csv", "pandas.Series" ] ]
JackMing1986/MultipleVsiualTasks
[ "7f2bd81c41bcd41af34f6953101038201a4f7d37", "7f2bd81c41bcd41af34f6953101038201a4f7d37" ]
[ "mvt/blocks/det_heads/anchor_free.py", "tools/model_export/det_pytorch2onnx.py" ]
[ "from abc import abstractmethod\nimport torch\nimport torch.nn as nn\n\nfrom mvt.cores.ops import ConvModule\nfrom mvt.utils.init_util import bias_init_with_prob, normal_init\nfrom mvt.utils.misc_util import multi_apply\nfrom ..block_builder import HEADS, build_loss\nfrom .base_det_head import BaseDetHead\nfrom .de...
[ [ "torch.arange", "torch.meshgrid", "torch.nn.Conv2d", "torch.nn.ModuleList" ], [ "numpy.array", "torch.arange", "torch.from_numpy", "numpy.where", "torch.tensor", "torch.onnx.export", "torch.index_select" ] ]
g-leech/masks_v_mandates
[ "44f78b14c095f10f5b7c1b2046c2d39ccbd868d3" ]
[ "scripts/sensitivity_analysis/script_utils.py" ]
[ "\"\"\"\n:code:`script_utils.py`\nUtilities to support the use of command line sensitivity experiments\n\"\"\"\nimport os\n\nimport numpy as np\nimport yaml\n\nfrom epimodel.pymc3_models.mask_models import *\n\n\ndef get_target_accept_from_model_str(model_type_str):\n # default\n return 0.9\n\n\ndef get_tree_...
[ [ "numpy.asarray" ] ]
huangleiBuaa/XBNBlock
[ "c33650aa470fc5fd6da9b9f5491002b1bd70be2f" ]
[ "models/mobilenetV2_XBNBlock.py" ]
[ "import torch.nn as nn\nimport math\n\n\n__all__ = ['mobilenet_v2_XBNBlock']\n\nimport extension as my\n\ndef conv_bn(inp, oup, stride):\n return nn.Sequential(\n nn.Conv2d(inp, oup, 3, stride, 1, bias=False),\n nn.BatchNorm2d(oup),\n #my.Norm(oup),\n nn.ReLU6(inplace=True)\n )\n\n...
[ [ "torch.nn.Linear", "numpy.ceil", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.utils.model_zoo.load_url", "torch.nn.ReLU6", "torch.nn.Conv2d" ] ]
hendrycks/GELUs
[ "55e8964c6ca1bd36c004a619df396547c6c2a6a9" ]
[ "SGDR_WRNs_gelu.py" ]
[ "\"\"\"\nLasagne implementation of SGDR on WRNs from \"SGDR: Stochastic Gradient Descent with Restarts\" (http://arxiv.org/abs/XXXX)\nThis code is based on Lasagne Recipes available at\nhttps://github.com/Lasagne/Recipes/blob/master/papers/deep_residual_learning/Deep_Residual_Learning_CIFAR-10.py\nand on WRNs imple...
[ [ "numpy.concatenate", "numpy.pad", "numpy.random.random_integers", "numpy.zeros", "numpy.load", "numpy.random.shuffle", "numpy.mean", "numpy.float32", "numpy.arange", "numpy.dstack" ] ]
LunarShen/SECRET
[ "0f652e63ce760ece8690cbad013f0d9bdb341e84" ]
[ "secret/cluster/faiss_utils.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport os, sys\nimport time\nimport numpy as np\nfrom scipy.spatial.distance import cdist\nimport gc\nimport faiss\nimport logging\n\nimport torch\nimport torch.nn.functional as F\n\ndef swig_ptr_from_FloatTensor(x):\n assert x.is_contiguous()\n assert x.dtype...
[ [ "numpy.zeros_like", "torch.cuda.synchronize", "numpy.zeros", "numpy.minimum", "torch.nn.functional.softmax", "numpy.mean", "numpy.where", "numpy.intersect1d", "numpy.append", "numpy.around", "torch.empty", "numpy.unique" ] ]
glaumarkus/CarND-Capstone
[ "4cfb7e94d9b1e337612733330989ec1fbf8c1854" ]
[ "ros/src/waypoint_updater/waypoint_updater.py" ]
[ "#!/usr/bin/env python\nimport numpy as np\nimport rospy\nfrom geometry_msgs.msg import PoseStamped\nfrom std_msgs.msg import Int32, Bool\nfrom styx_msgs.msg import Lane, Waypoint\nfrom scipy.spatial import KDTree\n\nimport math\n\n'''\nThis node will publish waypoints from the car's current position to some `x` di...
[ [ "scipy.spatial.KDTree", "numpy.array", "numpy.dot" ] ]
Chinmay-47/vizml
[ "3684e99055c2e5207d3d88c80b3c0d7a809ed65a", "3684e99055c2e5207d3d88c80b3c0d7a809ed65a" ]
[ "src/vizml/multi_linear_regression/regression.py", "src/vizml/logistic_regression/dashboard.py" ]
[ "from typing import Any\n\nimport numpy as np\nimport plotly.graph_objects as go\nfrom plotly.graph_objects import Figure\nfrom sklearn.linear_model import LinearRegression, Lasso, Ridge\nfrom vizml._dashboard_configs import DASH_STYLE, PLOT_TEMPLATE\nfrom vizml.data_generator import Linear1DGenerator, Linear2DGene...
[ [ "numpy.concatenate", "sklearn.linear_model.Ridge", "sklearn.linear_model.Lasso", "sklearn.linear_model.LinearRegression" ], [ "numpy.random.seed", "numpy.random.randint" ] ]
quanpn90/NMTGMinor
[ "0e5f989c8bc01c6c8dc3a8c1ce7c05bfd884b796" ]
[ "onmt/models/fairseq_bart/bart.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\"\"\"\nBART: Denoising Sequence-to-Sequence Pre-training for\nNatural Language Generation, Translation, and Comprehension\n\"\"\"\nfr...
[ [ "torch.nn.Linear", "torch.zeros", "torch.nn.Dropout", "torch.nn.ModuleDict", "torch.nn.init.normal_", "torch.nn.utils.spectral_norm" ] ]
vhirtham/weldx
[ "50d212e9755271d7299acac103f3f0a8f1390fd6" ]
[ "tests/test_utility.py" ]
[ "\"\"\"Test the internal utility functions.\"\"\"\n\nimport math\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nimport xarray as xr\nfrom pandas import DatetimeIndex as DTI\nfrom pandas import TimedeltaIndex as TDI\nfrom pandas import date_range\nfrom pint.errors import DimensionalityError\n\nimport wel...
[ [ "numpy.array", "numpy.isnan", "numpy.vectorize", "pandas.DatetimeIndex", "numpy.zeros", "pandas.date_range", "numpy.ones", "pandas.timedelta_range", "numpy.eye", "pandas.Timestamp", "numpy.arange", "numpy.timedelta64", "numpy.all", "pandas.TimedeltaIndex", ...
xxchenxx/pixelfly
[ "6c366dab855bede8b8ff0d6c8473a64a790bd042" ]
[ "tests/ops/test_fused_softmax_dropout.py" ]
[ "import math\n\nimport torch\nimport torch.nn.functional as F\n\nimport pytest\n\nfrom einops import rearrange, repeat\n\nfrom src.ops.fused_softmax_dropout import _fused_softmax_dropout\n\n\n@pytest.mark.parametrize('dtype', [torch.float16])\n@pytest.mark.parametrize('seqlen', [128, 512, 1024])\ndef test_softmax_d...
[ [ "torch.zeros", "torch.arange", "torch.random.manual_seed", "torch.autograd.grad", "torch.randint", "torch.randn_like", "torch.nn.functional.softmax", "torch.allclose", "torch.randn" ] ]
samleoqh/MultiModNet
[ "e10543c732c26c3c0cdf50960eb4a34b51c9c4e8" ]
[ "lib/functions.py" ]
[ "import numpy as np\n\nimport torch\nfrom torch import Tensor\n\nfrom PIL import Image, ImageEnhance\n\ndef torch_none(x: Tensor):\n return x\n\n\ndef torch_rot90_(x: Tensor):\n return x.transpose_(2, 3).flip(2)\n\n\ndef torch_rot90(x: Tensor):\n return x.transpose(2, 3).flip(2)\n\n\ndef torch_rot90_(x: Te...
[ [ "torch.nn.functional.pad", "numpy.asarray" ] ]
w-garcia/insightface
[ "4feee70ad3c3a4ba8f912d474a83a4b87b320103" ]
[ "retinaface/predict.py" ]
[ "from __future__ import absolute_import, division, print_function, unicode_literals\n\nimport argparse\nimport sys\n\nimport numpy as np\nimport yaml\n\nfrom retinaface.backbones.resnet_v1_fpn import ResNet_v1_50_FPN\nfrom retinaface.models.models import RetinaFace\nfrom retinaface.utils.anchor import AnchorUtil\nf...
[ [ "numpy.concatenate", "numpy.reshape" ] ]
charlottedrb/BachelorDIM-Lectures-Algorithms-2020
[ "f34cb432cd2b34b548cbc44539084831fd45695e" ]
[ "assignements/Session1/S1_algotools.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Wed Sep 15 14:39:41 2020\n\n@author: derbaghc\n\"\"\"\n\nimport numpy as np\nfrom random import *\n\n\ndef average_above_zero(table: list):\n \"\"\"\n Fonction qui calcule la moyenne des valeurs d'un tableau donné, en \n sélectionnant seulement les valeurs posit...
[ [ "numpy.where", "numpy.ones", "numpy.empty", "numpy.zeros" ] ]
makquel/object_detection_BGE
[ "f51e602fe9c5aaa456986c856d6f0283c4b3f283" ]
[ "sandbox/quiver_polar.py" ]
[ "# Plotting tutorials in Python\n# Polar Plots\n\nimport numpy as np\n\nimport matplotlib.pyplot as plt\nimport matplotlib as mpl\n\nmpl.style.use('default')\n\n# Parameters\nn = 2001\nf = np.pi\nr = 5.0\n\n# Data\ntheta = np.linspace(0, 20.0*np.pi, n)\ncurve1 = r*np.cos(f*theta)\ncurve2 = r*np.sin(f*theta)\n\n# Ge...
[ [ "numpy.sin", "matplotlib.style.use", "matplotlib.pyplot.grid", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "numpy.cos", "matplotlib.pyplot.show", "numpy.linspace", "matplotlib.pyplot.subplot" ] ]
michael1788/TED
[ "247c37f168e178cae1237207c07d4a34679ce126" ]
[ "src/python/helper.py" ]
[ "import sys, os\nimport pickle\nimport pandas as pd\nimport re\nimport numpy as np\n\nfrom rdkit import Chem\nfrom rdkit.Chem import AllChem\nfrom rdkit.Chem.MolStandardize import rdMolStandardize \nfrom rdkit import rdBase\nrdBase.DisableLog('rdApp.*')\n\n\ndef save_obj(obj, name):\n \"\"\"save an object with p...
[ [ "numpy.zeros", "numpy.log", "numpy.sum", "numpy.argsort", "pandas.read_csv", "numpy.expand_dims" ] ]
kalaLokia/fbr_costanalysis
[ "78c5e838764a9857c31eab1326a96b9cb8114b2a" ]
[ "core/load_database.py" ]
[ "\"\"\"\nLoad the Database to memory. \n\"\"\"\n\nimport warnings\nimport pandas as pd\n\nfrom app import APPLOG\nfrom app.base import App, MainApplication\nfrom core.create_db import createBomDB\nfrom core.settings import (\n DB_DIR,\n BOM_DATA_DIR,\n ITEM_DATA_DIR,\n ARTICLE_RATES_DIR,\n DB_MOD,\n ...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.read_sql", "pandas.read_excel" ] ]
kpmrozowski/basic-neural-network
[ "affc5b686ce716765c18e9dfb2bd1d3a4ce5c7e6" ]
[ "utils.py" ]
[ "# import pandas as pd\nimport numpy as np\n\ndef read_csv_file(method, file, type, count):\n # AttributeError: 'str' object has no attribute 'astype'\n # method = method.astype(str)\n # file = file.astype(str)\n # type = type.astype(str)\n # count = count.astype(str)\n\n # csv_fil...
[ [ "numpy.sum", "numpy.array_str", "numpy.unique" ] ]
phcanalytics/precisionfda_brain_cancer_biomarker
[ "d11e4b3c20a7bf62b897919ce525d1b5d9602564" ]
[ "precision_fda_brain_biomarker/models/baselines/ensemble.py" ]
[ "\"\"\"\nCopyright (C) 2019 F.Hoffmann-La Roche Ltd\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\ndocumentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, me...
[ [ "numpy.sum", "numpy.array" ] ]
fusion-ml/OCBO
[ "fb330ec4ac2ed0f6167eebd849c23fe61692c11c" ]
[ "src/strategies/joint_opt.py" ]
[ "\"\"\"\nMulti-Opt strategy that uses a joint GP instead of many GPs.\n\"\"\"\nfrom __future__ import division\n\nfrom argparse import Namespace\nfrom copy import deepcopy\nfrom dragonfly.gp.euclidean_gp import euclidean_gp_args\nfrom dragonfly.utils.option_handler import get_option_specs, load_options\nfrom util.m...
[ [ "numpy.argmax", "numpy.append" ] ]