repo_name stringlengths 6 130 | hexsha list | file_path list | code list | apis list |
|---|---|---|---|---|
arpanmangal/ML-A3 | [
"756d211943ef7d2e55b2beb787b1f9e584ce936d"
] | [
"Q2/nnetwork.py"
] | [
"\"\"\"\nThe class of Neural Network\n\"\"\"\nimport numpy as np\nfrom plot import make_confusion_matrix\n\nclass NNetwork:\n def __init__ (self, num_input, sizes, num_output, batch_size, useRELU=False):\n self.sizes = sizes[:]\n self.sizes.append (num_output)\n self.sizes.insert(0, num_inpu... | [
[
"numpy.matmul",
"numpy.zeros",
"numpy.sum",
"numpy.random.randn",
"numpy.exp",
"numpy.random.shuffle",
"numpy.multiply",
"numpy.argmax",
"numpy.maximum"
]
] |
cgravill/transformers | [
"90d5ab3bfe8c20d9beccfe89fdfd62a8e5ac31e5"
] | [
"src/transformers/models/longformer/modeling_longformer.py"
] | [
"# coding=utf-8\n# Copyright 2020 The Allen Institute for AI team and The HuggingFace Inc. team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/lice... | [
[
"torch.nn.Linear",
"torch.cat",
"torch.einsum",
"torch.bmm",
"torch.ones",
"torch.masked_fill",
"torch.nn.functional.pad",
"torch.nn.CrossEntropyLoss",
"torch.nn.LayerNorm",
"torch.tensor",
"torch.zeros_like",
"torch.zeros",
"torch.nn.Tanh",
"torch.nn.functi... |
Codejoy-Lab/models | [
"f096276ec6ee63248f951de1a567734d3bfff220"
] | [
"research/object_detection/meta_architectures/center_net_meta_arch.py"
] | [
"# Copyright 2020 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ... | [
[
"tensorflow.compat.v1.map_fn",
"tensorflow.compat.v1.zeros",
"tensorflow.compat.v1.keras.layers.Dense",
"tensorflow.compat.v1.transpose",
"tensorflow.compat.v1.tile",
"tensorflow.compat.v1.ones_like",
"tensorflow.compat.v1.equal",
"tensorflow.compat.v1.shape",
"tensorflow.compa... |
DavidMeda/donkeycar | [
"1e42e40cb07d6f15c22461dc3f00182a7279cf0c"
] | [
"donkeycar/parts/pytorch/torch_data.py"
] | [
"# PyTorch\nimport torch\nfrom torch.utils.data import IterableDataset, DataLoader\nfrom donkeycar.utils import train_test_split\nfrom donkeycar.parts.tub_v2 import Tub\nfrom torchvision import transforms\nfrom typing import List, Any\nfrom donkeycar.pipeline.types import TubRecord, TubDataset\nfrom donkeycar.pipel... | [
[
"torch.tensor",
"torch.utils.data.DataLoader"
]
] |
kosmitive/burro | [
"2b1d690ec9c9371f5b455dd98439dce51d270909"
] | [
"burrolib/util/sampling.py"
] | [
"import torch\nimport torch.distributions as dist\n\n\ndef unif_sample(sample_shape=[1], low=0, high=1):\n \"\"\"Generate a sample from U(low, high).\n\n :param sample_shape: The shape S\n :param low: Lower bound on uniform\n :param high: Upper bound on uniform\n :return: A matrix of shape S containg... | [
[
"torch.log",
"torch.distributions.Uniform",
"torch.argmax"
]
] |
azz2k/RLCarExp | [
"d94fdf551abf5b0c9904257babed5909ee01c1ea"
] | [
"legacy/pairwise_distances_log.py"
] | [
"import numpy as np\nimport matplotlib.pyplot as plt\nimport cPickle\nimport sys\nimport math\n\nimport sklearn\nfrom sklearn.metrics.pairwise import pairwise_distances\nfrom sklearn.preprocessing import MaxAbsScaler \n\nif __name__ == \"__main__\":\n file_name = \"log.pick\"\n if \".pick\" in sys.argv[1]:\n f... | [
[
"sklearn.preprocessing.MaxAbsScaler",
"numpy.array",
"matplotlib.pyplot.ion",
"numpy.histogram",
"matplotlib.pyplot.title",
"sklearn.utils.resample",
"matplotlib.pyplot.show",
"matplotlib.pyplot.ioff",
"sklearn.metrics.pairwise.pairwise_distances",
"matplotlib.pyplot.pause"... |
AchimLoerke/tensorrt-inference-server | [
"f940f2313fcccfa89808626591e6007ed9c385d8"
] | [
"src/clients/python/simple_callback_client.py"
] | [
"#!/usr/bin/env python\n# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions\n# are met:\n# * Redistributions of source code must retain the above copyright\n# ... | [
[
"numpy.ones",
"numpy.arange"
]
] |
wiheto/fmriprep | [
"25d054a4da68fc198442d483e25fbbbe20fbfd23"
] | [
"setup.py"
] | [
"#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# @Author: oesteban\n# @Date: 2015-11-19 16:44:27\n\"\"\" fmriprep setup script \"\"\"\n\n\ndef main():\n \"\"\" Install entry-point \"\"\"\n from setuptools import setup\n from setuptools.extension import Extension\n from numpy import get_include\n ... | [
[
"numpy.get_include"
]
] |
ibaiGorordo/Mediapipe-Halloween-Examples | [
"7579b0e9a2a55f80efaa2dcd04405461911da885"
] | [
"utils/face_mesh_utils.py"
] | [
"import cv2\nimport mediapipe as mp\nimport numpy as np\nfrom imread_from_url import imread_from_url\n\nclass ExorcistFace():\n\n def __init__(self, exorcist_image_url, show_webcam = True, max_people=1, detection_confidence=0.3):\n\n self.show_webcam = show_webcam\n\n self.initialize_model(max_peop... | [
[
"numpy.array",
"numpy.zeros"
]
] |
EEA-sensors/parallel-gps | [
"3353c18f55668b295294281046fde15d461192b0"
] | [
"pssgp/kalman/sequential.py"
] | [
"import tensorflow as tf\n\n__all__ = [\"kf\", \"ks\", \"kfs\"]\n\nfrom tensorflow_probability.python.distributions import MultivariateNormalTriL\n\nmv = tf.linalg.matvec\nmm = tf.linalg.matmul\n\n\ndef kf(lgssm, observations, return_loglikelihood=False, return_predicted=False):\n P0, Fs, Qs, H, R = lgssm\n d... | [
[
"tensorflow.shape",
"tensorflow.expand_dims",
"tensorflow.linalg.cholesky",
"tensorflow.transpose",
"tensorflow.constant",
"tensorflow.math.is_nan",
"tensorflow.scan",
"tensorflow.linalg.cholesky_solve"
]
] |
maliasadi/thewalrus | [
"719cdcc4791579d3f6d45fcc8fb41372989dec85"
] | [
"thewalrus/quantum/gaussian_checks.py"
] | [
"# Copyright 2019-2020 Xanadu Quantum Technologies Inc.\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/licenses/LICENSE-2.0\n\n# Unless required by ap... | [
[
"numpy.zeros_like",
"numpy.exp",
"numpy.linalg.det",
"numpy.identity",
"numpy.allclose",
"scipy.linalg.sqrtm",
"numpy.transpose",
"numpy.sqrt",
"numpy.abs",
"numpy.all",
"numpy.linalg.inv"
]
] |
trivialfis/dask | [
"d5f5b912e4d1b5d4477e5c797ef1e9ebd066c8c9"
] | [
"dask/dataframe/tests/test_dataframe.py"
] | [
"import warnings\nfrom itertools import product\nfrom operator import add\n\nimport numpy as np\nimport pandas as pd\nimport pytest\nfrom pandas.io.formats import format as pandas_format\n\nimport dask\nimport dask.array as da\nimport dask.dataframe as dd\nfrom dask.array.numpy_compat import _numpy_118\nfrom dask.b... | [
[
"numpy.random.choice",
"pandas.Timestamp",
"numpy.cos",
"pandas.concat",
"numpy.cumsum",
"numpy.random.random",
"pandas.period_range",
"pandas.api.types.is_categorical_dtype",
"numpy.dtype",
"pandas.offsets.DateOffset",
"numpy.concatenate",
"numpy.random.normal",
... |
Song-Jingyu/JS3C-Net | [
"d5fec8c960f19018eab8b3ce7ff93ef416bcfe95"
] | [
"utils/laserscan.py"
] | [
"#!/usr/bin/env python3\nimport numpy as np\n\n\nclass LaserScan:\n \"\"\"Class that contains LaserScan with x,y,z,r\"\"\"\n EXTENSIONS_SCAN = ['.bin']\n\n def __init__(self, project=False, H=64, W=1024, fov_up=3.0, fov_down=-25.0):\n self.project = project\n self.proj_H = H\n self.proj_W = W\n self.... | [
[
"numpy.full",
"numpy.array",
"numpy.linalg.norm",
"numpy.maximum",
"numpy.zeros",
"numpy.minimum",
"numpy.arcsin",
"numpy.copy",
"numpy.random.uniform",
"numpy.arange",
"numpy.arctan2",
"numpy.fromfile",
"numpy.argsort",
"numpy.floor"
]
] |
mfinzi/lucky-guess-chemist | [
"01898b733dc7d026f70d0cb6337309cb600502fb",
"01898b733dc7d026f70d0cb6337309cb600502fb"
] | [
"lucky_guess/datasets.py",
"lucky_guess/architecture.py"
] | [
"import os\nimport torch\nfrom corm_data.utils import initialize_datasets\ndefault_qm9_dir = '~/datasets/molecular/qm9/'\ndef QM9datasets(root_dir=default_qm9_dir):\n root_dir = os.path.expanduser(root_dir)\n filename= f\"{root_dir}data_boxed.pz\"\n if os.path.exists(filename):\n return torch.load(f... | [
[
"torch.save",
"torch.load"
],
[
"torch.zeros",
"torch.roll",
"torch.cat",
"torch.nn.Linear",
"numpy.random.rand",
"numpy.asarray",
"torch.nn.GRU",
"torch.nn.functional.softplus",
"torch.nn.Sequential",
"numpy.log",
"torch.split",
"torch.no_grad",
"to... |
DMALab/open-box | [
"011791aba4e44b20a6544020c73601638886d143"
] | [
"openbox/acquisition_function/acquisition.py"
] | [
"# License: MIT\n# encoding=utf8\n\nimport abc\nimport logging\nfrom typing import List, Union\n\nimport numpy as np\nfrom scipy.stats import norm\nimport math\n\nfrom openbox.utils.config_space import Configuration\nfrom openbox.utils.config_space.util import convert_configurations_to_array\nfrom openbox.surrogate... | [
[
"scipy.stats.norm.pdf",
"numpy.isnan",
"numpy.linalg.norm",
"numpy.log",
"numpy.copy",
"numpy.exp",
"numpy.any",
"numpy.finfo",
"numpy.sqrt",
"scipy.stats.norm.cdf"
]
] |
iperoyg/pos_puc_tcc_ | [
"cf226c20f7486162bb2376f285ffa4b6232c49df"
] | [
"src/streamlit_interface.py"
] | [
"from typing import List, Tuple\nfrom app.domain.sentiment_data import Sentiment_Type\nimport nltk\nimport pandas as pd\nimport streamlit as st\nimport matplotlib.pyplot as plt\nfrom wordcloud import WordCloud\n\nfrom app.data.data_handler import DataHandler\nfrom app.service.analyser import Analyser\n\nclass UIDat... | [
[
"pandas.DataFrame.from_dict",
"pandas.DataFrame"
]
] |
cimbi/pyacq | [
"b320251f1cf899c1d2cc4fddd5596a1ae835b39d"
] | [
"pyacq/dsp/tests/benchmark_opencl.py"
] | [
"# -*- coding: utf-8 -*-\n# Copyright (c) 2016, French National Center for Scientific Research (CNRS)\n# Distributed under the (new) BSD License. See LICENSE for more info.\n\n\"\"\"\nSome benchmark to compare CPU with numpy solution and home made OpenCL implementation.\n\nFor each filter there is several implement... | [
[
"numpy.random.randn",
"numpy.argsort"
]
] |
lucavh/scikit-learn-mooc | [
"b46dc840111b7bc6ca643e0f1cc79499c246ca8b"
] | [
"figures/plot_iris_visualization.py"
] | [
"\"\"\"\nSome simple visualizations on the iris data.\n\"\"\"\n\nimport numpy as np\nfrom sklearn import datasets\nfrom matplotlib import pyplot as plt\nimport style_figs\n\niris = datasets.load_iris()\n\n# Plot the histograms of each class for each feature\n\n\nX = iris.data\ny = iris.target\nfor x, feature_name i... | [
[
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.legend",
"sklearn.datasets.load_iris",
"matplotlib.pyplot.figure"
]
] |
ankitraja786/Multiple-Color-Detection-in-Real-Time-using-Python-OpenCV | [
"b5e193ccf69e9ea04bc8cdfabf91c4fd89d22a10"
] | [
"multicoloured Detection.py"
] | [
"import numpy as np\nimport cv2\n\n\n# Capturing video through webcam\nwebcam = cv2.VideoCapture(0)\n\n# Start a while loop\nwhile(1):\n\t\n\n\n\t_, imageFrame = webcam.read()\n\n\t\n\thsvFrame = cv2.cvtColor(imageFrame, cv2.COLOR_BGR2HSV)\n\n\t\n\tred_lower = np.array([136, 87, 111], np.uint8)\n\tred_upper = np.ar... | [
[
"numpy.array",
"numpy.ones"
]
] |
maastrichtlawtech/probatus | [
"fe0442acc2e51b6c5116b5a97005a548c381f662",
"fe0442acc2e51b6c5116b5a97005a548c381f662"
] | [
"probatus/interpret/shap_dependence.py",
"probatus/utils/tree.py"
] | [
"# Copyright (c) 2020 ING Bank N.V.\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of\n# this software and associated documentation files (the \"Software\"), to deal in\n# the Software without restriction, including without limitation the rights to\n# use, copy, modify, merge, pu... | [
[
"matplotlib.pyplot.close",
"numpy.digitize",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.subplot2grid",
"pandas.Series",
"matplotlib.pyplot.show"
],
[
"numpy.where",
"numpy.zeros",
"numpy.unique"
]
] |
lmichel/astropy | [
"67f944f6145ae4899e7bf6e335ffcb24c9493ac3"
] | [
"astropy/modeling/bounding_box.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\n\"\"\"\nThis module is to contain an improved bounding box\n\"\"\"\n\nimport abc\nimport copy\nimport warnings\nfrom collections import namedtuple\nfrom typing import Any, Callable, Dict, List, Tuple\n\nimport numpy as np\n\nfrom astropy.units im... | [
[
"numpy.logical_not",
"numpy.logical_or",
"numpy.array",
"numpy.zeros",
"numpy.shape",
"numpy.arange",
"numpy.isscalar",
"numpy.atleast_1d",
"numpy.asanyarray"
]
] |
fengredrum/Batch_D3PG | [
"b1128db2b22ce6ba94665a066b1cc401f33145b5"
] | [
"get_returns.py"
] | [
"import torch\n\nfrom torch import jit\n\n\nclass ComputeReturns(jit.ScriptModule):\n __constants__ = ['gamma', 'T', 'B']\n\n def __init__(self, target_actor_net, target_critic_net,\n num_processes, reward_steps, batch_size, device,\n gamma=0.99):\n super(ComputeReturns,... | [
[
"torch.zeros"
]
] |
arthur-bit-monnot/fire-rs-saop | [
"321e16fceebf44e8e97b482c24f37fbf6dd7d162"
] | [
"python/fire_rs/demo_front_interpolation.py"
] | [
"\"\"\"Test fire front interpolation\"\"\"\n\n# Copyright (c) 2019, CNRS-LAAS\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 met:\n#\n# * Redistributions of source code must retain the ab... | [
[
"numpy.asarray",
"numpy.ones",
"matplotlib.pyplot.figure",
"numpy.linspace",
"numpy.meshgrid"
]
] |
orenbenkiki/metacells | [
"14876c88d506b8ffb8ca2ba74a7075813b45ba0f"
] | [
"metacells/pipeline/mcview.py"
] | [
"\"\"\"\nMCView\n------\n\nCompute metacell analysis in preparation for exporting the data to MCView.\n\"\"\"\n\nfrom typing import Any\nfrom typing import Dict\nfrom typing import Optional\nfrom typing import Union\n\nimport numpy as np\nfrom anndata import AnnData # type: ignore\n\nimport metacells.parameters as... | [
[
"numpy.sum"
]
] |
techthiyanes/nlp-notebook | [
"0e5f4b75e635128d4056c89a6c65bea60c15e836",
"0e5f4b75e635128d4056c89a6c65bea60c15e836"
] | [
"4-1.Seq2seq/train_eval.py",
"PaperwithCode/1.Co-Interactive-Transformer/joint_model.py"
] | [
"# -*- coding: utf-8 -*-\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom tqdm import tqdm\nfrom load_data import train_iter, val_iter, id2vocab, PAD_IDX\nfrom model import Encoder, Decoder, Seq2Seq\n\ndevice = \"cuda\" if torch.cuda.is_ava... | [
[
"matplotlib.pyplot.legend",
"numpy.mean",
"torch.cuda.is_available",
"torch.nn.init.uniform_",
"numpy.linspace",
"torch.nn.CrossEntropyLoss"
],
[
"torch.nn.Linear",
"torch.zeros",
"torch.nn.Dropout",
"torch.nn.LayerNorm",
"torch.cat",
"torch.nn.LSTM",
"torch... |
jayl940712/gdspy | [
"f2144b815136d4c075fc6e98f3490a8709947603"
] | [
"docs/makeimages.py"
] | [
"import gdspy\nimport numpy\nimport colorsys\nfrom PIL import Image, ImageDraw, ImageFont\n\n\nclass ColorDict(dict):\n def __missing__(self, key):\n layer, datatype = key\n rgb = tuple(int(255 * c + 0.5) for c in colorsys.hsv_to_rgb((layer % 3) / 3.0 + (layer % 6 // 3) / 6.0 + (layer // 6) / 11.0,... | [
[
"numpy.sum",
"numpy.sin",
"numpy.exp",
"numpy.cos"
]
] |
vanquirius/100-days-of-code-python | [
"5e2903534b26a765568fb6258e18ecc6ca3bde12"
] | [
"Day 73 - Aggregate Merge LEGO Dataset/main.py"
] | [
"# coding=utf-8\n# Marcelo Ambrosio de Goes\n# marcelogoes@gmail.com\n# 2022-04-24\n\n# 100 Days of Code: The Complete Python Pro Bootcamp for 2022\n# Day 73 - Aggregate Merge LEGO Dataset\n\nimport pandas\nimport matplotlib.pyplot as plt\n\n# Import data\ncolors_df = pandas.read_csv(\"data/colors.csv\")\nsets_df =... | [
[
"pandas.merge",
"pandas.DataFrame",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"pandas.read_csv",
"matplotlib.pyplot.bar",
"matplotlib.pyplot.xticks"
]
] |
OhadRubin/allennlp | [
"c71bb460c20c0a1d2cfb6bad864b1c5726f61a99"
] | [
"allennlp/sanity_checks/task_checklists/sentiment_analysis_suite.py"
] | [
"from typing import Optional, Iterable, List, Union, Tuple\nimport numpy as np\nfrom overrides import overrides\nfrom checklist.test_suite import TestSuite\nfrom checklist.test_types import MFT, INV, DIR, Expect\nfrom checklist.editor import Editor\nfrom checklist.perturb import Perturb\nfrom allennlp.sanity_checks... | [
[
"numpy.array"
]
] |
nunenuh/classify.pytorch | [
"fa3bff9c4187435bc457e68435634751a82bbe6d"
] | [
"classify/predictor.py"
] | [
"import torch\nimport torch.nn as nn\nimport torchvision.models as models\nfrom typing import *\nimport copy\nimport PIL\nfrom PIL import Image\nimport numpy as np\nfrom pathlib import Path\nfrom .datamodule import transform_fn\nfrom . import utils\nimport onnx\nimport onnxruntime as ort\nimport numpy as np\n\n\ncl... | [
[
"torch.nn.Linear",
"torch.device",
"torch.nn.Dropout",
"torch.log_softmax",
"torch.no_grad",
"torch.from_numpy",
"torch.nn.init.normal_",
"torch.nn.init.zeros_",
"torch.exp"
]
] |
bpiyush/CtP-ssl | [
"33f325f4f824508ea6391cfbb52d3e17623b7e8f"
] | [
"pyvrl/models/pretraining/rot3d/rot3d_transforms.py"
] | [
"import numpy as np\nimport random\nimport cv2\nfrom typing import List\n\nfrom ....datasets import BaseTransform\nfrom ....builder import TRANSFORMS\n\n\n@TRANSFORMS.register_module()\nclass GroupRectRotate(BaseTransform):\n\n def get_transform_param(self, data, *args, **kwargs) -> dict:\n flag = random.... | [
[
"numpy.max",
"numpy.ones",
"numpy.min"
]
] |
bozcani/yolov3-tensorflow2 | [
"536df40099f776c4beb3d40155a66c99594d2bbe"
] | [
"model.py"
] | [
"# -*- coding: utf-8 -*-\n\nimport numpy as np\nimport tensorflow as tf\nfrom tensorflow.keras import layers\nfrom tensorflow.keras.regularizers import l2\nimport time\nfrom absl import app, flags, logging\n\ndef create_model(size, yolo_anchors, yolo_anchor_masks, classes, training=False):\n\n inputs = tf.keras.... | [
[
"tensorflow.exp",
"tensorflow.keras.layers.Add",
"tensorflow.shape",
"tensorflow.concat",
"tensorflow.keras.layers.UpSampling2D",
"tensorflow.sigmoid",
"tensorflow.range",
"tensorflow.keras.layers.LeakyReLU",
"tensorflow.keras.Model",
"tensorflow.keras.layers.ZeroPadding2D"... |
2Dooh/TF-MOENAS | [
"edd6ec8c3f89cfbe9674873425c5056e72899edb"
] | [
"util/net/ntk.py"
] | [
"import torch\n\nimport numpy as np\n\ndef get_ntk_n(xloader, networks, recalbn=0, train_mode=False, num_batch=-1):\n device = torch.cuda.current_device()\n # if recalbn > 0:\n # network = recal_bn(network, xloader, recalbn, device)\n # if network_2 is not None:\n # network_2 = recal_... | [
[
"torch.symeig",
"torch.cat",
"torch.stack",
"torch.einsum",
"torch.cuda.current_device",
"torch.cuda.empty_cache",
"torch.ones_like"
]
] |
isspek/veracity-detection | [
"9368309722bead209e49e52c206758e3d173092a"
] | [
"RumourEval2019Models/Bert-MFajcik/task_A/frameworks/feature_framework_seq.py"
] | [
"import csv\nimport logging\nimport math\nimport time\n\nimport torch\nimport torch.nn.functional as F\nimport xlsxwriter\nfrom colour import Color\nfrom torch.nn.modules.loss import _Loss\nfrom torch.optim import Adam\nfrom torchtext.data import Iterator, BucketIterator\nfrom tqdm import tqdm\n\nfrom task_A.datase... | [
[
"torch.device",
"torch.initial_seed",
"torch.nn.CrossEntropyLoss",
"torch.cuda.is_available",
"torch.nn.functional.softmax",
"torch.argmax",
"torch.sum"
]
] |
OnizukaLab/pytorch-CycleGAN-and-pix2pix | [
"95b8dfe8bba43ae5ec9d7b299107fc155e7939c0"
] | [
"prepare_data.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport pickle\nimport argparse\nimport numpy as np\nimport pandas as pd\nfrom torchvision import transforms\nfrom PIL import ImageFilter, Image\n\n\ndef load_bbox(data_dir):\n bbox_path = os.path.join(data_dir, 'CUB_200_2011/bounding_boxes.txt')\n df_bounding_boxes = pd.re... | [
[
"numpy.minimum",
"pandas.read_csv",
"numpy.maximum"
]
] |
LazyTWX/asura | [
"12307d88978152a870e747502a853bc1726dc7ae"
] | [
"analysis/analysis.py"
] | [
"import json\nimport matplotlib as mpl\nimport matplotlib.patches as mpatches\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom matplotlib.ticker import FormatStrFormatter\n\nwith open('./data.json') as f:\n data = json.load(f)\n\nmpl.style.use(\"seaborn\")\n\nlines = [\n [[],[]],\n [[],[]],\n [[... | [
[
"matplotlib.style.use",
"matplotlib.ticker.MultipleLocator",
"matplotlib.pyplot.plot",
"matplotlib.patches.Patch",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.gca"
]
] |
htt-trangtran/smg | [
"b7a49055e7d48ec456bac67ab473db2183d2f597"
] | [
"Logistic_Regression/average_and_plot.py"
] | [
"############################\n# written by Trang H. Tran and Lam M. Nguyen\n############################\n\n\"\"\"\nAverage data and plot\n\"\"\"\n\nimport pandas as pd\nfrom csv import reader\nimport numpy as np\nimport matplotlib.pyplot as plt\n\n#-----------------------------------------------------------------... | [
[
"numpy.zeros",
"matplotlib.pyplot.xlabel",
"pandas.DataFrame",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.yticks",
"matplotlib.pyplot.figure",
"numpy.arange",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.yscale"... |
pection-zz/Lenquality-MachineLearning | [
"61e10a7dcff07ad4e63ec9e88dd6f164cadf22ff"
] | [
"saliency-detection/objectness_saliency.py"
] | [
"# USAGE\n# python objectness_saliency.py --model objectness_trained_model --image images/barcelona.jpg\n\n# import the necessary packages\nimport numpy as np\nimport argparse\nimport cv2\n\n# construct the argument parser and parse the arguments\nap = argparse.ArgumentParser()\nap.add_argument(\"-m\", \"--model\",... | [
[
"numpy.random.randint"
]
] |
a-dhagat/Visual-Question-Answering-PyTorch | [
"62ce8ab2c0890af5fd6b0e3ac7e9174bf8ced1a3"
] | [
"master/external/googlenet/googlenet.py"
] | [
"# This will be in torchvision's next version, but it's not conveniently accessible yet, hence just dropping it here.\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.utils import model_zoo\n\n__all__ = ['GoogLeNet', 'googlenet']\n\nmodel_urls = {\n # GoogLeNet ported from Tens... | [
[
"torch.nn.Linear",
"torch.nn.Dropout",
"torch.cat",
"torch.nn.MaxPool2d",
"torch.nn.init.constant_",
"torch.nn.functional.dropout",
"torch.nn.BatchNorm2d",
"torch.utils.model_zoo.load_url",
"torch.nn.functional.adaptive_avg_pool2d",
"torch.nn.init.xavier_uniform_",
"tor... |
samialabed/rlgraph | [
"f5fa632a385e67295a2939f54cbaa4c47a007728"
] | [
"rlgraph/components/common/slice.py"
] | [
"# Copyright 2018/2019 The RLgraph 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 re... | [
[
"tensorflow.squeeze",
"tensorflow.equal",
"numpy.squeeze"
]
] |
zixianma/PIC | [
"bbfe8985121e3ffb693c047ed3fe85d0c8256737",
"bbfe8985121e3ffb693c047ed3fe85d0c8256737"
] | [
"multiagent-particle-envs/multiagent/scenarios/simple_coop_push_n15.py",
"multiagent-particle-envs/multiagent/scenarios/simple_tag_n6_part_obs_align.py"
] | [
"import numpy as np\nimport random\nfrom multiagent.core_vec import World, Agent, Landmark\nfrom multiagent.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self, sort_obs=True):\n world = World()\n self.np_rnd = np.random.RandomState(0)\n self.sort_obs = sort... | [
[
"numpy.concatenate",
"numpy.square",
"numpy.array",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.exp"
],
[
"numpy.concatenate",
"numpy.square",
"numpy.array",
"numpy.dot",
"numpy.zeros",
"numpy.random.RandomState",
"numpy.sum",
"numpy.min",
"num... |
vineeths96/Spoken-Keyword-Spotting | [
"8cd903171d837e27dfef3b779187a743a818e0e5"
] | [
"src/utils.py"
] | [
"import os\nimport numpy as np\nimport tensorflow as tf\nfrom scipy.io import wavfile\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom matplotlib.ticker import MaxNLocator\nfrom sklearn.metrics import accuracy_score, recall_score, matthews_corrcoef\nfrom sklearn.metrics import precision_score, f1_score... | [
[
"sklearn.metrics.confusion_matrix",
"numpy.mean",
"tensorflow.py_function",
"sklearn.metrics.f1_score",
"sklearn.metrics._plot.confusion_matrix.ConfusionMatrixDisplay",
"matplotlib.ticker.MaxNLocator",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"sklearn.metrics.... |
Xero64/pyapm | [
"a50321503a13faf27c10b8413d8d2dea5cd185f6"
] | [
"pyapm/tools/naca4.py"
] | [
"from typing import List\nfrom .spacing import full_cosine_spacing, equal_spacing\nfrom .spacing import linear_bias_left\nfrom math import atan, sqrt, pi, sin, cos\nfrom matplotlib.pyplot import figure\n\nclass NACA4(object):\n code: str = None\n cnum: int = None\n cspc: str = None\n teclosed: bool = No... | [
[
"matplotlib.pyplot.figure"
]
] |
nim65s/sot-talos-balance | [
"e24b9a3bd4377b0a0ea474dce44295282332661b"
] | [
"src/dynamic_graph/sot_talos_balance/utils/filter_utils.py"
] | [
"import numpy as np\nfrom dynamic_graph.sot.core.filter_differentiator import FilterDifferentiator\n\n\ndef create_chebi1_checby2_series_filter(name, dt, size):\n # b1,a1=cheby2(2, 20,0.05);\n # b2,a2 = cheby1(4,0.05,0.08);\n # (b,a) = filter_series(b1,a1,b2,a2);\n lp_filter = FilterDifferentiator(name)... | [
[
"numpy.fft.fft",
"numpy.array",
"numpy.fft.fftfreq"
]
] |
spacetelescope/pysynphot_DONOTUSE | [
"2a382d7bdf29cc4a1e6b69e59d5c1d0f82dabffc"
] | [
"synphot/tests/test_binning.py"
] | [
"# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\"\"\"Test binning.py module.\"\"\"\n\n# STDLIB\nimport os\n\n# THIRD PARTY\nimport numpy as np\nimport pytest\n\n# ASTROPY\nfrom astropy import units as u\nfrom astropy.utils.data import get_pkg_data_filename\n\n# LOCAL\nfrom synphot import binning,... | [
[
"numpy.testing.assert_allclose",
"numpy.array",
"numpy.testing.assert_array_equal",
"numpy.ones",
"numpy.interp",
"numpy.arange",
"numpy.searchsorted"
]
] |
JonosGit/hsds | [
"4abc4fc22c1e75cc9b15c879c8d00448a115fc92"
] | [
"tests/unit/shuffleTest.py"
] | [
"##############################################################################\n# Copyright by The HDF Group. #\n# All rights reserved. #\n# ... | [
[
"numpy.random.rand",
"numpy.zeros"
]
] |
yobibyte/amorpheus | [
"ed70caa1c6277975b820cf3d1d5fb5977259d974"
] | [
"modular-rl/src/environments/walker_5_flipped.py"
] | [
"import numpy as np\nfrom gym import utils\nfrom gym.envs.mujoco import mujoco_env\nfrom utils import *\nimport os\n\n\nclass ModularEnv(mujoco_env.MujocoEnv, utils.EzPickle):\n def __init__(self, xml):\n self.xml = xml\n mujoco_env.MujocoEnv.__init__(self, xml, 4)\n utils.EzPickle.__init__(... | [
[
"numpy.concatenate",
"numpy.array",
"numpy.square",
"numpy.degrees"
]
] |
aaanh/duplicated_accelcamp | [
"7d4b60ace023bede907f8ed367ba492731a1951d"
] | [
"doc/tutorials/src/MyFunctions.py"
] | [
"\nimport numpy as np\n\n\n\ndef plottest():\n import numpy as np\n import matplotlib.pyplot as plt\n\n x = np.linspace(0, 3 * np.pi, 500)\n y1 = np.sin(x)\n y2 = np.sin(3 * x)\n\n fig, ax = plt.subplots()\n ax.fill(x, y1, 'b', x, y2, 'r', alpha=0.3)\n plt.show()\n return\n\ndef LoadArray... | [
[
"numpy.sin",
"numpy.ones",
"matplotlib.pyplot.subplots",
"numpy.loadtxt",
"matplotlib.pyplot.show",
"numpy.linspace"
]
] |
anh/ForwardTacotron | [
"a58d9244844b4512f5655e154f08f934760c88b3"
] | [
"trainer/forward_trainer.py"
] | [
"import time\nfrom typing import Tuple, Dict, Any\n\nimport torch\nfrom torch.optim.optimizer import Optimizer\nfrom torch.utils.data import DataLoader\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom models.forward_tacotron import ForwardTacotron\nfrom trainer.common import Averager, TTSSession, MaskedL1... | [
[
"torch.no_grad",
"torch.utils.tensorboard.SummaryWriter"
]
] |
SpadeLiu/Graft-PSMNet | [
"1f2950d5afd85237f8d3604caab20dd47a8c9889"
] | [
"train_adaptor.py"
] | [
"import torch\nimport torch.utils.data\nimport torch.optim as optim\nimport torch.nn.functional as F\nimport torch.nn as nn\nimport os\nimport copy\nfrom tqdm import tqdm\nimport matplotlib.pyplot as plt\nimport argparse\n\nfrom dataloader import sceneflow_loader as sf\nimport networks.Aggregator as Agg\nimport net... | [
[
"torch.cuda.manual_seed",
"torch.FloatTensor",
"torch.no_grad",
"torch.save",
"torch.manual_seed",
"torch.cuda.empty_cache",
"torch.cuda.is_available",
"torch.load",
"torch.mean"
]
] |
rlavelle/stock-forecasting | [
"732df75e9802e9c2ce24ae305565df96a649d760"
] | [
"gauss_smoothing/base_model.py"
] | [
"# Abstract functionality\nfrom abc import ABC, abstractmethod\n# Data Pre-processing\nfrom fastquant import get_stock_data\n# General Needed libraries\nimport matplotlib.pyplot as plt\nimport pandas as pd\nimport numpy as np\nimport math\nimport os\n\n\n#Base model class\nclass Base_Model(ABC):\n\n # params sho... | [
[
"numpy.square",
"matplotlib.pyplot.savefig",
"matplotlib.pyplot.subplots",
"numpy.abs",
"numpy.append"
]
] |
ZacSpec/high-dimensional-sampling | [
"e3d9799af8a2bca320221f21d6a48f578023f7a0"
] | [
"high_dimensional_sampling/optimisation/turbo.py"
] | [
"import high_dimensional_sampling as hds\nimport numpy as np\ntry:\n from turbo import TurboM\nexcept ImportError:\n pass\nimport sys\n\n\nclass TuRBO(hds.Procedure):\n def __init__(self,\n max_evals=1000,\n trust_regions=5,\n max_cholesky_size=2000,\n ... | [
[
"numpy.array",
"numpy.argmin"
]
] |
borismattijssen/mushrooms | [
"768925d1332fe8102e562f924128f520abea95e5"
] | [
"src/data/make_dataset.py"
] | [
"# -*- coding: utf-8 -*-\nimport pickle\nimport click\nimport logging\nfrom pathlib import Path\nimport os.path\n\nimport pandas as pd\nimport numpy as np\nfrom sklearn.decomposition import PCA\n\nproject_dir = Path(__file__).resolve().parents[2]\n\n@click.command()\n@click.argument('input_filepath', type=click.Pat... | [
[
"pandas.DataFrame",
"pandas.read_csv",
"sklearn.decomposition.PCA",
"pandas.get_dummies"
]
] |
LSH9832/Yolov5TrainGuide | [
"969194ac2f1f8737da7c2d6200ce6bf194bca19b"
] | [
"packages/yolov5/utils/augmentations.py"
] | [
"# YOLOv5 image augmentation functions\n\nimport logging\nimport random\n\nimport cv2\nimport math\nimport numpy as np\n\nfrom ..utils.general import colorstr, segment2box, resample_segments, check_version\nfrom ..utils.metrics import bbox_ioa\n\n\nclass Albumentations:\n # YOLOv5 Albumentations class (optional,... | [
[
"numpy.concatenate",
"numpy.clip",
"numpy.array",
"numpy.zeros",
"numpy.ones",
"numpy.eye",
"numpy.random.beta",
"numpy.random.uniform",
"numpy.arange",
"numpy.append",
"numpy.mod",
"numpy.maximum"
]
] |
bjohnnyd/hla-kir-imputation | [
"f67ca456183346a89af343ea4494a378028c42c9"
] | [
"scripts/frequency_encode_snps.py"
] | [
"#!/usr/bin/env python\nimport argparse\nimport re\nimport sys\nimport textwrap\nimport matplotlib\nimport numpy as np\nfrom os import path\nfrom pathlib import Path\nimport matplotlib.pyplot as plt\nimport matplotlib.gridspec as gridspec\nfrom matplotlib.patches import Patch\n\nfrom cyvcf2 import VCF, Writer\n\npl... | [
[
"matplotlib.use",
"matplotlib.pyplot.savefig",
"numpy.sum",
"matplotlib.pyplot.figure",
"matplotlib.patches.Patch",
"numpy.corrcoef"
]
] |
Warlockk/pyray | [
"cce6a6289ef9f2b0f92000847a04178ec7287520"
] | [
"pyray/shapes/twod/plot.py"
] | [
"import numpy as np\nfrom PIL import Image, ImageDraw, ImageFont, ImageMath\nfrom pyray.rotation import planar_rotation\nfrom pyray.shapes.twod.line import Line\n\n\nclass MapCoord(object):\n def __init__(self,scale=64,origin=np.array([8,8]),\n im_size=np.array([1024,1024])):\n \"\"\"\n ... | [
[
"numpy.array",
"numpy.dot",
"numpy.arange",
"numpy.eye"
]
] |
stefan-ainetter/grasp_det_seg_cnn | [
"2492d5ec78f831c327e817246e822cdfce9e16ad"
] | [
"grasp_det_seg/data_OCID/transform.py"
] | [
"import random\nimport scipy\nimport numpy as np\nimport torch\nfrom PIL import Image\nimport cv2\nfrom torchvision.transforms import functional as tfn\n\n\nclass OCIDTransform:\n \"\"\"Transformer function for OCID_grasp dataset\n \"\"\"\n\n def __init__(self,\n shortest_size,\n ... | [
[
"numpy.dot",
"numpy.copy",
"scipy.sin",
"numpy.where",
"numpy.cos",
"numpy.deg2rad",
"numpy.zeros_like",
"numpy.sin",
"numpy.swapaxes",
"numpy.random.randint",
"numpy.expand_dims",
"numpy.vstack",
"numpy.array",
"numpy.zeros",
"numpy.round",
"numpy.a... |
bilalayublhr/MLProject | [
"95662f7764a1dbbfdcbae6de55570faae0bc60f7"
] | [
"reddit.py"
] | [
"from time import perf_counter\nimport argparse\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.optim as optim\nfrom utils import load_reddit_data, sgc_precompute, set_seed\nfrom metrics import f1\nfrom models import SGC\n\n# Args\nparser = argparse.ArgumentParser()\nparser.add_argu... | [
[
"torch.nn.functional.cross_entropy",
"torch.cuda.is_available"
]
] |
chrk623/pyfuncs | [
"bf78aa716893f449cf85e3d8c16ad9eb9a52bb49"
] | [
"src/pyfuncs/utils.py"
] | [
"import re\nimport os\nimport json\nimport logging\nimport numpy as np\nimport pandas as pd\nimport requests as rq\nimport multiprocessing\nfrom datetime import datetime\n\nHOME = os.path.expanduser(\"~\")\n_RETURN_NONE = (lambda: None).__code__.co_code\n\nminimal_headers = {\n \"Connection\": \"keep-alive\",\n ... | [
[
"numpy.array",
"pandas.isna",
"numpy.array_split"
]
] |
shenlong95/scikit-posthocs | [
"59299cd21c254f9589074b21ce9fbab8a63f49c7"
] | [
"scikit_posthocs/_posthocs.py"
] | [
"import itertools as it\nfrom typing import Tuple, Union\nimport numpy as np\nimport scipy.stats as ss\nfrom statsmodels.sandbox.stats.multicomp import multipletests\nfrom statsmodels.stats.multicomp import pairwise_tukeyhsd\nfrom statsmodels.stats.libqsturng import psturng\nfrom pandas import DataFrame\n\n\ndef __... | [
[
"numpy.argmin",
"numpy.min",
"numpy.where",
"scipy.stats.anderson_ksamp",
"numpy.tril_indices",
"scipy.stats.rankdata",
"numpy.max",
"scipy.stats.chi2.sf",
"pandas.DataFrame",
"scipy.stats.f.sf",
"numpy.triu",
"numpy.transpose",
"numpy.arange",
"numpy.sqrt",... |
Avenire/models | [
"7940d3c3b947523d9d215bc97057c7da84bba54c"
] | [
"research/attention_ocr/python/eval.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 requi... | [
[
"tensorflow.set_random_seed",
"tensorflow.contrib.slim.evaluation.evaluation_loop",
"tensorflow.python.platform.flags.DEFINE_integer",
"tensorflow.gfile.Exists",
"tensorflow.ConfigProto",
"tensorflow.python.platform.flags.DEFINE_string",
"tensorflow.gfile.MakeDirs",
"tensorflow.con... |
yesme/Multiverso | [
"e45369e1d07277f656b0900beb2709d86679fa53"
] | [
"binding/python/multiverso/theano_ext/param_manager.py"
] | [
"#!/usr/bin/env python\n# coding:utf8\n\nimport lasagne\nimport numpy as np\nimport multiverso as mv\n\n\nclass MVModelParamManager(object):\n '''\n MVModelParamManager is manager to make managing and synchronizing the\n variables in lasagne more easily\n '''\n def __init__(self, model):\n '''... | [
[
"numpy.array",
"numpy.nditer",
"numpy.dtype"
]
] |
Aquaware/StudyOfML | [
"b2fb134dbe7c9b6991aa56d0c869d6856fc782e0"
] | [
"Stock Market Forecasting Using Time Series Analysis (ARIMA model)/db/PriceDatabase.py"
] | [
"# -*- coding: utf-8 -*-\nimport os\nimport sys\ncurrent_dir = os.path.abspath(os.path.dirname(__file__))\nsys.path.append('../datatype')\nsys.path.append('../setting')\nsys.path.append('../utility')\n\nimport pandas as pd\nimport pytz\nfrom Postgres import Postgres, Structure\nfrom Setting import Setting\nfrom Tim... | [
[
"pandas.DataFrame"
]
] |
zhanghuijun-hello/Detangler | [
"255c8f82fbdaa36365db1bb86fd1bf42483f9d29"
] | [
"server/plugins/entanglement/entanglementComputationLgt.py"
] | [
"import datetime\nimport math\nimport sys\n\nimport numpy as np\n\n\n'''\nComputes the coherence metric from a specifically formatted graph and\nalso offers the possibility to synchronize selections with a subgraph and its dual\nfrom selecting types in the dual graph.\n\nThe graph must be multilayer with each layer... | [
[
"numpy.linalg.eig",
"numpy.argmax"
]
] |
EdwardJKim/enhance | [
"3b76830d69549bca99e36b843ec046f5fdd1acea"
] | [
"sres_train.py"
] | [
"\"\"\"\nModified from\nhttps://github.com/tensorflow/models/blob/master/tutorials/image/cifar10/cifar10_train.py\n\"\"\"\n\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\nimport sys\nfrom datetime import datetime\nimport time\nimport num... | [
[
"tensorflow.train.start_queue_runners",
"tensorflow.stack",
"tensorflow.global_variables_initializer",
"tensorflow.global_variables",
"tensorflow.transpose",
"tensorflow.ConfigProto",
"tensorflow.gfile.MakeDirs",
"tensorflow.squeeze",
"tensorflow.gfile.DeleteRecursively",
"... |
Cjkkkk/data_mining_homework | [
"043f836e3dd30f32b5b06f40af61ae55b9287fbc",
"649dc3144444611d7c8ccaf6109050f53b5c611c"
] | [
"hw4/spectral_clustering/bestMap.py",
"hw2/linear-models/logistic.py"
] | [
"import numpy as np\n\ndef bestMap(L1,L2):\n '''\n bestmap: permute labels of L2 to match L1 as good as possible\n\n INPUT: \n L1: labels of L1, shape of (N,) vector\n L2: labels of L2, shape of (N,) vector\n\n OUTPUT:\n new_L2: best matched permuted L2, shape o... | [
[
"scipy.optimize.linear_sum_assignment",
"numpy.logical_and",
"numpy.zeros",
"numpy.unique"
],
[
"numpy.linalg.norm",
"numpy.matmul",
"numpy.zeros",
"numpy.sum",
"numpy.ones"
]
] |
ai-robotics-kr/sensor_fusion_python | [
"5c5e03530a87f414627534fdcbde631d589c8b27"
] | [
"sensor_fusion/filter/extended_kalman_filter.py"
] | [
"import numpy as np\nfrom .basic_filter import Filter\n\n\nclass EKF(object):\n def __init__(self, x, P):\n super().__init__()\n\n # Basically, We assume that robot moves in 3D place\n self.state = x\n self.cov = P\n\n # Set Initial state / cov\n def setInitialState(self, initia... | [
[
"numpy.sin",
"numpy.array",
"numpy.linalg.inv",
"numpy.cos"
]
] |
alonhare/adversarial-robustness-toolbox | [
"f9596a742c84460f62117220333292841b0a7184"
] | [
"art/classifiers/mxnet.py"
] | [
"# MIT License\n#\n# Copyright (C) IBM Corporation 2018\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n# documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the\n# rights to use, copy, ... | [
[
"numpy.expand_dims",
"numpy.array",
"numpy.argmax",
"numpy.random.shuffle"
]
] |
hoodadam/adam-hugs | [
"7e210f865603eda395d4d0a56b8380bad01723f8"
] | [
"hugs/calc/met.py"
] | [
"\"\"\"Contains a collection of basic calculations.\n\nThese include:\n\n* wind components\n\n\"\"\"\n\nfrom __future__ import division\n\nimport warnings\n\nimport numpy as np\n\n\ndef get_wind_speed(u, v):\n r\"\"\"Compute the wind speed from u and v-components.\n\n Parameters\n ----------\n u : array... | [
[
"numpy.sin",
"numpy.any",
"numpy.radians",
"numpy.arctan2",
"numpy.sqrt",
"numpy.cos"
]
] |
manuzagra/nex-code | [
"baadf126551ea72a9138e4dbfafa959a672bc9b4"
] | [
"utils/transformations.py"
] | [
"import numpy as np\n\n\ndef Rx(theta):\n return np.array([[ 1, 0 , 0 ],\n [ 0, np.cos(theta),-np.sin(theta)],\n [ 0, np.sin(theta), np.cos(theta)]])\n \ndef Ry(theta):\n return np.array([[ np.cos(theta), 0, np.sin(theta)],\n [... | [
[
"numpy.array",
"numpy.sin",
"numpy.random.default_rng",
"numpy.cos"
]
] |
xjtAlgo/Visual-Manipulation-Relationship-Network-Pytorch | [
"da7fffcc6bed062fa1a5dc12b4279f3456825664"
] | [
"model/MGN.py"
] | [
"# --------------------------------------------------------\n# Visual Detection: State-of-the-Art\n# Copyright: Hanbo Zhang\n# Licensed under The MIT License [see LICENSE for details]\n# Written by Hanbo Zhang\n# --------------------------------------------------------\n\nimport torch\nimport torch.nn as nn\nimport... | [
[
"torch.cat",
"torch.min",
"torch.max",
"torch.autograd.Variable",
"torch.nn.BatchNorm2d",
"torch.nn.init.kaiming_normal",
"torch.clamp",
"torch.from_numpy",
"torch.nn.ReLU",
"torch.nn.functional.cross_entropy",
"torch.nn.Conv2d",
"numpy.arange",
"torch.nn.functi... |
Abhyudyabajpai/Python-projects | [
"e5a1eecc4d4c65767836a8ba59871503e6fb2607"
] | [
"module12_project2.py"
] | [
"import codecademylib3_seaborn\nfrom matplotlib import pyplot as plt\nimport numpy as np\nimport pandas as pd\n\n# Bar Graph: Featured Games\n\ngames = [\"LoL\", \"Dota 2\", \"CS:GO\", \"DayZ\", \"HOS\", \"Isaac\", \"Shows\", \"Hearth\", \"WoT\", \"Agar.io\"]\n\nviewers = [1070, 472, 302, 239, 210, 171, 170, 90, 8... | [
[
"matplotlib.pyplot.clf",
"matplotlib.pyplot.xlabel",
"matplotlib.pyplot.pie",
"matplotlib.pyplot.title",
"matplotlib.pyplot.legend",
"matplotlib.pyplot.plot",
"matplotlib.pyplot.fill_between",
"matplotlib.pyplot.ylabel",
"matplotlib.pyplot.show",
"matplotlib.pyplot.subplot"... |
DarkEnergyScienceCollaboration/chroma | [
"64fc123a065334b307654f29b3bea52885b46ec8"
] | [
"bin/intuition/refraction.py"
] | [
"# Make some plots of atmospheric refraction vs. wavelength for different zenith angles.\n# Overplot the LSST filter bandpasses for reference.\n\nimport os\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport _mypath\nimport chroma\n\ndatadir = '../../data/'\n\ndef refraction_vs_zenith():\n zeniths =... | [
[
"numpy.linspace",
"numpy.arange",
"matplotlib.pyplot.figure"
]
] |
aigagror/wasserstein-style-transfer | [
"c947a716c9db5f9077d7d311adfebe80defeac16"
] | [
"tests/test_distributions.py"
] | [
"import tensorflow as tf\nfrom absl import flags\nfrom absl.testing import absltest\nfrom scipy import stats\n\nfrom distributions import compute_wass_dist, compute_co_raw_m2_loss, compute_mean_loss, compute_var_loss, \\\n compute_covar_loss, compute_skew_loss, sample_k\n\nFLAGS = flags.FLAGS\n\n\nclass TestDist... | [
[
"tensorflow.zeros",
"tensorflow.concat",
"tensorflow.debugging.assert_shapes",
"tensorflow.random.normal",
"tensorflow.ones",
"tensorflow.debugging.assert_equal",
"tensorflow.debugging.assert_near",
"tensorflow.reduce_mean",
"tensorflow.cast"
]
] |
volkale/advr | [
"f817ce31c50a5bb976eb29bffe9832e2aeb6f7c5"
] | [
"src/lib/pool_arms.py"
] | [
"import pandas as pd\nimport numpy as np\n\n\ndef get_pooled_mean(n_i: np.array, mu_i: np.array) -> np.array:\n return np.sum(n_i * mu_i) / np.sum(n_i)\n\n\ndef get_pooled_sd(n_i: np.array, mu_i: np.array, sd_i: np.array) -> np.array:\n # TODO: check this formula, source: wikipedia.org\n return np.sqrt(\n ... | [
[
"numpy.sum",
"numpy.unique"
]
] |
guaje/Autofocus-Layer | [
"380e04f37f40d46eb71551f8704b7a1ddc029ebe"
] | [
"dataset.py"
] | [
"from torch.utils.data import Dataset\r\n\r\nimport nibabel as nib\r\nimport numpy as np\r\nimport random\r\n\r\n\r\nclass TrainDataset(Dataset):\r\n def __init__(self, root_dir, args): \r\n self.root_dir = root_dir\r\n self.num_input = args.num_input\r\n self.length = int(len(self.root_di... | [
[
"numpy.concatenate",
"numpy.random.choice",
"numpy.zeros",
"numpy.arange",
"numpy.argwhere",
"numpy.expand_dims"
]
] |
Sorsly/esp | [
"35bec31af46b79edd9bb501ccda55d9b92128ea8"
] | [
"bottracking/python/bottrack.py"
] | [
"import socket\nimport numpy as np\nfrom multiprocessing import Array, Value, Process\nimport cv2\nfrom time import sleep\n\nNUMBOTS = 12\nMEMORYDEPTH = 10\nHOSTNAME = \"localhost\"\nPORT = 1917\n\nclass pos():\n def __init__(self):\n xpos = np.zeros(MEMORYDEPTH*NUMBOTS,dtype=np.int16,order=\"C\")\n ... | [
[
"numpy.zeros"
]
] |
ConservationMetrics/sahi | [
"ce336e199735f6510e046394cbaf8398328a79a7"
] | [
"sahi/postprocess/combine.py"
] | [
"# OBSS SAHI Tool\n# Code written by Fatih C Akyon, 2021.\n\nfrom typing import List, Union\nfrom sahi.prediction import ObjectPrediction\nfrom sahi.annotation import Mask, BoundingBox, Category\nimport numpy as np\nimport copy\n\n\ndef calculate_area(box: Union[List[int], np.ndarray]) -> float:\n \"\"\"\n Ar... | [
[
"numpy.concatenate",
"numpy.logical_or",
"numpy.array",
"numpy.minimum",
"numpy.maximum"
]
] |
qiu9yu/Lets_OCR | [
"b2af7120a34d785434c96e820b6eb1aa69269d20"
] | [
"recognizer/crnn/lib/create_lmdb_dataset.py"
] | [
"\nimport lmdb\nimport cv2\nimport numpy as np\nimport os\n\nOUT_PATH = '/home/ljs/OCR_dataset/CRNN_DATA/test_lmdb'\nIN_PATH = '/home/ljs/OCR_dataset/CRNN_DATA/images/360_test.txt'\nPREFIX = '/home/ljs/OCR_dataset/CRNN_DATA/images'\n\n\ndef checkImageIsValid(imageBin):\n if imageBin is None:\n return Fals... | [
[
"numpy.fromstring"
]
] |
wyt1234/financial-demo-zh1 | [
"592e1781e06bf4a44aa46722b8a7a1626b727791"
] | [
"actions/profile_db.py"
] | [
"import os\nimport sqlalchemy as sa\nfrom sqlalchemy import Column, Integer, String, DateTime, REAL\nfrom sqlalchemy.orm import Session, sessionmaker\nfrom sqlalchemy.ext.declarative import declarative_base\nfrom sqlalchemy.engine.base import Engine\nfrom typing import Dict, Text, List, Union, Optional\n\nfrom rand... | [
[
"numpy.arange"
]
] |
nikile/loglizer | [
"e37c661a7837fb30cd1dae1ba8cc2cd309c73333"
] | [
"loglizer/models/PCA.py"
] | [
"import numpy as np\nimport pandas as pd\n\n\nclass PCA(object):\n\n def __init__(self, n_components=0.95, threshold=None, c_alpha=4.4172):\n \"\"\"\n The PCA model for anomaly detection\n\n Args:\n proj_C: The projection matrix for projecting feature vector to abnorma... | [
[
"numpy.dot",
"numpy.zeros",
"pandas.DataFrame",
"numpy.sum",
"numpy.identity",
"numpy.power",
"numpy.linalg.svd",
"numpy.sqrt"
]
] |
nordic-institute/X-Road-Metrics | [
"249d859466bf6065257cf8b3c27d0e9db4ab2378"
] | [
"analysis_module/opmon_analyzer/models/FailedRequestRatioModel.py"
] | [
"# The MIT License\n# Copyright (c) 2021- Nordic Institute for Interoperability Solutions (NIIS)\n# Copyright (c) 2017-2020 Estonian Information System Authority (RIA)\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the ... | [
[
"pandas.DataFrame",
"pandas.to_timedelta"
]
] |
roaringdeer/intelligent-scissors | [
"a1a5ba2d1bccdcd2768d62bff7e1f17ddb27539a"
] | [
"tester.py"
] | [
"from pathlib import Path\nimport cv2\nimport argparse\nimport timeit\n\nimport numpy as np\ncv2.LineSegmentDetector\n\nfrom src.pathfinder import Pathfinder\nfrom src.utilities import eval_path\n\ndef get_args():\n parser = argparse.ArgumentParser('intelligent-scissors')\n parser.add_argument('impath', help=... | [
[
"numpy.zeros_like"
]
] |
adaamko/exp-relation-extraction | [
"0af5d95260809d3d130367f856e65e2e53e53c01"
] | [
"xpotato/graph_extractor/extract.py"
] | [
"import json\nimport os\nfrom collections import defaultdict\n\nimport networkx as nx\nimport pandas as pd\nimport stanza\nfrom networkx.algorithms.isomorphism import DiGraphMatcher\nfrom sklearn.metrics import precision_recall_fscore_support\nfrom tqdm import tqdm\nfrom tuw_nlp.grammar.text_to_4lang import TextTo4... | [
[
"pandas.DataFrame",
"sklearn.metrics.precision_recall_fscore_support"
]
] |
pauliacomi/CoolProp | [
"80eb4601c67ecd04353067663db50937fd7ccdae"
] | [
"dev/Tickets/1758.py"
] | [
"import numpy as np\nimport random\nimport CoolProp.CoolProp as CP\nimport time\n\nrandom.seed(\"coolprop_test\")\np = 101325 # 1 atmosphere\nT = np.random.uniform(120, 400, 10000) + 273.15 # Random points from 120 to 400 deg C, gas phase only\n\n# Make sure the objects exist and create tables if needed\nnormal_s... | [
[
"numpy.random.uniform"
]
] |
NLeSC-GO-common-infrastructure/swyft | [
"7c247991967554dc8f8e387d5fe56b3757e476dd"
] | [
"swyft/networks/batchnorm.py"
] | [
"import torch\nimport torch.nn as nn\n\n\nclass BatchNorm1dWithChannel(nn.BatchNorm1d):\n def __init__(\n self,\n num_channels: int,\n num_features: int,\n eps: float = 1e-5,\n momentum: float = 0.1,\n affine: bool = True,\n track_running_stats: bool = True,\n ... | [
[
"torch.nn.Flatten"
]
] |
trendscenter/easytorch | [
"0faf6c7f09701c8f73ed4061214ca724c83d82aa"
] | [
"dad_torch/data/data.py"
] | [
"import json as _json\nimport multiprocessing as _mp\nimport os as _os\nfrom collections import Callable\nfrom functools import partial as _partial\nfrom os import sep as _sep\n\nimport numpy as _np\nimport torch as _torch\nimport torch.utils.data as _data\nfrom torch.utils.data import DataLoader as _DataLoader, Da... | [
[
"numpy.random.seed",
"torch.initial_seed",
"torch.utils.data._utils.collate.default_collate",
"torch.utils.data.DataLoader",
"torch.utils.data.distributed.DistributedSampler"
]
] |
mneyrane/AS-NESTA-net | [
"0142097b4d9dd0daadd94d876fb4bf73e9984921"
] | [
"demos/QCBP_TV/demo_stab_re_nesta_tv_fourier.py"
] | [
"import math\nimport torch\nimport numpy as np\nimport operators as op\nimport stability\nimport nn\nfrom PIL import Image\n\nwith Image.open(\"../demo_images/test_image.png\") as im:\n im.save(\"stab-ground-truth.png\")\n X = np.asarray(im).astype(np.float64) / 255\n\n# parameters\neta = 1e-1\nN, _ = X.shape... | [
[
"torch.zeros",
"torch.rand",
"numpy.asarray",
"numpy.transpose",
"numpy.clip",
"torch.randn",
"torch.sum"
]
] |
projectpai/pouw-main-iteration | [
"e2505f63e11bbf80648c8cbe56b6d6f3e3a8546e"
] | [
"pai/pouw/verification/verifier.py"
] | [
"import binascii\nimport datetime\nimport json\nimport os\nimport shutil\nimport struct\nimport traceback\nimport uuid\n\nimport mxnet as mx\nimport numpy as np\nimport yaml\n\nimport pai\nimport redis\nfrom mxnet import gluon, autograd\nfrom pai.pouw import message_map, overdrive\nfrom pai.pouw.constants import TE... | [
[
"numpy.vectorize",
"numpy.cumsum"
]
] |
iiml-ucl/rib | [
"725543cefeb67dab7975c487ce33e2f530533a8c"
] | [
"src/util/util_torch.py"
] | [
"\"\"\"\nHelper functions for PyTorch.\n\nFunctions:\n get_trainable_parameters\n save_model_weights\n\nClass:\n Measurement\n PSNR\n SSIM\n\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable\nimport numpy as np\nfrom datetime import dat... | [
[
"torch.device",
"torch.sqrt",
"torch.nn.MSELoss",
"torch.is_tensor",
"numpy.load",
"numpy.save",
"numpy.argmax",
"torch.as_tensor",
"torch.nn.functional.conv2d",
"torch.mean"
]
] |
ghendrickx/CoralModel | [
"bd60de0b2a6464b2da92f20fd54e698ea0410a12"
] | [
"coral_model/hydrodynamics.py"
] | [
"\"\"\"\ncoral_model v3 - hydrodynamics\n\n@author: Gijs G. Hendrickx\n\"\"\"\n\nimport numpy as np\nimport os\nfrom scipy.optimize import fsolve\n# TODO: Check if the BMI-package can be removed from this project; i.e. check if once installed, it is no longer needed.\nimport bmi.wrapper\nimport faulthandler\nfaulth... | [
[
"numpy.zeros",
"matplotlib.pyplot.plot",
"scipy.optimize.fsolve",
"numpy.tanh",
"numpy.arange",
"numpy.sinh",
"numpy.linspace"
]
] |
surajpaib/tutorials | [
"70970bd213f1c2205473250aef40b6b724a8fc84"
] | [
"2d_segmentation/torch/unet_training_dict.py"
] | [
"# Copyright 2020 MONAI Consortium\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# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agreed to i... | [
[
"torch.no_grad",
"torch.utils.tensorboard.SummaryWriter",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
manu-chroma/SNUMessApp | [
"8696bee7ae84b256abda5a56c57ff62ee64888a7"
] | [
"MessJSON/app.py"
] | [
"from flask import Flask, request, jsonify, redirect, url_for\nimport pyexcel.ext.xlsx\nimport pandas as pd\nfrom werkzeug import secure_filename\n\nUPLOAD_FOLDER = 'upload'\nALLOWED_EXTENSIONS = set(['xlsx'])\n\n\napp=Flask(__name__)\napp.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER\n\n\ndef allowed_file(filename):\n ... | [
[
"pandas.read_excel"
]
] |
miyosuda/bdpy | [
"c455504d8059e911c09b602fbbb9f01452a1ee1a",
"c455504d8059e911c09b602fbbb9f01452a1ee1a"
] | [
"bdpy/test/test_util.py",
"bdpy/bdata/utils.py"
] | [
"\"\"\"Tests for bdpy.util\"\"\"\n\n\nimport unittest\n\nimport numpy as np\n\nimport bdpy\n\n\nclass TestUtil(unittest.TestCase):\n \"\"\"Tests for 'util' module\"\"\"\n\n def test_create_groupvector_pass0001(self):\n \"\"\"Test for create_groupvector (list and scalar inputs).\"\"\"\n\n x = [1,... | [
[
"numpy.array",
"numpy.testing.assert_array_equal"
],
[
"numpy.max",
"numpy.vstack",
"numpy.testing.assert_equal"
]
] |
MrMao/nlp-architect | [
"5e734071b32b0a393c75e9732246b2ff8767fad6"
] | [
"nlp_architect/models/ner_crf.py"
] | [
"# ******************************************************************************\n# Copyright 2017-2018 Intel Corporation\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# ... | [
[
"numpy.zeros"
]
] |
moskomule/ssl-suite | [
"09be8cdad24fafa94d03e53e1487c9c3f78ac728"
] | [
"vat.py"
] | [
"import torch\nfrom homura.modules import cross_entropy_with_softlabels\nfrom torch.distributions import Categorical\nfrom torch.nn import functional as F\n\nfrom backends.loss import kl_div, normalize\nfrom backends.utils import SSLTrainerBase, disable_bn_stats, get_task\n\n\nclass VATTrainer(SSLTrainerBase):\n ... | [
[
"torch.autograd.grad",
"torch.distributions.Categorical"
]
] |
stefantaubert/tacotron2 | [
"8475f014391c5066cfe0b92b6c74568639be5e79",
"8475f014391c5066cfe0b92b6c74568639be5e79"
] | [
"src/core/common/utils.tests.py",
"src/app/tacotron/validation.py"
] | [
"import os\nimport shutil\nimport unittest\nfrom os import remove, removedirs\nfrom tempfile import mkdtemp\n\nimport numpy as np\n\nfrom src.core.common.utils import (cosine_dist_mels, get_basename,\n get_chunk_name, get_subfolders,\n make_same_di... | [
[
"numpy.ones"
],
[
"matplotlib.pylab.close",
"matplotlib.pylab.savefig"
]
] |
theislab/ncem | [
"cd0ea2e9de8e1815e1f1f4139c62b4f33979f9ca"
] | [
"ncem/estimators/estimator_cvae.py"
] | [
"import numpy as np\nimport tensorflow as tf\n\nfrom ncem.estimators import EstimatorNoGraph\nfrom ncem.models import ModelCVAE\n\n\nclass EstimatorCVAE(EstimatorNoGraph):\n \"\"\"Estimator class for conditional variational autoencoder models. Subclass of EstimatorNoGraph.\"\"\"\n\n def __init__(\n sel... | [
[
"numpy.concatenate",
"tensorflow.keras.backend.set_value",
"numpy.mean",
"tensorflow.reshape",
"tensorflow.keras.optimizers.get",
"numpy.expand_dims"
]
] |
itissid/h2o-3 | [
"f176906cfb4ac299049d80e64714d19ca2525a3b"
] | [
"h2o-py/tests/pyunit_utils/utilsPY.py"
] | [
"from __future__ import print_function\nfrom future import standard_library\nstandard_library.install_aliases()\nfrom builtins import range\nfrom past.builtins import basestring\nimport sys, os\nimport numpy as np\nimport operator\n\ntry: # works with python 2.7 not 3\n from StringIO import StringIO\nexce... | [
[
"numpy.genfromtxt",
"numpy.exp",
"numpy.where",
"numpy.sign",
"numpy.sort",
"numpy.cumsum",
"numpy.concatenate",
"numpy.random.random_integers",
"numpy.argmax",
"numpy.array",
"numpy.savetxt",
"numpy.zeros",
"numpy.absolute",
"numpy.kron",
"numpy.isnan",... |
asked1988/tfx | [
"8dbd64e04a3acb5182eb1253ed9fa984beefa7e6",
"8dbd64e04a3acb5182eb1253ed9fa984beefa7e6"
] | [
"tfx/examples/iris/iris_pipeline.py",
"tfx/orchestration/kubeflow/base_component_test.py"
] | [
"# Copyright 2019 Google LLC. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appl... | [
[
"tensorflow.logging.set_verbosity"
],
[
"tensorflow.test.main"
]
] |
wimausberlin/voice-assistant-system | [
"2d92fa0989109279b3959bc6d5ea32777d50cbac"
] | [
"voice_assistant/core/train_CNN.py"
] | [
"from ast import parse\nfrom torch.autograd.grad_mode import no_grad\nfrom torch.functional import Tensor\nfrom torch.nn.modules.loss import BCELoss, CrossEntropyLoss\nfrom dataset import WakeWordDataset\nfrom model import CNNNetwork\nfrom torch.utils.data import DataLoader\nfrom tqdm import tqdm\nfrom typing impor... | [
[
"torch.nn.modules.loss.CrossEntropyLoss",
"torch.no_grad",
"torch.cuda.is_available",
"torch.utils.data.DataLoader"
]
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.