repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
anege/launchcontainers
[ "7d26e09edb1e737d5231366c4d0b8da6973d0ad7" ]
[ "qsub_generic.py" ]
[ "import argparse\nimport os\nimport shutil as sh\nimport glob\nimport subprocess as sp\nimport numpy as np\nimport pandas as pd\nimport json\n\n\n\n\nparser = argparse.ArgumentParser(description='''createSymLinks.py 'pathTo/config_launchcontainers.json' ''')\n# # Required positional argument\nparser.add_argument('c...
[ [ "pandas.read_csv" ] ]
joaquimcampos/deepsplines
[ "d9a11e9a8e66bb65e8099de68ba3739d3c81de67", "d9a11e9a8e66bb65e8099de68ba3739d3c81de67" ]
[ "deepsplines/networks/convnet_mnist.py", "scripts/approximate_parabola.py" ]
[ "\"\"\" Simple convolutional network for MNIST. \"\"\"\n\nimport torch.nn as nn\n\nfrom deepsplines.ds_modules import BaseModel\n\n\nclass ConvNetMnist(BaseModel):\n \"\"\"\n Simple convolutional network for MNIST digit classification.\n\n MNIST input size: N x 1 x 28 x 28.\n\n Network (layer type -> ou...
[ [ "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.Conv2d" ], [ "torch.optim.lr_scheduler.MultiStepLR", "matplotlib.pyplot.legend", "matplotlib.pyplot.title", "torch.zeros", "matplotlib.pyplot.plot", "matplotlib.pyplot.close", "torch.cuda.is_available", "numpy.argso...
manojbalaji1/Emojinator
[ "3016d67bf88d943326aaa0ba8ab205387e856bc7" ]
[ "CreateCSV.py" ]
[ "from scipy.misc.pilutil import imread #changed from 'from scipy.misc import imread'\nimport numpy as np\nimport pandas as pd\nimport os\nroot = './gestures' # or ‘./test’ depending on for which the CSV is being created\n\n# go through each directory in the root folder given above\nfor directory, subdirectories, fi...
[ [ "numpy.hstack", "pandas.DataFrame" ] ]
seunghyunmoon2/kochat
[ "f5a5df38c7c24080855f9279450195bc0a8eae74" ]
[ "kochat/proc/softmax_classifier.py" ]
[ "\"\"\"\n@author : Hyunwoong\n@when : 5/9/2020\n@homepage : https://github.com/gusdnd852\n\"\"\"\n\nimport torch\nfrom torch import Tensor\nfrom torch import nn\n\nfrom kochat.decorators import intent\nfrom kochat.loss.base_loss import BaseLoss\nfrom kochat.proc.torch_classifier import TorchClassifier\n\n\n@intent\...
[ [ "torch.nn.Softmax", "torch.max", "torch.cat" ] ]
pylhc/submitter
[ "d0f41a3af9b1d3edd4976e6c2f0ded725bce5242" ]
[ "pylhc_submitter/sixdesk_tools/post_process_da.py" ]
[ "\"\"\"\r\nPost Process DA\r\n----------------------------------\r\n\r\nTools to process data after sixdb has calculated the\r\nda. Includes functions for extracting data from database\r\nas well as plotting of DA polar plots.\r\n\"\"\"\r\nimport logging\r\nimport sqlite3 as sql\r\nfrom pathlib import Path\r\nfrom ...
[ [ "numpy.deg2rad", "scipy.interpolate.interp1d", "matplotlib.pyplot.subplots", "pandas.read_sql" ] ]
dmis-lab/ReSimNet
[ "3c5832dccba525451ed019afb66b829b055a2be1" ]
[ "main.py" ]
[ "import os\nimport sys\nimport logging\nimport pickle\nimport random\nimport argparse\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport torch.nn.functional as F\n\nfrom datetime import datetime\nfrom functools import partial\nfrom torch.autograd import Variable\n\nfrom ta...
[ [ "torch.manual_seed", "numpy.array", "numpy.random.seed" ] ]
sklam/sdc
[ "36340f991c9354e626dea6d3511f3f81d09448aa" ]
[ "sdc/datatypes/hpat_pandas_dataframe_types.py" ]
[ "# *****************************************************************************\n# Copyright (c) 2019, Intel Corporation All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n#\n# Redistribut...
[ [ "pandas.Series" ] ]
Luvoy/Classical_CV_Project
[ "2fb1a861e6b43d0450053e5f33a15687c1c2148e" ]
[ "detect.py" ]
[ "import numpy as np\nimport cv2\nimport matplotlib.pyplot as plt\nimport os\n\n# 读取一张源图和一张场景图, 在场景中检测出源图物体\n\nRATIO = 0.75\nMIN_MATCH = 10\n\n# 读取灰度图\nimg1_gray = cv2.imread(\n os.path.join(os.curdir, \"detect_test_images\", \"box.jpg\"), 0)\nimg2_gray = cv2.imread(\n os.path.join(os.curdir, \"detect_test_ima...
[ [ "matplotlib.pyplot.show", "numpy.float32", "numpy.int32" ] ]
cogtoolslab/curiotower_CogSci2021
[ "e8abe7030c0d1536c0214b138fc709455f29a8c1" ]
[ "models/model.py" ]
[ "import os, io\nfrom multiprocessing import Pool\ntry:\n import cPickle as pickle\nexcept:\n import pickle\nimport numpy as np\nimport h5py\nimport pandas as pd\nimport sklearn.svm as svm\nfrom sklearn.model_selection import GridSearchCV\nimport sklearn.metrics as sk_metrics\nimport scipy.stats as stats\nimpo...
[ [ "numpy.sum", "numpy.abs", "numpy.linspace", "numpy.unique", "numpy.stack", "numpy.std", "numpy.array", "numpy.zeros", "numpy.where" ] ]
bstienen/phenoai
[ "d7210aa2d0f89573724d0301e0dfeffb87c26646" ]
[ "phenoai/containers.py" ]
[ "\"\"\" The classes module implements classes from which other classes in the\nphenoai package are derived. Currently these classes are\n:class:`~phenoai.containers.Estimator` and\n:class:`~phenoai.containers.Configuration`. \"\"\"\n\nfrom copy import deepcopy\nimport os.path\n\nimport numpy as np\n\nfrom phenoai i...
[ [ "numpy.abs", "numpy.argmax", "numpy.sum" ] ]
stanford-futuredata/POP
[ "baa041dc67a465b8111e22e215880fa7d4fe8c61" ]
[ "traffic_engineering/lib/problems.py" ]
[ "import os\nimport numpy as np\nimport networkx as nx\nfrom .config import TOPOLOGIES_DIR, TM_DIR\nfrom .problem import Problem\nfrom .traffic_matrix import TrafficMatrix\n\n################\n# Topology Zoo #\n################\nclass TopologyZooProblem(Problem):\n def __init__(self, fname, *, model=\"gravity\", ...
[ [ "numpy.zeros" ] ]
jiangxiluning/TCPN
[ "916bd8455be5c784068b7bb5bd6226da3f2d95c7" ]
[ "project/model/decoder.py" ]
[ "# ______ __ \n# / \\ / | \n# /$$$$$$ | __ __ __ ______ _______ $$ | __ __ \n# $$ | $$ |/ | / | / | / \\ / \\ $$ | / | / |\n# $$ | $$ |$$ |...
[ [ "torch.softmax", "torch.nn.functional.softmax", "numpy.random.seed", "torch.nn.LSTM", "torch.cat", "torch.manual_seed", "torch.nn.Embedding", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.Linear", "torch.nn.utils.rnn.pad_packed_sequence", "torch.nn.functional.sig...
pablocarderam/fitness_valleys_opqua
[ "a4d0156079695644a211af962bd3d30db3e7d5eb" ]
[ "fig4-populations/fig4ace-popsize/fig4ace-popsize_sweep.py" ]
[ "\n'''\nCardenas & Santos-Vega, 2021\nCoded by github.com/pablocarderam\nCreates heatmaps of parameter sweeps for mutation in and inoculation from\nvectors\nused in Figure 5b,e,h\n'''\n\nimport copy as cp\nimport textdistance as td\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt # plots\...
[ [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "numpy.linspace", "matplotlib.pyplot.savefig", "numpy.var", "matplotlib.pyplot.rcParams.update", "numpy.sum", "matplotlib.pyplot.figure" ] ]
Eli-YiLi/PMM
[ "134ad33fb42be51f10e9708336bb9bfeefd671e0" ]
[ "pipeline/refine_cam.py" ]
[ "import cv2, sys, os, random\nimport numpy as np\nimport pydensecrf.densecrf as dcrf\nfrom pydensecrf.utils import unary_from_softmax\nimport itertools\nfrom multiprocessing import Pool\n\ndef crf_inference(img, probs, t=10, scale_factor=1, labels=21):\n h, w = img.shape[:2]\n n_labels = labels\n\n d = dcr...
[ [ "numpy.ascontiguousarray", "numpy.stack", "numpy.ones", "numpy.concatenate", "numpy.max", "numpy.copy", "numpy.save", "numpy.zeros_like", "numpy.array", "numpy.zeros" ] ]
Hiroki-Yoshida7/Deep-Neural-Network-Analysis
[ "acb06af28dfc1fbe8b4c2c504786028ae160a2a5" ]
[ "FlaskServer/server.py" ]
[ "from flask import Flask, redirect, url_for, request, jsonify\nimport mlModule as ml\n\nimport numpy as np\nimport re\nimport pickle\nfrom keras.preprocessing.text import Tokenizer\nfrom keras.preprocessing.sequence import pad_sequences\nfrom keras.models import load_model\n\napp = Flask(__name__)\n\n@app.route('/h...
[ [ "numpy.vectorize", "numpy.array", "numpy.char.lower" ] ]
anelkhvan/ParlAI
[ "f6d60f4ea0fa5fc37c2e1e978c6d7098d9335123" ]
[ "parlai/scripts/train_model.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright (c) Facebook, Inc. and its affiliates.\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\n\"\"\"\nTraining script for ParlAI.\n\nThe standard way to train a model. After training, also computes\nvali...
[ [ "numpy.round" ] ]
ssiddhantsharma/morfeus
[ "45f89d86be9e920fc84e7476d82408e6b8930325" ]
[ "morfeus/dispersion.py" ]
[ "\"\"\"Dispersion code.\"\"\"\n\nimport functools\nfrom os import PathLike\nimport typing\nfrom typing import Any, cast, Dict, Iterable, List, Optional, Sequence, Union\n\nimport numpy as np\nimport scipy.spatial\n\nfrom morfeus.calculators import D3Calculator, D3Grimme, D4Grimme\nfrom morfeus.data import ANGSTROM_...
[ [ "numpy.isin", "numpy.sqrt", "numpy.min", "matplotlib.colors.hex2color", "numpy.max", "numpy.insert", "numpy.repeat", "numpy.array", "numpy.sum", "numpy.vstack" ] ]
keonlee9420/Cross-Speaker-Emotion-Transfer
[ "341173fdb44d6fadb4d8f68f83f0bce9c0072ddc" ]
[ "model/XSpkEmoTrans.py" ]
[ "import os\r\nimport json\r\n\r\nimport torch\r\nimport torch.nn as nn\r\nimport torch.nn.functional as F\r\n\r\nfrom .modules import TextEncoder, GlobalEmotionToken, DurationPredictor, Upsampling, Decoder\r\nfrom utils.tools import get_mask_from_lengths\r\n\r\n\r\nclass XSpkEmoTrans(nn.Module):\r\n \"\"\" Cross...
[ [ "torch.nn.Linear", "torch.nn.Embedding" ] ]
RuiLiFeng/indomain2
[ "afc3cefdbb1a104b6da8a5a255833a3bd312b31f", "afc3cefdbb1a104b6da8a5a255833a3bd312b31f", "afc3cefdbb1a104b6da8a5a255833a3bd312b31f" ]
[ "edit_optim2.py", "training/training_loop_encoder7.py", "w_estimator.py" ]
[ "# python 3.6\n\"\"\"Inverts given images to latent codes with In-Domain GAN Inversion.\n\nBasically, for a particular image (real or synthesized), this script first\nemploys the domain-guided encoder to produce a initial point in the latent\nspace and then performs domain-regularized optimization to refine the lat...
[ [ "tensorflow.get_default_session", "tensorflow.clip_by_value", "tensorflow.get_variable", "tensorflow.transpose", "tensorflow.reduce_mean", "numpy.asarray", "tensorflow.reshape", "tensorflow.assign", "tensorflow.placeholder", "numpy.transpose", "numpy.mean", "tensorf...
dilanHewawitharana/OpenCV-Python-Self-Learning-10-Hrs
[ "3f14567e5a00be2d1cf22131ff9a517b5aca2548" ]
[ "24_Lane_Detection.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pylab as plt\n\n\ndef region_of_interest(img, vertices):\n mask = np.zeros_like(img)\n # channel_count = img.shape[2]\n match_mask_color = 255\n cv2.fillPoly(mask, vertices, match_mask_color)\n masked_image = cv2.bitwise_and(img, mask)\n return ma...
[ [ "numpy.copy", "numpy.array", "numpy.zeros_like", "numpy.zeros" ] ]
pbelevich/fairscale
[ "5ababa88d8e9879424c582ee141545b1301151dc" ]
[ "benchmarks/oss.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the BSD license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport argparse\nfrom enum import Enum\nimport importlib\nimport logging\nimport tempfile\nimport time\nfrom typing import Any, List...
[ [ "torch.autograd.profiler.record_function", "torch.multiprocessing.spawn", "torch.utils.data.DataLoader", "torch.cuda.amp.autocast", "torch.cuda.is_available", "torch.device", "torch.distributed.get_rank", "torch.nn.CrossEntropyLoss", "torch.cuda.synchronize", "torch.distrib...
jamalalasadi/CNN_Image_retrieval
[ "a2ec916e076f9e3aa6864ebba157c882a5aafbbf" ]
[ "src/main_testing_all_images.py" ]
[ "#import pandas as pd\r\nimport numpy as np\r\n#import matplotlib.pyplot as plt\r\nimport os\r\nfrom skimage import io, transform\r\nimport torch.optim as optim\r\nfrom torch.utils.data import Dataset, DataLoader\r\nfrom torch.utils.data.sampler import SubsetRandomSampler\r\nfile_path ='/home/aymenlinux/CNN_Image_r...
[ [ "torch.nn.CrossEntropyLoss", "torch.max", "torch.load", "torch.Tensor.permute", "torch.nn.Conv2d", "torch.utils.data.DataLoader", "torch.from_numpy", "torch.nn.Linear", "torch.nn.functional.relu", "torch.cuda.is_available", "torch.nn.BatchNorm2d", "torch.device", ...
VikasChowdary/QuickDraw
[ "5eb201c8a59162961878289ebeefd13aaa6159e5" ]
[ "QD_trainer.py" ]
[ "import numpy as np\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.utils import shuffle\nfrom keras.layers import Dense,Flatten, Conv2D\nfrom keras.layers import MaxPooling2D, Dropout\nfrom keras.utils import np_utils, print_summary\nimport tensorflow as tf\nfrom keras.models import Sequential\...
[ [ "sklearn.utils.shuffle", "numpy.append", "sklearn.model_selection.train_test_split" ] ]
RichealYoung/myutil
[ "6803e213c69b9f20307dbdf835c8293d5ec7a45f" ]
[ "io_util.py" ]
[ "import numpy as np\r\nimport cv2\r\nfrom multiprocessing import Pool\r\nimport os\r\nfrom os.path import join as opj\r\ndef gen_pathlist_fromimgdir(imgdir)->list:\r\n imgnamelist=os.listdir(imgdir)\r\n imgpathlist=[opj(imgdir,imgname) for imgname in imgnamelist]\r\n imgpathlist.sort()\r\n return imgpat...
[ [ "numpy.concatenate", "numpy.frombuffer", "numpy.fromfile", "numpy.reshape" ] ]
Yogurt2019/abd-deep-person-reid
[ "47c9b9499bffb937891a896f7b5ab7ce7a8f67c4" ]
[ "tools/visualize_actmap.py" ]
[ "\"\"\"Visualizes CNN activation maps to see where the CNN focuses on to extract features.\n\nReference:\n - Zagoruyko and Komodakis. Paying more attention to attention: Improving the\n performance of convolutional neural networks via attention transfer. ICLR, 2017\n - Zhou et al. Omni-Scale Feature Lear...
[ [ "torch.nn.functional.normalize", "numpy.min", "numpy.ones", "numpy.max", "torch.no_grad", "numpy.floor", "torch.cuda.is_available" ] ]
TaoHuang13/Rock-Paper-Scissors
[ "9a8044be38698a7d7657af72d488d393a26af296" ]
[ "UCB.py" ]
[ "import pandas as pd\nimport numpy as np\nimport json\n\n# base class for all agents, random agent\nclass agent():\n def initial_step(self):\n return np.random.randint(3)\n \n def history_step(self, history):\n return np.random.randint(3)\n \n def step(self, history):\n if len(hi...
[ [ "numpy.random.beta", "numpy.sqrt", "numpy.min", "pandas.DataFrame", "numpy.argmax", "numpy.argmin", "numpy.bincount", "numpy.zeros", "numpy.random.randint" ] ]
janpipek/boadata
[ "3da00de9e014b764d40040c0db89aaaebc87fa18" ]
[ "boadata/data/matlab_types.py" ]
[ "from boadata.core import DataObject\n\nfrom numpy import size\n\nfrom .numpy_types import NumpyArrayBase\nfrom .plotting_types import XYPlotDataSeriesBase\n\n\n@DataObject.register_type()\nclass MatlabFigXYData(XYPlotDataSeriesBase):\n type_name = \"matlab_fig_xy\"\n\n @classmethod\n def accepts_uri(cls, ...
[ [ "numpy.size", "scipy.io.loadmat" ] ]
jsamoocha/pysweat
[ "127d1d473199bdbbbbe9cd6efbb03c7b80ab147a" ]
[ "tests/test_features_activities.py" ]
[ "import unittest\n\nimport pandas as pd\n\nfrom pysweat.features.activities import ActivityFeatures, _moving_sum_filter\n\n\nclass ActivityFeaturesTest(unittest.TestCase):\n def test_moving_sum_filter_fixed_window_size(self):\n test_series = pd.Series([1, 0, 1, 1, 2, 1, 0, 0], index=[1, 2, 5, 8, 9, 11, 12...
[ [ "pandas.Series", "pandas.DataFrame" ] ]
ucla-pbpl/pbpl-nozzle
[ "e50967bacbb97b5a2c8c0b11034cc25bcda5a7ab" ]
[ "revolver.py" ]
[ "#!/usr/bin/env python\nimport sys\nimport os\nimport argparse\nimport toml\nimport numpy as np\nfrom OCC.Core.BRepBuilderAPI import *\nfrom OCC.Core.BRepMesh import *\nfrom OCC.Core.BRepPrimAPI import *\nfrom OCC.Core.BRepTools import *\nfrom OCC.Core.GeomAPI import *\nfrom OCC.Core.gp import *\nfrom OCC.Core.STEP...
[ [ "numpy.deg2rad", "numpy.array" ] ]
bubblegumsoldier/kiwi
[ "91701c1806dcfbc1b038fecf7c2cab8bb07a01d4" ]
[ "kiwi-content/kiwi/database/DataAccessor.py" ]
[ "from aiomysql import IntegrityError\nimport pandas as pd\nimport numpy as np\n\n\nclass DataAccessor:\n def __init__(self, conn=None):\n self._conn = conn\n\n async def get_content_frame(self):\n data = await self._get_content(self._conn)\n content_frame = pd.DataFrame.from_records(\n ...
[ [ "pandas.DataFrame.from_records" ] ]
ptrbortolotti/WEIS
[ "1e4dbf6728050f75cee08cd483fe57c5614488fe", "1e4dbf6728050f75cee08cd483fe57c5614488fe", "1e4dbf6728050f75cee08cd483fe57c5614488fe" ]
[ "MoorPy/moorpy/system.py", "WISDEM/wisdem/test/test_towerse/test_tower_struct.py", "examples/01_aeroelasticse/run_PC_sweep.py" ]
[ "\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\nimport yaml\n\nfrom moorpy.body import Body\nfrom moorpy.point import Point\nfrom moorpy.line import Line\nfrom moorpy.lineType import LineType\n\n#import moorpy.MoorSolve as msolve\nfrom moorpy.helpers import rotati...
[ [ "numpy.hstack", "numpy.linalg.solve", "numpy.abs", "numpy.linalg.inv", "numpy.matmul", "matplotlib.pyplot.subplots", "numpy.linalg.norm", "matplotlib.pyplot.gcf", "matplotlib.pyplot.axes", "numpy.int", "numpy.append", "numpy.rad2deg", "numpy.isscalar", "nump...
nachiket273/VisTrans
[ "99129b02f275424ebff900189ec2055f26bb9912" ]
[ "vistrans/models/vit.py" ]
[ "\"\"\" Vision Transformer\n\nA PyTorch implementation of Vision Transformers:\n'An Image Is Worth 16 x 16 Words: Transformers for Image Recognition at Scale'\n- https://arxiv.org/abs/2010.11929\n\nThe official jax code is available at\nhttps://github.com/google-research/vision_transformer\n\"\"\"\nfrom copy import...
[ [ "torch.nn.Dropout", "torch.cat", "torch.nn.init.constant_", "torch.nn.init.trunc_normal_", "torch.zeros", "torch.nn.Conv2d", "torch.nn.init.xavier_normal_", "torch.nn.Linear", "torch.nn.init.normal_", "torch.nn.functional.interpolate", "torch.nn.init.zeros_" ] ]
hyerinshelly/RL_COVID-19_Korea
[ "da95b6713969271043a44c10b84f9407f038b71a", "da95b6713969271043a44c10b84f9407f038b71a" ]
[ "epidemioptim/optimization/shared/rollout.py", "epidemioptim/environments/gym_envs/korea_epidemic_discrete.py" ]
[ "import numpy as np\n\n\ndef run_rollout(policy, env, eval, n=1, additional_keys=(), goal=None, reset_same_model=False):\n \"\"\"\n Rollout function. Executes 'n' trajectories in 'env' using 'policy' with given 'goal'.\n\n Parameters\n ----------\n policy: BaseAlgorithm\n The algorithm whose p...
[ [ "numpy.concatenate", "numpy.atleast_2d", "numpy.array" ], [ "numpy.random.choice", "numpy.arange", "numpy.atleast_2d", "numpy.array", "numpy.zeros", "numpy.sum", "numpy.random.randint" ] ]
jizongFox/adversarial-robustness-toolbox
[ "ee3b7ac1ef21fcfd21501070aff2f8eb9db70301" ]
[ "art/attacks/virtual_adversarial.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.nditer", "numpy.reshape", "numpy.copy", "scipy.stats.entropy", "numpy.random.randn", "numpy.zeros_like", "numpy.sum" ] ]
prampey/pytorch-lightning
[ "ddd11075bd01c5a68644c2ef1e976f987d0907f6" ]
[ "pytorch_lightning/trainer/logging.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.mean" ] ]
983632847/homura
[ "81d9ffba3a8eb5172fc2bd08fec10e816138ef2e" ]
[ "test/test_modules/test_functional.py" ]
[ "import torch\nfrom pytest import approx\nfrom torch.nn import functional as F\n\nfrom homura.modules import functional as HF\n\n\ndef test_gumbel_softmax():\n input = torch.tensor([10, 0.3, 0.3])\n samples = sum([HF.gumbel_softmax(input, 0, 0.01) for _ in range(400)]) / 400\n assert samples.tolist() == ap...
[ [ "torch.zeros", "torch.randn", "torch.nn.functional.cross_entropy", "torch.equal", "torch.tensor" ] ]
KooroshNaderi/UnityClimberAgent
[ "1953dc6786872304a2fd19140f685895557ad052" ]
[ "unity-environment/Learning/utils/nn.py" ]
[ "import tensorflow as tf\n\n\ndef dropout(x, std=0.05):\n return tf.multiply(x, tf.truncated_normal(shape=tf.shape(x), mean=1.0, stddev=std, dtype=tf.float32))\n\n\ndef selu(x, _lambda=1.0507, _alpha=1.6733):\n return _lambda * tf.where(x >= 0.0, x, _alpha * tf.nn.elu(x))\n\n\nclass CNN:\n def __init__(sel...
[ [ "tensorflow.nn.crelu", "tensorflow.nn.max_pool", "tensorflow.pad", "tensorflow.truncated_normal_initializer", "tensorflow.nn.softsign", "tensorflow.name_scope", "tensorflow.nn.elu", "tensorflow.nn.sigmoid", "tensorflow.shape", "tensorflow.zeros_initializer", "tensorflow...
mathemusician/metrics
[ "be3814ed987d2079877393af14890c2c1bc9f902" ]
[ "torchmetrics/functional/audio/stoi.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.from_numpy", "numpy.empty", "torch.tensor" ] ]
ML-KULeuven/ocus-explain
[ "961f77ef196fa867a09af9ab7100c138f234f0b0" ]
[ "pyexplain/examples/frietkot.py" ]
[ "import itertools\nfrom pyexplain.utils.utils import add_assumptions\nimport sys\n\n# import numpy\nimport pandas as pd\n\nfrom cppy import cnf_to_pysat\n\nfrom cppy import *\nfrom cppy.model_tools.to_cnf import *\n\n# Relation between 'rows' and 'cols', Boolean Variables in a pandas dataframe\nclass Relation(objec...
[ [ "pandas.DataFrame" ] ]
jdasam/scnym
[ "0b506170f4cb944e498d97ba0e086cbe2a62a18e" ]
[ "tests/test_api.py" ]
[ "import pytest\nimport numpy as np\nimport torch\nimport anndata\nimport os\nimport os.path as osp\nfrom pathlib import Path\nimport scanpy as sc\nfrom sklearn.model_selection import StratifiedKFold\n\nimport sys\nsys.path = ['../'] + sys.path\nimport scnym\nscnym_api = scnym.api.scnym_api\natlas2target = scnym.api...
[ [ "numpy.random.seed", "numpy.random.choice", "numpy.expm1", "torch.cuda.is_available", "numpy.array", "numpy.sum" ] ]
OisinB-2814/ARC
[ "ddc6cde2a327b037bc3d914256ba3206d0d1b637" ]
[ "ob_work/manual_solve.py" ]
[ "#!/usr/bin/python\n\nimport os, sys\nimport json\nimport numpy as np\nimport re\n\n# Name: Oisin Brannock\n# Student ID: 20235671\n# Class: CT5148\n# GitHub repo: https://github.com/OisinB-2814/ARC\n\n\n### YOUR CODE HERE: write at least three functions which solve\n### specific tasks by transforming the input x a...
[ [ "numpy.all", "numpy.array", "numpy.vectorize" ] ]
cloudbutton/geospatial-usecase
[ "3c56344141da526f77fa0008c9e1a36c3ed22b09" ]
[ "test_s2froms3_optimized.py" ]
[ "import datetime as dt\nfrom pathlib import Path\nimport cloudbutton_geospatial.s2froms3 as s2froms3\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport rasterio\nimport lithops\nimport time\nimport shutil\nimport os\n\n# https://pybonacci.org/2021/04/21/creando-un-mosaico-usando-s2froms3-en-python-a-parti...
[ [ "matplotlib.pyplot.imsave", "numpy.where", "matplotlib.pyplot.figure" ] ]
Moon-xm/pykeen
[ "eeaf1d623aa881c0c897772372988390e1d8302d" ]
[ "src/pykeen/models/unimodal/trans_r.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"Implementation of TransR.\"\"\"\n\nfrom functools import partial\nfrom typing import Any, ClassVar, Mapping, Optional\n\nimport torch\nimport torch.autograd\nimport torch.nn.init\n\nfrom ..base import EntityRelationEmbeddingModel\nfrom ...constants import DEFAULT_EMBEDDING_HPO_EMBE...
[ [ "torch.norm" ] ]
jvesely/PsyNeuLink
[ "40d92fdfd61c4ec992ae2564a0bd8496dfd7fa31" ]
[ "psyneulink/core/components/mechanisms/modulatory/control/gating/gatingmechanism.py" ]
[ "# Princeton University licenses this file to You under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License. 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...
[ [ "numpy.array" ] ]
roamiri/Horizon
[ "cfa7a873ada5de3bb01e78e2f237d9849b8270b2" ]
[ "ml/rl/test/preprocessing/test_feature_extractor.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\nimport unittest\n\nimport numpy as np\nimport numpy.testing as npt\nfrom caffe2.python import schema, workspace\nfrom ml.rl import types as rlt\nfrom ml.rl.preprocessing.feature_extractor import (\n PredictorFeatu...
[ [ "numpy.arange", "numpy.array" ] ]
Garyfallidis/dipy
[ "4341b734995d6f51ac9c16df26a7de00c46f57ef" ]
[ "dipy/core/meshes.py" ]
[ "''' Mesh analysis '''\n\nimport numpy as np\nfrom scipy import sparse\n\nFLOAT64_EPS = np.finfo(np.float64).eps\nFLOAT_TYPES = np.sctypes['float']\n\nwhite = 0\nred = 1\nblack = 2\ngreen = 3\n\ndef sym_hemisphere(vertices,\n hemisphere='z',\n equator_thresh=None,\n ...
[ [ "numpy.nonzero", "numpy.unique", "numpy.asarray", "numpy.arange", "scipy.spatial.Delaunay", "numpy.finfo", "numpy.all", "numpy.ones", "numpy.array", "numpy.where", "numpy.sum" ] ]
Adilius/automatic-ie-ocr
[ "e31c8828faea73177383adcff287773fb11a0ff0" ]
[ "app/preprocessing.py" ]
[ "import cv2\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom skimage import io\nfrom . import util\n\n\ndef min_max(image):\n image_min = np.min(image)\n image_max = np.max(image)\n new_image = (image - image_min) / (image_max - image_min)\n return new_image\n\n\ndef grayscale_image(image):\n ...
[ [ "numpy.max", "numpy.where", "numpy.min" ] ]
corekel/deeplearning
[ "4c676988f43c0bd767f1a8e5875dcc7217f09dee" ]
[ "src/network3.py" ]
[ "\"\"\"network3.py\n~~~~~~~~~~~~~~\n\nA Theano-based program for training and running simple neural\nnetworks.\n\nSupports several layer types (fully connected, convolutional, max\npooling, softmax), and activation functions (sigmoid, tanh, and\nrectified linear units, with more easily added).\n\nWhen run on a CPU,...
[ [ "numpy.sqrt", "numpy.asarray", "numpy.random.normal", "numpy.prod", "numpy.random.RandomState", "numpy.zeros" ] ]
ldlasso2/obj2png
[ "99600ddd159e2de1eb4518b4d07694b2f8aefb64" ]
[ "test/test_ObjFile.py" ]
[ "\nimport sys\nimport os\nimport zipfile\n# assumed being called from obj2png/\nsys.path.append('./src')\nsys.path.append('../src')\n\nimport numpy as np\n# because of display issue on travis\n# https://stackoverflow.com/questions/4931376/generating-matplotlib-graphs-without-a-running-x-server\nimport matplotlib as...
[ [ "matplotlib.use", "numpy.array" ] ]
FernandoZhuang/Emotion-recognition-of-netizens-during-the-epidemic
[ "6d0ae2956ffc53cfa676d3a8583de8e15a3b6c8b" ]
[ "Code/convert_tf_to_pytorch/convert_tf_checkpoint_to_pytorch.py" ]
[ "# coding=utf-8\n# Copyright 2018 The HugginFace 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/licenses/LICENSE-2.0\n#\n# Unless require...
[ [ "tensorflow.train.load_variable", "torch.from_numpy", "numpy.transpose", "tensorflow.train.list_variables" ] ]
gtesei/ccyclegan
[ "f78cb053d9f3349d7c39fc2f8dc7448485b823c3" ]
[ "ccyclegan_t11.py" ]
[ "from __future__ import print_function, division\nimport scipy\n\nfrom keras.datasets import mnist\nfrom keras_contrib.layers.normalization.instancenormalization import InstanceNormalization\nfrom keras.layers import Input, Dense, Reshape, Flatten, Dropout, Concatenate\nfrom keras.layers import BatchNormalization, ...
[ [ "matplotlib.pyplot.subplots", "numpy.ones", "numpy.concatenate", "numpy.mean", "matplotlib.pyplot.close", "numpy.prod", "numpy.add", "numpy.array", "numpy.zeros" ] ]
Geeks-Sid/OPM
[ "fd3bf3739a5d1132cbd3b2e3e63a762edd4ac52b" ]
[ "opm/utils.py" ]
[ "import numpy as np\nfrom skimage.filters.rank import maximum\nfrom skimage.filters import gaussian\nfrom skimage.morphology.selem import disk\nfrom skimage.morphology import remove_small_objects, remove_small_holes\nfrom skimage.color.colorconv import rgb2hsv\nimport matplotlib.pyplot as plt\n\n# RGB Masking (pen)...
[ [ "matplotlib.pyplot.imshow", "numpy.product", "numpy.logical_and", "numpy.unique", "numpy.asarray", "numpy.bitwise_and", "numpy.any", "numpy.count_nonzero", "numpy.array", "matplotlib.pyplot.show", "numpy.where", "numpy.bitwise_or" ] ]
JackDanielHarding/advent-of-code-2021
[ "5b860e36b4ac1af205c992763167ffef41a81a1b" ]
[ "Callum/Day11/Day11.py" ]
[ "import numpy as np\n\narray = np.genfromtxt('./input.txt', delimiter=1, dtype=int)\nflashed = np.zeros_like(array)\n\ndef flash(array, iy, ix):\n if not flashed[iy, ix]:\n flashed[iy, ix] = 1\n minY = max(iy-1, 0)\n maxY = min(iy+2, len(array))\n minX = max(ix-1, 0)\n maxX = m...
[ [ "numpy.ndindex", "numpy.zeros_like", "numpy.sum", "numpy.genfromtxt" ] ]
glass-w/openff-arsenic
[ "e1de324b37aae987856a6cd23accd9eb333fad76" ]
[ "openff/arsenic/tests/test_stats.py" ]
[ "import itertools\n\nimport networkx as nx\nimport numpy as np\nfrom openff.arsenic import stats\nfrom openff.arsenic.stats import bootstrap_statistic\nfrom openff.arsenic.wrangle import FEMap\n\n\ndef test_mle_easy(input_absolutes: list = [-14.0, -13.0, -9.0]):\n \"\"\"\n Test that the MLE for a graph with a...
[ [ "numpy.random.uniform", "numpy.abs" ] ]
ViktorBusk/Machine-Learning-Number-Prediction
[ "f9863ccdb623ed3bf83ca26faae310d56f087c4f" ]
[ "src/AI.py" ]
[ "import tensorflow as tf\nimport numpy as np\nimport random as rand\nimport matplotlib.pyplot as plt\nfrom tensorflow.keras.preprocessing.image import ImageDataGenerator\nfrom tensorflow.keras.utils import to_categorical\n\nclass NumberAI:\n '''\n `NumberAI` a neuralnetwork using `tf.keras.Model` to create a ...
[ [ "matplotlib.pyplot.imshow", "tensorflow.keras.preprocessing.image.ImageDataGenerator", "numpy.empty_like", "tensorflow.keras.layers.Dense", "numpy.concatenate", "numpy.max", "numpy.random.permutation", "numpy.argmax", "numpy.zeros", "matplotlib.pyplot.show", "tensorflow...
TusharRaman/yolov3-tf2
[ "e2ea786ed6a9205f196fd266d39df2b7f73bb40c" ]
[ "tools/voc2012.py" ]
[ "#Importing required libraries\nimport time\nimport os\nimport hashlib\n\nfrom absl import app, flags, logging\nfrom absl.flags import FLAGS\nimport tensorflow as tf\nimport lxml.etree\nimport tqdm\n\nflags.DEFINE_string('data_dir', './data/voc2012_raw/VOCdevkit/VOC2012/',\n 'path to raw PASCAL V...
[ [ "tensorflow.io.TFRecordWriter", "tensorflow.train.FloatList", "tensorflow.train.BytesList", "tensorflow.train.Int64List" ] ]
cardi/matplotlib-config
[ "9d4e4f4f2263869065ae1e9d01914e9fe5c2a308" ]
[ "local_mpl_config.py" ]
[ "#!/usr/bin/env python3\n\"\"\"\n\nlocal_mpl_config.py\n\nrequirements:\n - matplotlib-3.x.x+ requires python3\n - Helvetica*.ttf fonts installed in matplotlib fonts directory\n\n if you're using MacPorts, the fonts directory is here:\n\n /opt/local/Library/Frameworks/Python.framework/Versions/3.7/lib/pyt...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.savefig", "matplotlib.rcParams.update", "matplotlib.pyplot.text", "matplotlib.pyplot.suptitle" ] ]
tbweng/C-PAC
[ "12a1807865273891aa3a566429ac9fe76c12532c" ]
[ "CPAC/nuisance/utils.py" ]
[ "import os\nimport re\nimport numpy as np\nimport nibabel as nb\n\nimport nipype.pipeline.engine as pe\nimport nipype.interfaces.utility as util\nimport nipype.interfaces.fsl as fsl\nimport nipype.interfaces.ants as ants\nfrom nipype.interfaces import afni\n\nfrom CPAC.utils.function import Function\n\nimport scipy...
[ [ "numpy.linalg.svd", "numpy.unique", "numpy.uint8", "numpy.linalg.norm", "numpy.percentile", "numpy.ones", "numpy.all", "numpy.nan_to_num", "numpy.any", "numpy.prod", "numpy.savetxt", "numpy.zeros", "numpy.where", "numpy.loadtxt", "scipy.signal.detrend" ...
wangruohui/mmcv
[ "d9ae03df3d1eb585de6fd2b75fbc2e47d4852083" ]
[ "mmcv/cnn/bricks/transformer.py" ]
[ "import copy\nimport warnings\n\nimport torch\nimport torch.nn as nn\n\nfrom mmcv import ConfigDict\nfrom mmcv.cnn import Linear, build_activation_layer, build_norm_layer\nfrom mmcv.runner.base_module import BaseModule\nfrom mmcv.utils import build_from_cfg\nfrom .registry import (ATTENTION, POSITIONAL_ENCODING, TR...
[ [ "torch.nn.Sequential", "torch.nn.Dropout", "torch.nn.ModuleList", "torch.nn.MultiheadAttention" ] ]
DeDPanda-c/my_first_neuron
[ "34d837ebf7ed1def3813af2e0d3ee4989d21ae48" ]
[ "util.py" ]
[ "import numpy as np\n\n\ndef create_first_matrix(matrix):\n if (type(matrix) == np.ndarray and matrix[0] == 1 and matrix[1] == 2 and matrix[2] == 3):\n print(\"SUCCESS\")\n else:\n print(\"FAILURE\")\n\ndef my_new_array():\n return np.array([[0] * 5, [3] * 5])\n\ndef check_random_matrix(a1,...
[ [ "numpy.array" ] ]
ScottHMcKean/pyfracman
[ "c5d0d5e6207d6dc86e1fc7d19506996c0014f5bc" ]
[ "pyfracman/fab.py" ]
[ "\"\"\"\nModule to read .fab files and return properties\n\"\"\"\nimport pandas as pd\nimport numpy as np\n\n\ndef read_tesselated_fractures(f):\n # Read the fracture\n frac_nodes = []\n frac_faces = []\n frac_properties = []\n frac_ids = []\n sets = []\n for line in f:\n # exit upon end...
[ [ "numpy.asarray", "numpy.zeros" ] ]
arcosin/ANP_TrackDriver
[ "d1705bb77959cb3653490e126a40f8086ba084bd" ]
[ "src/server.py" ]
[ "import sys\nimport time\nimport torch\nimport socket\nimport pickle\nimport numpy as np\nfrom PIL import Image\nimport matplotlib.pyplot as plt\nimport os\n# from os import path\n\n# sys.path.append(path.join(path.dirname(__file__), '..'))\nfrom sac import SACAgent\nfrom sac import BasicBuffer\nfrom sac import Che...
[ [ "matplotlib.pyplot.axhline", "numpy.random.random", "matplotlib.pyplot.title", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.clf", "numpy.random.randint", "torch.cuda.is_available", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylabel" ] ]
kungfuai/kaishi
[ "e20360170ccac2111cab61fcd71b81be3c2a7468" ]
[ "kaishi/tabular/aggregators/concatenate_dataframes.py" ]
[ "\"\"\"Class definition for concatenating tabular data files.\"\"\"\nfrom kaishi.core.pipeline_component import PipelineComponent\nimport pandas as pd\n\n\nclass AggregatorConcatenateDataframes(PipelineComponent):\n \"\"\"Concatenate all data frames.\"\"\"\n\n def __init__(self):\n \"\"\"Initialize new...
[ [ "pandas.concat" ] ]
mpeyroti/FinRL
[ "9fbceb75d8a8d740f822db161416933c3ae9148f" ]
[ "finrl/neo_finrl/env_stock_trading/env_stocktrading_np.py" ]
[ "import numpy as np\nimport os\nimport gym\nfrom numpy import random as rd\n\nclass StockTradingEnv(gym.Env):\n\n def __init__(self, config, initial_account=1e6,\n gamma=0.99, turbulence_thresh=30, min_stock_rate=0.1,\n max_stock=1e2, initial_capital=1e6, buy_cost_pct=1e-3, \n ...
[ [ "numpy.hstack", "numpy.isnan", "numpy.zeros_like", "numpy.exp", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.where", "numpy.random.randint" ] ]
akhilpm/SemiWSOD
[ "c7b2e343ededb44f54f7081378e59b30a1903705", "c7b2e343ededb44f54f7081378e59b30a1903705", "c7b2e343ededb44f54f7081378e59b30a1903705" ]
[ "lib/model/vgg16.py", "lib/dataset/voc/voc_eval.py", "lib/utils/bbox_transform.py" ]
[ "import torchvision\nimport torch\nimport torch.nn as nn\nfrom lib.model.faster_rcnn import FasterRCNN\n\nclass VGG16(FasterRCNN):\n def __init__(self, num_classes, class_agnostic, pretrained=False, model_path=None):\n FasterRCNN.__init__(self, num_classes, class_agnostic, 512)\n self.pretrained = ...
[ [ "torch.nn.Linear", "torch.load", "torch.zeros" ], [ "numpy.maximum", "numpy.minimum", "numpy.arange", "numpy.cumsum", "numpy.sort", "numpy.finfo", "numpy.concatenate", "numpy.max", "numpy.argmax", "numpy.where", "numpy.argsort", "numpy.array", "n...
Novermars/chaospy
[ "800f26203c21ee69c61bdba6a53f6cbede653167" ]
[ "chaospy/distributions/baseclass/distribution.py" ]
[ "\"\"\"Abstract baseclass for all distributions.\"\"\"\nimport logging\nimport numpy\n\nimport chaospy\n\nfrom .utils import check_dependencies\n\n\nclass Distribution(object):\n \"\"\"Baseclass for all probability distributions.\"\"\"\n\n __array_priority__ = 9000\n \"\"\"Numpy override variable.\"\"\"\n\...
[ [ "numpy.sum", "numpy.clip", "numpy.asarray", "numpy.atleast_1d", "numpy.all", "numpy.asfarray", "numpy.round", "numpy.any", "numpy.prod", "numpy.array", "numpy.zeros", "numpy.where" ] ]
prabhatnagarajan/rl_lib
[ "43fecc6ceb3b9299f6a55804e736a0a2b3247e9a" ]
[ "nn/nnexample.py" ]
[ "import numpy as np\nfrom neuron import *\nimport activation\nimport feedforward\n\nif __name__ == '__main__':\n\tweights = np.array([1, 2, 3, 4, 4])\n\tbias = 1.0\n\tneuron = Neuron(weights, bias)\n\toutput = neuron.apply(np.array([0,0,0,0,0.2]))\n\tprint(output)" ]
[ [ "numpy.array" ] ]
gandresr/PTSNET
[ "396d05556f9232c4a840d170943cff8108515f45" ]
[ "ptsnet/parallel/worker.py" ]
[ "import numpy as np\n\nfrom collections import defaultdict as ddict\nfrom ptsnet.arrays import Table2D, Table, ObjArray\nfrom ptsnet.parallel.partitioning import even, get_partition\nfrom ptsnet.simulation.constants import MEM_POOL_POINTS, PIPE_START_RESULTS, PIPE_END_RESULTS, NODE_RESULTS, CLOSED_PROTECTION_RESULT...
[ [ "numpy.isin", "numpy.sqrt", "numpy.unique", "numpy.arange", "numpy.cumsum", "numpy.sort", "numpy.ones", "numpy.concatenate", "numpy.append", "numpy.diff", "numpy.any", "numpy.array", "numpy.zeros", "numpy.where", "numpy.empty" ] ]
petrokvitka/TOBIAS
[ "a7a2b4547528e6c5eaee26a33e21a9a165c53e88" ]
[ "tobias/footprinting/bindetect_functions.py" ]
[ "#!/usr/bin/env python\r\n\r\n\"\"\"\r\nBINDetect_functions: Functions to be called from main BINDetect script\r\n\r\n@author: Mette Bentsen\r\n@contact: mette.bentsen (at) mpi-bn.mpg.de\r\n@license: MIT\r\n\r\n\"\"\"\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport scipy\r\nfrom datetime import datetime\...
[ [ "matplotlib.pyplot.legend", "numpy.linspace", "numpy.nan_to_num", "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.round", "numpy.mean", "pandas.ExcelWriter", "numpy.exp", "scipy.optimize.curve_fit", "numpy.where", "matplotlib.backends.backend_pdf.PdfPages", ...
gahdritz/t5x
[ "f8efd6b5a7a215a04c7c44c32d42e2203652fec1" ]
[ "t5x/examples/scalable_t5/layers.py" ]
[ "# Copyright 2022 The T5X Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or ag...
[ [ "numpy.log", "numpy.maximum", "numpy.abs", "numpy.minimum", "numpy.arange", "numpy.finfo", "numpy.prod", "numpy.where" ] ]
Petersontylerd/mlmachine
[ "1d9d0a7fe3953ff06b40302c0820bcd922eed63d" ]
[ "mlmachine/model/evaluate/summarize.py" ]
[ "import numpy as np\nimport pandas as pd\n\nimport os\n\nfrom sklearn.metrics import (\n precision_score,\n recall_score,\n f1_score,\n explained_variance_score,\n mean_squared_log_error,\n mean_absolute_error,\n median_absolute_error,\n mean_squared_error,\n r2_score,\n confusion_matr...
[ [ "sklearn.metrics.explained_variance_score", "pandas.concat", "sklearn.metrics.r2_score", "numpy.abs", "sklearn.metrics.median_absolute_error", "sklearn.metrics.mean_absolute_error", "pandas.DataFrame", "sklearn.metrics.mean_squared_error", "sklearn.model_selection.KFold", "...
dspmandavid/urh
[ "30643c1a68634b1c97eb9989485a4e96a3b038ae", "30643c1a68634b1c97eb9989485a4e96a3b038ae" ]
[ "src/urh/signalprocessing/ProtocolAnalyzer.py", "src/urh/dev/native/RTLSDRTCP.py" ]
[ "import copy\nimport xml.etree.ElementTree as ET\nfrom xml.dom import minidom\nfrom collections import defaultdict\n\nimport numpy as np\nfrom PyQt5.QtCore import QObject, pyqtSignal, Qt\n\nfrom urh import constants\nfrom urh.awre.FormatFinder import FormatFinder\nfrom urh.cythonext import signalFunctions\nfrom urh...
[ [ "numpy.array", "numpy.mean", "numpy.abs" ], [ "numpy.frombuffer", "numpy.empty" ] ]
ningyixue/AIPI530_Final_Project
[ "b95353ffd003692a37a59042dfcd744a18b7e802", "b95353ffd003692a37a59042dfcd744a18b7e802" ]
[ "tests/online/test_buffers.py", "examples/pybullet/train_sac.py" ]
[ "import gym\nimport numpy as np\nimport pytest\n\nfrom d3rlpy.dataset import Episode, TransitionMiniBatch\nfrom d3rlpy.envs import SyncBatchEnv\nfrom d3rlpy.online.buffers import BatchReplayBuffer, ReplayBuffer\n\n\n@pytest.mark.parametrize(\"n_episodes\", [10])\n@pytest.mark.parametrize(\"batch_size\", [32])\n@pyt...
[ [ "numpy.random.random", "numpy.zeros", "numpy.random.randint" ], [ "sklearn.model_selection.train_test_split" ] ]
jd-jones/kinemparse
[ "279a9989981aa2a0eef1e46e5d02833f51ae352d", "279a9989981aa2a0eef1e46e5d02833f51ae352d" ]
[ "scripts/restructure_output_decode_keyframes.py", "scripts/eval_preds.py" ]
[ "import argparse\nimport os\nimport inspect\n\nimport yaml\nimport joblib\nimport numpy as np\nimport scipy\n\nfrom mathtools import utils\n\n\ndef main(out_dir=None, data_dir=None, detections_dir=None, modality=None, normalization=None):\n data_dir = os.path.expanduser(data_dir)\n out_dir = os.path.expanduse...
[ [ "numpy.log", "scipy.special.logsumexp" ], [ "matplotlib.pyplot.tight_layout", "pandas.read_csv", "numpy.unique", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "numpy.row_stack", "matplotlib.pyplot.close", "numpy.array", "matplotlib.pyplot.show", "nu...
DmitryPoliuha/images-comparing
[ "63b94f5f5af18a95d5f790ae8cfa9b8cef14c8ec" ]
[ "structures/images_structures.py" ]
[ "import numpy as np\nfrom PIL import Image, ImageFilter\n\nimport sift\n\n\nclass ImageWrapper:\n \"\"\"\n Wrapper for the image to keep image obj and image name\n \"\"\"\n\n def __init__(self, image_path, image_name):\n self.name = image_name\n self.path = image_path\n self.image =...
[ [ "numpy.array" ] ]
dashstander/CLD-SGM
[ "87d77220aab848db280852c2df786307d95cc598" ]
[ "util/toy_data.py" ]
[ "# ---------------------------------------------------------------\n# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.\n#\n# This work is licensed under the NVIDIA Source Code License for\n# CLD-SGM. To view a copy of this license, see the LICENSE file.\n# -----------------------------------------------...
[ [ "numpy.sqrt", "numpy.linspace", "numpy.eye", "numpy.concatenate", "numpy.random.multinomial", "numpy.random.permutation", "numpy.random.randn", "numpy.array" ] ]
chenwenxiao/DOI
[ "14bdedd0b1b886efe77737cfb62695f03ee17c58", "14bdedd0b1b886efe77737cfb62695f03ee17c58" ]
[ "ood_regularizer/experiment/datasets/omniglot.py", "ood_regularizer/experiment/models/ensemble/glow.py" ]
[ "import hashlib\n\nimport numpy as np\nimport tfsnippet as spt\nfrom scipy.io import loadmat\n\nfrom .base import StandardImageDataSet, registry\n\n__all__ = ['load_omniglot', 'OmniglotDataSet']\n\nDATASET_URI = 'https://raw.githubusercontent.com/yburda/iwae/master/datasets/' \\\n 'OMNIGLOT/chardata.ma...
[ [ "numpy.asarray", "scipy.io.loadmat", "numpy.prod" ], [ "numpy.log", "numpy.stack", "torch.no_grad", "numpy.mean", "numpy.var" ] ]
michaelwalshe/scrape_london_marathon
[ "174bf88d67ee7cd9c12a633b8ba5aa123c1d092f" ]
[ "src/london_plotter.py" ]
[ "import sys\n\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport statsmodels.formula.api as smf\n\n# import statsmodels.api as sm\n\nfrom sklearn import preprocessing\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.linear_model import LinearR...
[ [ "pandas.read_csv", "sklearn.metrics.mean_absolute_error", "sklearn.preprocessing.OneHotEncoder", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.savefig", "pandas.DataFrame", "sklearn.metrics.mean_squared_error", "sklearn.linear_model.LinearRegression", "pandas.t...
awesomehong/Lecture
[ "1ed14ae644e2cddd8d48b42c1ca6aacdb8c18eee" ]
[ "Python/logit-example.py" ]
[ "import pandas as pd \nfrom sklearn.metrics import confusion_matrix\nimport sklearn.linear_model as lm \n\nclf = lm.LogisticRegression(C=10.0)\n\ngrades = pd.read_table(\"grades.csv\")\nlabels = ('F', 'D', 'C', 'B', 'A')\ngrades[\"Letter\"] = pd.cut(grades[\"Final score\"], [0, 60, 70, 80, 90, 100], labels=labels)\...
[ [ "pandas.read_table", "sklearn.linear_model.LogisticRegression", "pandas.DataFrame", "pandas.cut" ] ]
chaosWsF/AI-Chinese-A-shares
[ "67612c5a8479b6972e043922f68056a1ee805040" ]
[ "TechLSTM/dataTransform.py" ]
[ "import numpy as np\nfrom sklearn.preprocessing import scale, OneHotEncoder\nimport pandas as pd\n\n\ndef get_lstm_data(dat, fea, label, step, method):\n \n fea_data = dat[fea].values\n tar_data = dat[label].values\n \n fea_data = scale(fea_data)\n \n if len(tar_data.shape) == 1:\n tar_d...
[ [ "pandas.read_csv", "numpy.unique", "sklearn.preprocessing.OneHotEncoder", "sklearn.preprocessing.scale", "numpy.array" ] ]
sergioluengosanchez/TSEM
[ "f6600d046a34266ec815384790659b4e33db325c" ]
[ "setup_et.py" ]
[ "from distutils.core import setup\nfrom Cython.Build import cythonize\nimport numpy\n\nsetup(\n name=\"elimination_tree\",\n ext_modules=cythonize(\"elimination_tree.pyx\"),\n include_dirs=[numpy.get_include()]\n)" ]
[ [ "numpy.get_include" ] ]
ChinHoooooo/Physionet2019
[ "e17ef66c6c0c8e0703b5e9676371bbec629b6388" ]
[ "get_sepsis_score.py" ]
[ "#!/usr/bin/env python\n\nimport numpy as np\nfrom sklearn.externals import joblib\nfrom lightgbm import LGBMClassifier\nimport pandas as pd\nimport warnings\nwarnings.filterwarnings('ignore')\n\ndef get_sepsis_score(data, model):\n num_new_features=28\n values=data\n current_patient=pd.DataFrame(values)\n...
[ [ "numpy.nanmax", "numpy.hstack", "sklearn.externals.joblib.load", "numpy.reshape", "numpy.nanmin", "pandas.DataFrame", "numpy.full", "numpy.array" ] ]
Ethan-Chew/toobox
[ "7f774a0eac12c9e6ceeb078474fdab6205247c29" ]
[ "tools/sim_eqn.py" ]
[ "#by Jerick\nimport numpy as np\ndef solve_sim(*args):\n ''''\n args are the amount of equations, each of the equations are a list of numbers representing each variable\n e.g [10,4,9],[9,3,4] to represent 10x+4y=0, 9x+3y=4\n\n '''\n answermatrix=np.matrix([[i[-1]] for i in args],dtype=float)\n try...
[ [ "numpy.matrix", "numpy.dot" ] ]
yongchaoding/DaSiamRPN
[ "97d0d84fe870aea8a4fbf53d890deed10d16937e" ]
[ "code/net.py" ]
[ "# --------------------------------------------------------\n# DaSiamRPN\n# Licensed under The MIT License\n# Written by Qiang Wang (wangqiang2015 at ia.ac.cn)\n# --------------------------------------------------------\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nclass SiamRPN(nn.Module):\n def ...
[ [ "torch.nn.MaxPool2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.BatchNorm2d" ] ]
xishaoheng/Tacotron2-PyTorch
[ "2fbb83983529604441c44d43d9d87604465b97c6" ]
[ "train.py" ]
[ "import os\nos.environ[\"CUDA_VISIBLE_DEVICES\"] = ','.join(map(str, [3]))\nimport time\nimport torch\nimport argparse\nimport numpy as np\nfrom inference import infer\nfrom utils.util import mode\nfrom hparams import hparams as hps\nfrom torch.utils.data import DataLoader\nfrom utils.logger import Tacotron2Logger\...
[ [ "torch.optim.lr_scheduler.LambdaLR", "torch.cuda.manual_seed", "numpy.random.seed", "torch.load", "torch.manual_seed", "torch.utils.data.DataLoader" ] ]
gaborvecsei/Ridurre-Network-Filter-Pruning-Keras
[ "e1abd923239222dbf56902e9b6a945896e920ce0" ]
[ "ridurre/base_filter_pruning.py" ]
[ "import abc\nimport re\nimport tempfile\nimport traceback\nfrom typing import Tuple, Callable, Union, List, Optional\n\nimport kerassurgeon\nimport numpy as np\nimport tensorflow as tf\nfrom keras import backend as K\nfrom keras import models, layers\n\n\nclass BasePruning:\n _FUZZ_EPSILON = 1e-5\n\n def __in...
[ [ "numpy.asarray", "numpy.ceil", "tensorflow.reset_default_graph", "numpy.random.shuffle" ] ]
DA-southampton/PyTorch_Bert_Text_Classification
[ "6ad4fc5f1ef502df762bb5cba0cdfc1cca7ec550" ]
[ "DataUtils/Batch_Iterator.py" ]
[ "# @Author : bamtercelboo\n# @Datetime : 2018/1/30 15:55\n# @File : Batch_Iterator.py.py\n# @Last Modify Time : 2018/1/30 15:55\n# @Contact : bamtercelboo@{gmail.com, 163.com}\n\n\"\"\"\n FILE : Batch_Iterator.py\n FUNCTION : None\n\"\"\"\n\nimport torch\nfrom torch.autograd import Variable\nimport random\ni...
[ [ "torch.manual_seed", "numpy.array", "numpy.zeros", "torch.from_numpy" ] ]
lanl/stitch
[ "c62267c9e50d206d1edadc0e653af1b8b9a7ffc5" ]
[ "spotlight/sampling.py" ]
[ "\"\"\" This module contains functions that return a new, single point in a given\nparameter space. In general, these functions are not used to return\nmulti-dimensional arrays. These functions are intended to be called only a\nfew times.\n\"\"\"\n\nimport numpy\nfrom mystic import math\n\ndef uniform(lower_bounds,...
[ [ "numpy.random.uniform", "numpy.zeros" ] ]
kuroko1789/PyRep
[ "effa061e276f8f1a4f939550fd4f7cd728cc5e33" ]
[ "pyrep/objects/object.py" ]
[ "from pyrep.backend import vrep\nfrom pyrep.errors import *\nfrom pyrep.const import ObjectType\nfrom pyrep.errors import WrongObjectTypeError\nfrom typing import List, Tuple, Union\nimport numpy as np\n\n\nclass Object(object):\n \"\"\"Base class for V-REP scene objects that are used for building a scene.\n\n ...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
st3107/pdffitx
[ "c746f6dfaf5656e9bb62508a9847c00567b34bbe" ]
[ "pdffitx/tests/modeling/test_running.py" ]
[ "import pytest\nfrom matplotlib import pyplot as plt\n\nfrom pdffitx.modeling import F, multi_phase, optimize, fit_calib, MyParser\n\n\n@pytest.mark.parametrize(\n \"data_key,kwargs,free_params,use_cf,expected\",\n [\n (\n \"Ni_stru\",\n {\n 'values': {'scale_G0': 0...
[ [ "matplotlib.pyplot.clf" ] ]
itsnamgyu/fast-reid
[ "765e76dc2f0d2471ac91dc3b36e30cf5833cf728" ]
[ "fastreid/layers/pooling.py" ]
[ "# encoding: utf-8\n\"\"\"\n@author: l1aoxingyu\n@contact: sherlockliao01@gmail.com\n\"\"\"\n\nimport torch\nimport torch.nn.functional as F\nfrom torch import nn\n\n__all__ = [\n 'Identity',\n 'Flatten',\n 'GlobalAvgPool',\n 'GlobalMaxPool',\n 'GeneralizedMeanPooling',\n 'GeneralizedMeanPoolingP...
[ [ "torch.clamp", "torch.ones", "torch.nn.functional.adaptive_avg_pool2d" ] ]
myliheik/cropyieldMosaics
[ "111ab0993e31f9bf055a670b8cbe0fb505f310e4" ]
[ "python/runClassifier3D.py" ]
[ "\"\"\"\n2020-10-09 MY\n\npython runClassifier3D.py -i /Users/myliheik/Documents/myCROPYIELD/cropyieldMosaics/results/train1120 -n \n\n\n\"\"\"\nimport pandas as pd\nimport numpy as np\nimport pickle\nimport os.path\nfrom pathlib import Path\nimport argparse\nimport textwrap\nimport math\nfrom tensorflow.keras.mode...
[ [ "tensorflow.keras.layers.Dense", "pandas.DataFrame", "tensorflow.keras.layers.LSTM", "tensorflow.keras.layers.Dropout", "tensorflow.keras.callbacks.EarlyStopping", "tensorflow.keras.models.Sequential" ] ]
tonysy/mx-rcnn-flow
[ "b78c3c964c802bb874d673170d7452e7a573a998" ]
[ "rcnn_dff/io/rcnn.py" ]
[ "\"\"\"\nFast R-CNN:\ndata =\n {'data': [num_images, c, h, w],\n 'rois': [num_rois, 5]}\nlabel =\n {'label': [num_rois],\n 'bbox_target': [num_rois, 4 * num_classes],\n 'bbox_weight': [num_rois, 4 * num_classes]}\nroidb extended format [image_index]\n ['image', 'height', 'width', 'flipped',\n ...
[ [ "numpy.hstack", "numpy.minimum", "numpy.random.choice", "numpy.arange", "numpy.ones", "numpy.round", "numpy.append", "numpy.array", "numpy.where" ] ]
RoboticsClubatUCF/RoboSub
[ "47304c620f963a8762db57a7ed248d1df90190fb" ]
[ "ucf_sub_catkin_ros/src/sub_trajectory/src/vector_thrust_control.py" ]
[ "#! /usr/bin/env python\nimport rospy\n\nfrom sub_trajectory.msg import ThrusterStatus, ThrusterCmd\nfrom geometry_msgs.msg import WrenchStamped\n\nimport numpy as np\nimport math, time\nfrom scipy.optimize import minimize\n\nfrom dynamic_reconfigure.server import Server\nfrom sub_trajectory.cfg import VectorConfig...
[ [ "numpy.hstack", "numpy.linalg.norm", "numpy.linalg.pinv", "numpy.cross", "numpy.array", "numpy.zeros" ] ]
skmatz/pytorch-lightning
[ "fc6d4027334b8869f02a3bdca0a0846f1cf79928", "fc6d4027334b8869f02a3bdca0a0846f1cf79928" ]
[ "pytorch_lightning/trainer/trainer.py", "pl_examples/basic_examples/conv_sequential_example.py" ]
[ "# Copyright The PyTorch Lightning team.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law...
[ [ "torch.set_grad_enabled" ], [ "torch.nn.Dropout", "torch.nn.Dropout2d", "torch.nn.functional.nll_loss", "torch.nn.functional.log_softmax", "torch.randn", "torch.nn.Conv2d", "torch.nn.MaxPool2d", "torch.nn.Linear", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch....
lkz12/Applied-Data-Science-with-Python
[ "cbfdf253f7bcde7d9fd8c7343ae1f120824478f5" ]
[ "Plotting/Week3.py" ]
[ "\n# coding: utf-8\n\n# # Subplots\n\n# In[1]:\n\nget_ipython().magic('matplotlib notebook')\n\nimport matplotlib.pyplot as plt\nimport numpy as np\n\nget_ipython().magic('pinfo plt.subplot')\n\n\n# In[2]:\n\nplt.figure()\n# subplot with 1 row, 2 columns, and current axis is 1st subplot axes\nplt.subplot(1, 2, 1)\n...
[ [ "pandas.DataFrame", "matplotlib.pyplot.plot", "numpy.random.randn", "matplotlib.pyplot.gca", "numpy.arange", "matplotlib.pyplot.gcf", "matplotlib.pyplot.subplot", "matplotlib.gridspec.GridSpec", "matplotlib.pyplot.axis", "matplotlib.pyplot.figure", "matplotlib.pyplot.hi...
wenhuchen/Hierarchical-DSA
[ "2dbdacde25ee82c9d42fe980694673d285b1f7f3" ]
[ "data_utils.py" ]
[ "#coding: utf-8\nimport os\nimport tarfile\nimport re\nfrom nltk.tokenize import word_tokenize\nimport collections\nimport pandas as pd\nimport pickle\nimport numpy as np\nimport math\nfrom sklearn import metrics\nfrom scipy.interpolate import interp1d\n\ntriple_names = [\"class\", \"title\", \"content\"]\ntwin_nam...
[ [ "sklearn.metrics.auc", "numpy.array", "scipy.interpolate.interp1d" ] ]
Pandinosaurus/imucal
[ "4253a7ba2c3df4da78c47c79079d0fc25d1e4ad9" ]
[ "imucal/calibration_info.py" ]
[ "\"\"\"Base Class for all CalibrationInfo objects.\"\"\"\nimport json\nfrom dataclasses import dataclass, fields, asdict\nfrom distutils.version import StrictVersion\nfrom pathlib import Path\nfrom typing import Tuple, Union, TypeVar, ClassVar, Optional, Type, Iterable\n\nimport numpy as np\nimport pandas as pd\n\n...
[ [ "numpy.array", "numpy.array_equal" ] ]
ebartrum/PointFlow
[ "7022e47c3b57de8afd956f9b547bfef0da089359" ]
[ "train.py" ]
[ "import sys\r\nimport os\r\nimport torch\r\nimport torch.distributed as dist\r\nimport torch.nn as nn\r\nimport warnings\r\nimport torch.distributed\r\nimport numpy as np\r\nimport random\r\nimport faulthandler\r\nimport torch.multiprocessing as mp\r\nimport time\r\nimport imageio\r\nfrom models.networks import Poi...
[ [ "torch.optim.lr_scheduler.LambdaLR", "torch.distributed.init_process_group", "torch.utils.data.distributed.DistributedSampler", "torch.multiprocessing.spawn", "torch.cuda.set_device", "torch.utils.data.DataLoader", "torch.optim.lr_scheduler.ExponentialLR", "numpy.concatenate", ...
ikegami-yukino/oll-python
[ "21b4a9f69a31fe7d9c72472b9bd660ab3a95938b" ]
[ "test_oll.py" ]
[ "# -*- coding: utf-8 -*-\nimport os\nimport tempfile\nfrom nose.tools import ok_, eq_, assert_raises, assert_almost_equals\nimport numpy as np\nfrom scipy.sparse import csr_matrix\nimport oll\n\n\nclass Test_oll(object):\n\n def __init__(self):\n self.oll = oll.oll('PA1')\n\n def test__init__(self):\n ...
[ [ "numpy.array", "scipy.sparse.csr_matrix" ] ]