repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
bryant1410/Emotion-FAN
[ "8a4ea4f0eacced38e8f4c50ad37515e84c781ab8" ]
[ "Code/util.py" ]
[ "import os\nimport torch\n\ndef accuracy(output, target, topk=(1,)):\n \"\"\"Computes the precision@k for the specified values of k\"\"\"\n maxk = max(topk)\n batch_size = target.size(0)\n _, pred = output.topk(maxk, 1, True, True) # first position is score; second position is pred.\n pred = pred.t(...
[ [ "torch.save" ] ]
KanazawaAIMeetup/TradePython
[ "b6fc93a42a2d85078167a9a5bf712a11f24391ca", "b6fc93a42a2d85078167a9a5bf712a11f24391ca" ]
[ "TrainExample/PredictPrice/SimplePricePrediction/main_price_prediction.py", "ColaboratoryCode/trade_class.py" ]
[ "#coding: utf-8\n'''\nMITライセンス このプログラムについては、改変・再配布可能です\n著作者: Tomohiro Ueno (kanazawaaimeetup@gmail.com)\n\nUsage: ddqn-multiple-inputディレクトリから実行する。\npython main_price_prediction.py\n\n注意:評価する場合は、正解データのリークが起きないようにする。Train,Validation,Testの分割方法に気をつける\nこのプログラムは、リークを厳密に回避していません!\n実行を早くするため、test_term=120000 epochs=1 となってい...
[ [ "sklearn.utils.shuffle", "numpy.set_printoptions", "numpy.std", "numpy.float64", "sklearn.preprocessing.StandardScaler", "numpy.array" ], [ "matplotlib.pyplot.scatter", "matplotlib.pyplot.savefig", "numpy.float64", "matplotlib.pyplot.grid", "numpy.array", "matpl...
qdmy/detectron2
[ "0a74634d804f64409770bab082b6501f2ac57641", "0a74634d804f64409770bab082b6501f2ac57641" ]
[ "detectron2/data/samplers/distributed_sampler.py", "codebase/third_party/spos_ofa/ofa/imagenet_classification/elastic_nn/modules/dynamic_single_path_layers.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\nimport itertools\nimport math\nfrom collections import defaultdict\nfrom typing import Optional\nimport torch\nfrom torch.utils.data.sampler import Sampler\n\nfrom detectron2.utils import comm\n\n\nclass TrainingSampler(Sampler):\n \"\"\"\n In training, we ...
[ [ "torch.Generator", "torch.randperm", "torch.trunc", "torch.tensor", "torch.arange" ], [ "torch.abs", "torch.mean", "torch.ones", "torch.cat", "torch.zeros", "torch.nn.functional.conv2d", "torch.eye", "torch.FloatTensor", "torch.sort", "torch.split", ...
yushan111/analytics-zoo
[ "cf63e52e1dc2969a10fce56740a1fecb510a46d2", "cf63e52e1dc2969a10fce56740a1fecb510a46d2" ]
[ "pyzoo/zoo/xshard/pandas/preprocessing.py", "pyzoo/zoo/tfpark/tf_optimizer.py" ]
[ "#\n# Copyright 2018 Analytics Zoo 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 ...
[ [ "pandas.concat", "pandas.read_csv", "pandas.read_json" ], [ "tensorflow.shape", "tensorflow.get_collection", "tensorflow.keras.backend.get_session", "tensorflow.keras.backend.learning_phase", "tensorflow.keras.backend.gradients", "tensorflow.assign", "tensorflow.placeho...
YanivAvrahami/AI_is_Math
[ "d34add0b5ec5f7efeefe856d67f3ff502a6a4b01" ]
[ "c_02b_filtering_and_resampling/fft.py" ]
[ "# %%\nimport matplotlib.pyplot as plt\nimport numpy as np\nimport warnings\n\ndef fftPlot(sig, dt=None, block=False, plot=True):\n # here it's assumes analytic signal (real signal...)- so only half of the axis is required\n\n if dt is None:\n dt = 1\n t = np.arange(0, sig.shape[-1])\n xL...
[ [ "numpy.abs", "numpy.fft.fft", "matplotlib.pyplot.title", "numpy.arange", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.ylabel", "numpy.argmax", "numpy.fft.fftfreq", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
ICME2022/R-S-R
[ "0e938082a0ea381cff7f0348deb65826848c43e4", "0e938082a0ea381cff7f0348deb65826848c43e4" ]
[ "selfsupervision/MirrorSSB/JXWithChannel.py", "ops/tdn_net.py" ]
[ "import torch\nimport random\n\n\ndef create5Dimages(images):\n # images : 4D tensor with shape [BT,C,H,W]\n T = 16\n B = images.size(0) // T\n C = images.size(1)\n H = images.size(2)\n W = images.size(3)\n image = torch.tensor([]).cuda()\n for b in range(B):\n bimage = images[b * T:(...
[ [ "torch.tensor", "torch.Tensor", "torch.cat" ], [ "torch.cat", "torch.nn.Conv2d", "torch.nn.Linear", "torch.nn.MaxPool2d", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
ahhuhtal/scikit-fem
[ "84ad97bfd2a92d28694f54f6897d97966bda31df", "84ad97bfd2a92d28694f54f6897d97966bda31df" ]
[ "docs/examples/ex05.py", "tests/test_assembly.py" ]
[ "r\"\"\"Integral condition.\n\nThis short example demonstrates the implementation of an integral boundary\n condition\n\n.. math::\n \n \\int_\\Gamma \\nabla u \\cdot \\boldsymbol{n} \\, \\mathrm{d}s = 1\n\non a part of the boundary of the domain :math:`\\Gamma \\subset \\partial \\Omega`\n for the Laplace oper...
[ [ "numpy.append", "numpy.zeros", "numpy.ones" ], [ "numpy.dot", "numpy.sum", "numpy.sin", "numpy.ones" ] ]
dwervin/pyhampel
[ "84c3617d5f6f7ee518b45d7bd4856235d7b87617" ]
[ "pyhampel/src/HampelFiltering.py" ]
[ "import numpy as np\nimport pandas as pd\n\n\ndef hampel_filter_df(df: pd.DataFrame, vals_col: str, time_col=None, win_size=30, num_dev=3, center_win=True) -> pd.DataFrame:\n \"\"\"\n This function takes in dataframe containing time series of values, applies Hampel filter on\n these values, and returns dat...
[ [ "pandas.concat", "pandas.to_datetime", "numpy.abs", "numpy.issubdtype", "numpy.median" ] ]
BlackHC/uncertainty-baselines
[ "1a28be3e41e14d8ab74dfa1e3eed15f113718f03", "1a28be3e41e14d8ab74dfa1e3eed15f113718f03", "1a28be3e41e14d8ab74dfa1e3eed15f113718f03" ]
[ "baselines/jft/deterministic.py", "baselines/jft/begp.py", "experimental/language_structure/vrnn/utils.py" ]
[ "# coding=utf-8\n# Copyright 2022 The Uncertainty Baselines 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# Unles...
[ [ "tensorflow.random.set_seed", "tensorflow.io.gfile.makedirs", "numpy.ceil", "numpy.max", "numpy.argmax", "numpy.array", "tensorflow.keras.metrics.Mean" ], [ "tensorflow.random.set_seed", "tensorflow.io.gfile.makedirs", "numpy.ceil", "numpy.max", "numpy.argmax", ...
YueYANG1996/merlot_reserve
[ "76bc38d4b97e447200b4d6b097c6b68d5235c1e6" ]
[ "finetune/tvqa/submit_to_leaderboard.py" ]
[ "\"\"\"\nSubmit an existing TVQA model on the leaderboard\n\nipython -i submit_to_leaderboard.py -- ../../pretrain/configs/base.yaml ${ckpt}\nipython -i submit_to_leaderboard.py -- ../../pretrain/configs/large.yaml ${ckpt}\n\"\"\"\n\nimport sys\n\nsys.path.append('../../')\nimport yaml\nfrom datetime import datetim...
[ [ "numpy.random.seed" ] ]
gao-lab/Cell_BLAST
[ "45b14bbd3385b8a7be0b48ef5ab42bc946f3558f" ]
[ "Notebooks/Case/HSC/prep_spring.py" ]
[ "#!/usr/bin/env python\n# Run with SPRING environment\n\nimport sys\nimport argparse\nimport numpy as np\nimport scipy.sparse\n\nsys.path.append(\"./SPRING\")\nimport preprocessing_python\n\n\nparser = argparse.ArgumentParser()\nparser.add_argument(\"-e\", dest=\"expr\", type=str, required=True)\nparser.add_argumen...
[ [ "numpy.load" ] ]
didrif/megatrond
[ "b6e680f1c78f20132c14b09abbf676e5354c7e14" ]
[ "megatrond_perception/scripts/Aruco2navgoal.py" ]
[ "#! /usr/bin/python\n\nimport numpy as np\nimport rospy\nimport roslib\nfrom std_msgs.msg import String, Int32, Float32, Float64\nfrom fiducial_msgs.msg import FiducialTransform, FiducialTransformArray, FiducialArray\nfrom geometry_msgs.msg import Transform, Quaternion, Vector3\nfrom nav_msgs.msg import Odometry\ni...
[ [ "numpy.array", "numpy.linalg.norm" ] ]
lucasb-eyer/DeepFried
[ "b1a8c8c9c39748a2c5505025b54bb279c9208b2c" ]
[ "optim.py" ]
[ "#!/usr/bin/env python3\n\nimport DeepFried.util as _u\n\nimport numpy as _np\nimport theano as _th\nimport theano.tensor as _T\n\n\nclass StreaMiniOptimizer(object):\n \"\"\"\n This is an optimizer that works through minibatches of the dataset, each\n minibatch being uploaded onto the GPU each time.\n\n ...
[ [ "numpy.random.RandomState" ] ]
ishine/DeepPhonemizer
[ "b8f170764c7648fe2acb552b787099ab4f941e58" ]
[ "dp/training/trainer.py" ]
[ "import math\nfrom collections import Counter\nfrom pathlib import Path\nfrom typing import List, Dict, Any, Tuple\n\nimport torch\nimport tqdm\nfrom torch.optim import Adam\nfrom torch.optim.lr_scheduler import ReduceLROnPlateau\nfrom torch.utils.tensorboard import SummaryWriter\n\nfrom dp.model.model import Model...
[ [ "torch.optim.lr_scheduler.ReduceLROnPlateau", "torch.isinf", "torch.isnan", "torch.no_grad", "torch.cuda.is_available", "torch.device" ] ]
rvegaml/DA_Linear
[ "e22694b743b5bfb322ec1ee34090df636e526973" ]
[ "MLib/Models/KerasModels.py" ]
[ "import numpy as np\nimport tensorflow as tf\nfrom MLib.Core.layers import LinearLayer, ConvLayer\nfrom tensorflow.keras.layers import MaxPooling2D, Flatten\nfrom tensorflow.keras import Model\n\nclass SimpleCNNModel(Model):\n\tdef __init__(self, num_units):\n\n\t\tsuper(SimpleCNNModel, self).__init__()\n\n\t\t# De...
[ [ "tensorflow.nn.relu", "tensorflow.nn.softmax", "tensorflow.keras.layers.MaxPooling2D", "tensorflow.keras.layers.Flatten" ] ]
VickyChing/ICASSP19
[ "15b756692cca80e7b16cdbdf28d40f43db2c03b6", "15b756692cca80e7b16cdbdf28d40f43db2c03b6" ]
[ "run.py", "models/ofos.py" ]
[ "import torch\n\nimport argparse\nimport shutil\nimport os\nimport re\n\nimport importlib\nimport numpy as np\n\n\ndef run_config(args, config):\n run_path = 'runs/{}'.format(config['run_id'])\n\n # fail early, if we should train, and dir exists #######################################\n if args.train:\n ...
[ [ "numpy.array_split" ], [ "torch.sigmoid", "numpy.log", "numpy.sqrt", "numpy.clip", "torch.nn.ELU", "torch.nn.Conv2d", "numpy.stack", "torch.cuda.FloatTensor", "torch.nn.Linear", "torch.nn.BCEWithLogitsLoss", "sklearn.metrics.precision_recall_fscore_support", ...
Hetti219/Python-Projects
[ "cf483836496d329ea056928b719e485cbab303a8" ]
[ "W3Schools Online Lessons/ML/Scatter Plot.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy\n\nx = [5, 7, 8, 7, 2, 17, 2, 9, 4, 11, 12, 9, 6]\n\ny = [99, 86, 87, 88, 111, 86, 103, 87, 94, 78, 77, 85, 86]\n\nplt.scatter(x, y)\n\nplt.show()\n\n# Random Data Distributions\n\np = numpy.random.normal(9.2, 8.2, 832176)\nq = numpy.random.normal(8.7, 1.2, 982537)\n\n...
[ [ "numpy.random.normal", "matplotlib.pyplot.show", "matplotlib.pyplot.scatter" ] ]
BeauvoirR/Real-Time-Voice-Cloning
[ "2e29e2e09ad4696c836a7872a58f581fda04c649", "2e29e2e09ad4696c836a7872a58f581fda04c649" ]
[ "encoder/audio.py", "encoder/model.py" ]
[ "from encoder import sampling_rate, mel_window_length, mel_window_step, mel_n_channels\nfrom scipy.ndimage.morphology import binary_dilation\n#from encoder.params_data import *\nfrom pathlib import Path\nfrom typing import Optional, Union\nfrom warnings import warn\nimport numpy as np\nimport librosa\nimport struct...
[ [ "numpy.cumsum", "numpy.ones", "numpy.round", "numpy.mean", "numpy.repeat", "numpy.array", "numpy.zeros" ], [ "torch.mean", "torch.nn.CrossEntropyLoss", "torch.norm", "torch.nn.LSTM", "torch.zeros", "numpy.arange", "numpy.eye", "torch.sum", "torch...
dpsong/test
[ "7b33b24e1e743a71b95862e95f545d9de2634672" ]
[ "src/lib/extractor/vf_extractor.py" ]
[ "import torch.nn as nn\n\n\nclass VfExtractor(nn.Module):\n\n def __init__(self, in_channels=1):\n super(VfExtractor, self).__init__()\n self.conv1 = nn.Conv2d(in_channels, 120, kernel_size=(3, 3), padding=(1, 1))\n self.relu1 = nn.ReLU(inplace=True)\n self.conv2 = nn.Conv2d(120, 120,...
[ [ "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
jenssss/xarray
[ "43a2a4bdf3a492d89aae9f2c5b0867932ff51cef", "43a2a4bdf3a492d89aae9f2c5b0867932ff51cef" ]
[ "xarray/tests/test_conventions.py", "xarray/tests/test_formatting.py" ]
[ "import contextlib\nimport warnings\n\nimport numpy as np\nimport pandas as pd\nimport pytest\n\nfrom xarray import (\n Dataset,\n SerializationWarning,\n Variable,\n coding,\n conventions,\n open_dataset,\n)\nfrom xarray.backends.common import WritableCFDataStore\nfrom xarray.backends.memory impo...
[ [ "numpy.arange", "numpy.int32", "numpy.dtype", "numpy.ones", "numpy.int64", "numpy.float32", "pandas.date_range", "pandas.to_timedelta", "numpy.array", "numpy.zeros" ], [ "numpy.get_printoptions", "pandas.Timestamp", "numpy.asarray", "numpy.arange", "...
richung99/digitizePlots
[ "74779e9ec640a11bc08d5d1967c85ac4fa44ea5e", "6b408c820660a415a289726e3223e8f558d3e18b", "6b408c820660a415a289726e3223e8f558d3e18b", "6b408c820660a415a289726e3223e8f558d3e18b", "6b408c820660a415a289726e3223e8f558d3e18b", "b7879d75a63b6500b2e7d2c3eba5aa7670339274", "6b408c820660a415a289726e3223e8f558d3e18...
[ "venv/Lib/site-packages/networkx/algorithms/link_analysis/hits_alg.py", "venv/Lib/site-packages/nibabel/nifti1.py", "venv/Lib/site-packages/nibabel/streamlines/tck.py", "venv/Lib/site-packages/nibabel/tests/test_loadsave.py", "venv/Lib/site-packages/nibabel/tests/data/check_parrec_reslice.py", "venv/Lib/s...
[ "\"\"\"Hubs and authorities analysis of graph structure.\n\"\"\"\nimport networkx as nx\n\n__all__ = [\"hits\", \"hits_numpy\", \"hits_scipy\", \"authority_matrix\", \"hub_matrix\"]\n\n\ndef hits(G, max_iter=100, tol=1.0e-8, nstart=None, normalized=True):\n \"\"\"Returns HITS hubs and authorities values for node...
[ [ "numpy.absolute", "numpy.asarray", "numpy.linalg.eig", "numpy.ones", "numpy.array" ], [ "numpy.diag", "numpy.dot", "numpy.asarray", "numpy.ndarray", "numpy.dtype", "numpy.mean", "numpy.any", "numpy.iinfo", "numpy.linalg.svd", "numpy.allclose", "n...
fbr1/textmining-eac
[ "d35965fad15a54765c29afe76c98d2a634b36ef0" ]
[ "main.py" ]
[ "import numpy as np\r\nimport scipy.cluster.hierarchy as hr\r\nimport scipy.spatial as spa\r\nimport clustering\r\nimport matplotlib.pyplot as plt\r\nfrom sklearn.cluster import AgglomerativeClustering\r\nimport filter\r\n\r\nclass textMiningEac:\r\n def __init__(self,k,N,low,high=0):\r\n self.k = k\r\n\r...
[ [ "numpy.amax", "numpy.unique", "numpy.ones", "numpy.genfromtxt", "numpy.argmax", "sklearn.cluster.AgglomerativeClustering", "numpy.zeros" ] ]
nheinsdorf/pymatgen
[ "7437cc64fc8a850d4820ce5043c896a89bd0019a", "7437cc64fc8a850d4820ce5043c896a89bd0019a", "7437cc64fc8a850d4820ce5043c896a89bd0019a", "7437cc64fc8a850d4820ce5043c896a89bd0019a", "7437cc64fc8a850d4820ce5043c896a89bd0019a", "7437cc64fc8a850d4820ce5043c896a89bd0019a" ]
[ "pymatgen/analysis/molecule_matcher.py", "pymatgen/util/testing.py", "pymatgen/analysis/elasticity/elastic.py", "pymatgen/analysis/elasticity/stress.py", "pymatgen/analysis/transition_state.py", "pymatgen/io/abinit/abitimer.py" ]
[ "# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module provides classes to perform fitting of molecule with arbitrary\natom orders.\nThis module is supposed to perform exact comparisons without the atom order\ncorrespondence prerequisite, while molecule...
[ [ "numpy.square", "numpy.dot", "numpy.linalg.svd", "numpy.diag", "numpy.allclose", "numpy.unique", "numpy.eye", "numpy.linalg.norm", "numpy.math.factorial", "scipy.spatial.distance.cdist", "numpy.linalg.eigh", "numpy.cross", "numpy.argsort", "scipy.optimize.li...
dudals3844/zipline-reloaded
[ "3fe18bcf4ed3668b5543a41071c145d5e7b3ab29" ]
[ "setup.py" ]
[ "#!/usr/bin/env python\n#\n# Copyright 2014 Quantopian, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requir...
[ [ "numpy.get_include" ] ]
astirn/neural-inverse-cdf-sampling
[ "80eb2eb7cf396a4e53df62bc126e9a1828f55ca9" ]
[ "neural_inverse_cdf.py" ]
[ "import os\nimport shutil\nimport numpy as np\nimport tensorflow as tf\nfrom scipy.stats import gamma\nfrom matplotlib import pyplot as plt\n\nfrom neural_inverse_cdf_utils import InvertibleNeuralNetworkLayer, train, result_plot\n\n\nclass GammaCDF(object):\n\n def __init__(self, theta_max=15, base_dir=os.getcwd...
[ [ "numpy.expand_dims", "tensorflow.concat", "numpy.concatenate", "tensorflow.train.AdamOptimizer", "scipy.stats.gamma.cdf", "numpy.exp", "tensorflow.reset_default_graph", "tensorflow.Session", "tensorflow.train.Saver", "tensorflow.nn.elu", "tensorflow.nn.sigmoid", "te...
wuyifan2233/Tencent_Animal_Surveillance
[ "4872852c4868ef5b9dccb7964aa80d397fa7e534" ]
[ "utils/augmentations.py" ]
[ "# YOLOv5 image augmentation functions\n\nimport random\n\nimport cv2\nimport math\nimport numpy as np\n\nfrom utils.general import segment2box, resample_segments\nfrom utils.metrics import bbox_ioa\n\n\ndef augment_hsv(im, hgain=0.5, sgain=0.5, vgain=0.5):\n # HSV color-space augmentation\n if hgain or sgain...
[ [ "numpy.random.beta", "numpy.maximum", "numpy.clip", "numpy.arange", "numpy.eye", "numpy.ones", "numpy.concatenate", "numpy.append", "numpy.mod", "numpy.random.uniform", "numpy.array", "numpy.zeros" ] ]
CoolPhilChen/cil-road-segmentation-2019
[ "0becfe97d77012b3abbaa181a5c52e6edd1a39f1" ]
[ "model/crfasrnn/network.py" ]
[ "# encoding: utf-8\nfrom functools import partial\nfrom collections import OrderedDict\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom config import config\nfrom base_model import resnet50\nfrom seg_opr.seg_oprs import ConvBnRelu\n\nfrom crfrnn import CrfRnn\n\nHAS_BN = True #crfrnn...
[ [ "torch.nn.Dropout2d", "torch.nn.functional.log_softmax", "torch.cat", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d", "torch.nn.functional.interpolate" ] ]
dendisuhubdy/attention-lvcsr
[ "598d487c118e66875fdd625baa84ed29d283b800", "598d487c118e66875fdd625baa84ed29d283b800", "598d487c118e66875fdd625baa84ed29d283b800", "598d487c118e66875fdd625baa84ed29d283b800", "598d487c118e66875fdd625baa84ed29d283b800", "598d487c118e66875fdd625baa84ed29d283b800" ]
[ "libs/Theano/theano/tests/test_printing.py", "libs/blocks/tests/bricks/test_recurrent.py", "libs/Theano/theano/tensor/tests/test_opt.py", "libs/blocks/tests/test_theano_expressions.py", "libs/Theano/theano/sandbox/gpuarray/tests/test_dnn.py", "libs/fuel/fuel/converters/cifar100.py" ]
[ "\"\"\"\nTests of printing functionality\n\"\"\"\nfrom __future__ import print_function\nimport logging\n\nfrom nose.plugins.skip import SkipTest\nimport numpy\n\nfrom six.moves import StringIO\n\nimport theano\nimport theano.tensor as tensor\n\nfrom theano.printing import min_informative_str, debugprint\n\n\ndef t...
[ [ "numpy.arange" ], [ "numpy.dot", "numpy.hstack", "numpy.arange", "numpy.ones", "numpy.concatenate", "numpy.testing.assert_raises", "numpy.testing.assert_allclose", "numpy.exp", "numpy.tanh", "numpy.array", "numpy.zeros" ], [ "numpy.dot", "numpy.sqrt"...
Sessa93/continuous-auth-service
[ "e045bbbae1205629a4cc4bd369c0a0b5dd6fd93f" ]
[ "python_scripts/general_purpose.py" ]
[ "# pylint: disable = C0111, C0103, C0411, C0301, W0102, C0330, C0303\n\"\"\"General Purpose Functions\"\"\"\nimport numpy as np\nfrom random import randint\nfrom sklearn.covariance import EllipticEnvelope\nfrom sklearn.ensemble import IsolationForest\n\n\ndef is_not_extreme_outlier(x, _min, _max):\n \"\"\"Return...
[ [ "numpy.std", "numpy.append", "numpy.mean" ] ]
vvvm23/ddpm
[ "99482bb4edc4286b87e2a79cace0f43f95bdb297" ]
[ "dataset.py" ]
[ "import torch\nimport torchvision\n\nfrom ptpt.log import error\n\nfrom pathlib import Path\n\ndef get_dataset(task: str):\n if task in ['ffhq1024','ffhq1024-large']:\n transforms = torchvision.transforms.Compose([\n torchvision.transforms.ToTensor(),\n torchvision.transforms.Normali...
[ [ "torch.utils.data.Subset", "torch.arange" ] ]
chahyon1998/sornet-ku
[ "87a4479368c95e4d3d59863a4329b2b77f184218" ]
[ "train_leonardo.py" ]
[ "'''\nMIT License\n\nCopyright (c) 2022 Wentao Yuan\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, me...
[ [ "matplotlib.pyplot.imshow", "torch.distributed.init_process_group", "torch.cuda.set_device", "torch.multiprocessing.spawn", "torch.load", "torch.nn.functional.binary_cross_entropy_with_logits", "numpy.full", "matplotlib.pyplot.subplot", "matplotlib.pyplot.axis", "torch.dist...
whplh/mmediting
[ "9efe23bec5e07126ab945369670f026c2b7763d7", "9efe23bec5e07126ab945369670f026c2b7763d7" ]
[ "tests/test_models/test_restorers/test_basicvsr_model.py", "tests/test_models/test_backbones/test_sr_backbones/test_tdan_net.py" ]
[ "# Copyright (c) OpenMMLab. All rights reserved.\nimport tempfile\n\nimport mmcv\nimport pytest\nimport torch\nfrom mmcv.runner import obj_from_dict\n\nfrom mmedit.models import build_model\nfrom mmedit.models.backbones.sr_backbones import BasicVSRNet\nfrom mmedit.models.losses import MSELoss\n\n\ndef test_basicvsr...
[ [ "torch.is_tensor", "torch.no_grad", "torch.rand", "torch.cuda.is_available" ], [ "torch.rand", "torch.cuda.is_available" ] ]
xiaoyangyang2/Paddle
[ "b1a4668c5ff39e44efcfea46d567a5c398fdf3dc", "b1a4668c5ff39e44efcfea46d567a5c398fdf3dc", "b1a4668c5ff39e44efcfea46d567a5c398fdf3dc" ]
[ "python/paddle/fluid/tests/unittests/test_set_value_op.py", "python/paddle/fluid/tests/unittests/test_tensor_register_hook.py", "python/paddle/fluid/variable_index.py" ]
[ "# Copyright (c) 2020 PaddlePaddle 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 ...
[ [ "numpy.random.random", "numpy.array_equal", "numpy.arange", "numpy.ones", "numpy.array", "numpy.zeros", "numpy.random.randint" ], [ "numpy.random.uniform", "numpy.array", "numpy.array_equal" ], [ "numpy.array" ] ]
EmmaNguyen/feature_adversarial_with_topology_signatures
[ "efa7db6d0fdf5b2505d67d4341dcdb2ab05a97a7" ]
[ "models/architecture/neural_topo_nets.py" ]
[ "import torchvision.transforms as transforms\nfrom torchvision.utils import save_image\nfrom torch.utils.data import DataLoader\nfrom torchvision import datasets\nfrom torch.autograd import Variable\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch\n\n\ncuda = True if torch.cuda.is_available() e...
[ [ "torch.nn.Sequential", "torch.nn.BatchNorm1d", "torch.nn.Dropout", "torch.ones", "torch.cat", "torch.nn.BCELoss", "torch.nn.Sigmoid", "torch.nn.Linear", "torch.nn.LeakyReLU", "torch.cuda.is_available", "torch.nn.ReLU" ] ]
fennel-labs/connect4
[ "974103db0d489bb1631fd33cc2caf577ce40cbce" ]
[ "connect4/test/test_field.py" ]
[ "from connect4.field import Field\nimport unittest\nimport numpy as np\n\nclass TestField(unittest.TestCase):\n\n def setUp(self):\n self.field = Field()\n\n def test_legal_placement(self):\n self.field.place(1,Field.Player.P1)\n self.field.place(1,Field.Player.P2)\n self.field.pla...
[ [ "numpy.add", "numpy.zeros_like", "numpy.array_equal" ] ]
syn8228/met
[ "268325eaf91cafe1a56f11a322762391f3f8d027" ]
[ "code/classifiers/knn_classifier.py" ]
[ "import faiss\nimport itertools\nimport numpy as np\n\nfrom code.utils.evaluation_metrics import *\n\n\n\n\nclass KNN_Classifier():\n\n\n def __init__(self,K,t):\n\n self.K = K #number of neighbors to take into account\n self.t = t #temperature of the softmax\n\n\n def fit(self, train_descrs, tr...
[ [ "numpy.exp", "numpy.shape", "numpy.where", "numpy.unique" ] ]
siddhu001/slue-toolkit
[ "b8a62ef941a812ce277cf6a4af08d6065af8bec6", "b8a62ef941a812ce277cf6a4af08d6065af8bec6", "b8a62ef941a812ce277cf6a4af08d6065af8bec6" ]
[ "slue_toolkit/eval/infer_asr.py", "slue_toolkit/prepare/prepare_voxceleb_asr_pred.py", "slue_toolkit/prepare/prepare_voxpopuli.py" ]
[ "#!/usr/bin/env python3 -u\n# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\n\"\"\"\nRun inference for pre-processed data with a trained model.\n\"\"\"\n\nimport logging\nimport math...
[ [ "torch.from_numpy", "numpy.stack", "torch.no_grad", "torch.cuda.is_available", "torch.flatten", "numpy.load", "numpy.array" ], [ "pandas.read_csv" ], [ "pandas.read_csv" ] ]
wwarriner/RVGAN
[ "d76042da976fb8de7e0e6984cc9d61ba0f4b9970" ]
[ "eval.py" ]
[ "import argparse\nfrom pathlib import Path, PurePath\n\nimport numpy as np\n\nimport src.data\nimport src.file_util\nimport src.image_util\nimport src.model\n\n\ndef eval(\n image_chunks: np.ndarray,\n mask_chunks: np.ndarray,\n downscale_factor: int,\n g_c: src.data.ModelFile,\n g_f: src.data.ModelF...
[ [ "numpy.array", "numpy.zeros_like" ] ]
irrelevantRyan/leafmap
[ "20c349b69c057881846a7c174c1970edcba11d81" ]
[ "leafmap/common.py" ]
[ "\"\"\"This module contains some common functions for both folium and ipyleaflet.\n\"\"\"\n\nimport csv\nimport os\nimport requests\nimport shutil\nimport tarfile\nimport urllib.request\nimport zipfile\nimport folium\nimport ipyleaflet\nimport ipywidgets as widgets\nimport whitebox\nfrom IPython.display import disp...
[ [ "pandas.json_normalize", "pandas.read_csv" ] ]
kreimanlab/AugMem
[ "cb0e8d39eb0c469da46c7c550c19229927a2bec5" ]
[ "other_models/COPE/model/reservoir.py" ]
[ "\"\"\"This is reservoir sampling, each sample has storage-probability 'buffer samples M / seen samples'\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.optim as optim\nimport random\n\n\nclass Net(nn.Module):\n def __init__(self,\n n_inputs,\n n_outputs,\n ...
[ [ "torch.stack", "torch.nn.CrossEntropyLoss", "torch.cat" ] ]
levincoolxyz/PPO-PyTorch
[ "d3e08663d7feda2cc27158734a37cc2e992e1471" ]
[ "test_clonedAll_ants.py" ]
[ "#!/usr/bin/python3\n\nimport gym\nfrom gym import wrappers\nimport time\nfrom PPO_clonedAll_ants import PPO, Memory\nfrom PIL import Image\nimport torch\nimport numpy as np\nimport ants\n\ndeviceName = \"cuda:0\" if torch.cuda.is_available() else \"cpu\"\ndeviceName = \"cpu\"\ndevice = torch.device(deviceName)\n\n...
[ [ "torch.device", "torch.cuda.is_available", "torch.load" ] ]
waleedgondal/disentanglement_lib
[ "949d737a283079d26c5f7f59a43c06d699aa3531" ]
[ "disentanglement_lib/data/ground_truth/mpi3d.py" ]
[ "# coding=utf-8\n# Copyright 2018 The DisentanglementLib 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/LICE...
[ [ "numpy.dot", "tensorflow.io.gfile.exists", "tensorflow.io.gfile.GFile", "numpy.cumprod", "numpy.prod", "numpy.load" ] ]
dkirel/TwitterSentiment
[ "ee2ac58f52e687a2cea1f5113dfee3769fb9f693" ]
[ "vote_classifier.py" ]
[ "import nltk\nimport pickle\n\nfrom nltk.classify import ClassifierI\nfrom nltk.classify.scikitlearn import SklearnClassifier\nfrom nltk.metrics.scores import precision, recall\nfrom nltk.tokenize import word_tokenize\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.naive_bayes import Multinomial...
[ [ "sklearn.model_selection.train_test_split" ] ]
stjordanis/pyquil
[ "36987ecb78d5dc85d299dd62395b7669a1cedd5a", "36987ecb78d5dc85d299dd62395b7669a1cedd5a" ]
[ "test/unit/test_noise.py", "pyquil/simulation/_reference.py" ]
[ "from collections import OrderedDict\n\nimport numpy as np\nimport pytest\nfrom pytest_mock import MockerFixture\n\nfrom pyquil.api._qam import QAMExecutionResult\nfrom pyquil.gates import RZ, RX, I, CZ\nfrom pyquil.noise import (\n pauli_kraus_map,\n damping_kraus_map,\n dephasing_kraus_map,\n tensor_k...
[ [ "numpy.diag", "numpy.allclose", "numpy.random.seed", "numpy.sqrt", "numpy.eye", "numpy.ones", "numpy.alltrue", "numpy.random.rand", "numpy.testing.assert_allclose", "numpy.exp", "numpy.array", "numpy.zeros", "numpy.isclose" ], [ "numpy.linalg.eigvals", ...
krokodilj/flair-with-tfidf
[ "d1c0e5a1527d595d3b5a25e4f7a34ba47f633920" ]
[ "tfidf/model.py" ]
[ "from gensim.corpora import Dictionary\nfrom gensim.models.tfidfmodel import TfidfModel\nfrom gensim.matutils import sparse2full\n\nimport spacy\nnlp = spacy.load('en_core_web_sm')\n\nimport numpy as np\nimport itertools\n\nclass TfIdfEncoder:\n \n def __init__(self, config):\n self.docs = config['docs']\n ...
[ [ "numpy.dot", "numpy.linalg.norm" ] ]
krbjila/labrad_tools
[ "5c510cb35090807807bfe6bd910b9c35edce6fce" ]
[ "sequencer/devices/lib/analog_ramps.py" ]
[ "import numpy as np\n\ndef H(x):\n \"\"\"\n step function\n \"\"\"\n return 0.5*(np.sign(x-1e-9)+1)\n\ndef G(t1, t2):\n \"\"\"\n pulse\n \"\"\"\n return lambda t: H(t2-t) - H(t1-t) \n\ndef round_dt(dt):\n return float('{0:.7f}'.format(dt))\n# return dt\n\ndef round_dv(dv):\n return ...
[ [ "numpy.sign", "numpy.exp", "numpy.linspace" ] ]
llv22/MatchZoo
[ "a4b7f60a7583c7dcf02288a0a60fac8973a4c917" ]
[ "matchzoo/layers/DynamicMaxPooling.py" ]
[ "from keras.layers import Input\nfrom keras import backend as K\nfrom keras.engine.topology import Layer\nimport numpy as np\n\nclass DynamicMaxPooling(Layer):\n\n def __init__(self, psize1, psize2, **kwargs):\n # for psize1, psize2 [3, 10]\n self.psize1 = psize1\n self.psize2 = psize2\n ...
[ [ "numpy.array", "numpy.meshgrid", "numpy.ones" ] ]
AakankshaAshok/pandas
[ "6498bc1e8a12003640139db4794bd5cd2462c116", "6498bc1e8a12003640139db4794bd5cd2462c116" ]
[ "pandas/tests/frame/test_dtypes.py", "pandas/core/indexes/frozen.py" ]
[ "from collections import OrderedDict\nfrom datetime import timedelta\n\nimport numpy as np\nimport pytest\n\nfrom pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype\n\nimport pandas as pd\nfrom pandas import (\n Categorical,\n DataFrame,\n Series,\n Timedelta,\n Timestamp,\n _np_ve...
[ [ "pandas.to_datetime", "pandas.Series", "numpy.asarray", "pandas.util.testing.assert_produces_warning", "pandas.core.dtypes.dtypes.DatetimeTZDtype", "pandas.DataFrame", "numpy.dtype", "pandas.util.testing.assert_frame_equal", "numpy.round", "pandas.util.testing.assert_index_...
saw-mill/HawkEyeSquash
[ "2259923cf4407e259aa684995a642e8145efafe3" ]
[ "5FpsKalman.py" ]
[ "import time\nimport cv2\nimport math\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom Modules.foregroundExtraction import readyFrame, frameDifferencing, morphologicalOperations, natural_sort, convert480p\nfrom Modules.ballDetectionRes import findContours, sizeDetection, playerProximityDetection, regionDe...
[ [ "matplotlib.pyplot.title", "matplotlib.pyplot.plot", "numpy.float32", "matplotlib.pyplot.xlabel", "numpy.array", "numpy.zeros", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
thuiar/cmcnn
[ "a18f09fa63baf74bb083779fa0a8881d55226e1a", "a18f09fa63baf74bb083779fa0a8881d55226e1a" ]
[ "getFeatures.py", "utils/island_loss.py" ]
[ "import os\nimport gc\nimport time\nimport torch\nimport random\nimport argparse\nimport numpy as np\nimport pandas as pd\nfrom glob import glob\nfrom tqdm import tqdm\n\nfrom trains import *\nfrom config import *\nfrom utils.log import *\nfrom utils.metricsTop import *\nfrom utils.functions import *\nfrom models.A...
[ [ "numpy.savez", "torch.load", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available", "torch.device" ], [ "torch.randn", "torch.cosine_similarity", "torch.norm", "torch.zeros_like" ] ]
shanmukhananda/tfrecords
[ "0b29f2c0d84fc76c758f7b73b61f5730a8e82cef", "0b29f2c0d84fc76c758f7b73b61f5730a8e82cef" ]
[ "create_tfrecords.py", "stat_tfrecords.py" ]
[ "\"\"\"\nCreate the tfrecord files for a dataset.\n\nA lot of this code comes from the tensorflow inception example, so here is their license:\n\n# Copyright 2016 Google Inc. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in complianc...
[ [ "tensorflow.train.Int64List", "numpy.linspace", "numpy.arange", "tensorflow.image.decode_png", "tensorflow.train.Coordinator", "tensorflow.placeholder", "tensorflow.python_io.TFRecordWriter", "tensorflow.Session", "tensorflow.train.FloatList", "tensorflow.image.encode_jpeg"...
enhatem/quadrotor_mpc_acados
[ "9ca50ecc0a852ba5f9464df0ccd5d40e3ebfc295", "9ca50ecc0a852ba5f9464df0ccd5d40e3ebfc295" ]
[ "hovering_mpc/acados_settings.py", "planar_mpc/tut_live_plot.py" ]
[ "from acados_template import AcadosModel, AcadosOcp, AcadosOcpSolver\nfrom drone_model import drone_model\nimport scipy.linalg\nimport numpy as np\n\ndef acados_settings(Tf, N):\n\n # create OCP object to formulate the optimization\n ocp = AcadosOcp()\n\n # export model\n model = drone_model()\n\n # ...
[ [ "numpy.diag", "numpy.eye", "numpy.array", "numpy.zeros" ], [ "numpy.linspace", "numpy.cos", "numpy.sin", "matplotlib.pyplot.plot", "matplotlib.pyplot.show", "matplotlib.pyplot.style.use" ] ]
human-analysis/3dfacefill
[ "1f85d72731690730eef03871d3afecf9d4d307b4" ]
[ "utils.py" ]
[ "# utils.py\n\nimport os\nimport csv\nimport math\nimport numpy as np\nimport argparse\nfrom inspect import getframeinfo, stack\nimport json\nimport sys\nimport psutil\nimport signal\nimport torch\nimport torchvision\nfrom PIL import Image\nfrom scipy.io import loadmat\nfrom plyfile import PlyData, PlyElement\nimpo...
[ [ "numpy.power", "numpy.isnan", "numpy.arange", "scipy.io.loadmat", "numpy.concatenate", "numpy.exp", "numpy.zeros" ] ]
Benjamin-Etheredge/pytorch-lightning
[ "fe572c5911abfa2cc0b806b1c2cfe977d483c7c1", "fe572c5911abfa2cc0b806b1c2cfe977d483c7c1" ]
[ "tests/trainer/test_supporters.py", "pytorch_lightning/plugins/precision/precision_plugin.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.randn", "torch.tensor" ], [ "torch.nn.utils.clip_grad_norm_", "torch.nn.utils.clip_grad_value_" ] ]
jarethholt/teospy
[ "3bb23e67bbb765c0842aa8d4a73c1d55ea395d2f" ]
[ "teospy/iceair4b.py" ]
[ "\"\"\"Icy air Gibbs energy and related properties.\n\nThis module provides the Gibbs function for ice-saturated (icy) air and\nrelated thermodynamic properties. The primary variables are the total\ndry air fraction, temperature, and pressure. The 'total' fraction here\nis the mass fraction of dry air in the total ...
[ [ "numpy.array", "numpy.linalg.solve" ] ]
liyc7711/seq2seq
[ "1592b842b652ae648b96c164bead38eb089ce08e" ]
[ "seq2seq/tasks/decode_text.py" ]
[ "# Copyright 2017 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed...
[ [ "tensorflow.gfile.GFile", "tensorflow.train.SessionRunArgs", "numpy.ndim", "numpy.argmax", "numpy.array" ] ]
Sciguymjm/AlphaVantageAPI
[ "54feb3c6566bfd561c5e366b1a129a4b44311a45" ]
[ "tests/test_api.py" ]
[ "from alphaVantageAPI.alphavantage import AlphaVantage\n\nfrom unittest import TestCase\nfrom unittest.mock import patch\nfrom pandas import DataFrame, read_csv\n\nfrom .utils import Path\nfrom .utils import Constant as C\nfrom .utils import load_json, _mock_response\n\n## Python 3.7 + Pandas DeprecationWarning\n# ...
[ [ "pandas.read_csv", "pandas.DataFrame" ] ]
zplab/zplib
[ "dc789acd481df86e0bc99e137ceb05c196425d03", "dc789acd481df86e0bc99e137ceb05c196425d03" ]
[ "zplib/scalar_stats/smoothing.py", "zplib/image/active_contour.py" ]
[ "import numpy\n\ndef weighted_mean_and_std(x, w):\n \"\"\"Return the mean and standard deviation of the data points x, weighted by\n the weights in w (which do not need to sum to 1).\"\"\"\n w = numpy.array(w, dtype=float)\n w /= w.sum()\n x = numpy.asarray(x)\n weighted_mean = (w*x).sum()\n sq...
[ [ "numpy.partition", "numpy.dot", "numpy.polyfit", "numpy.sqrt", "numpy.abs", "numpy.clip", "numpy.asarray", "numpy.empty_like", "numpy.polynomial.polynomial.polyfit", "numpy.ones", "numpy.polynomial.polynomial.polyval", "numpy.array", "numpy.sum" ], [ "sc...
alipsgh/deep-mix-nets
[ "3c60897687046523d58a321ca0f7cd69dbcf78a1" ]
[ "models/fasttext.py" ]
[ "\nimport torch\n\nfrom models.deep_mix_net import DeepSeqNet\nfrom torch import nn\n\n\nclass FastText(DeepSeqNet):\n\n def __init__(self, vocab_size, embeddings, embedding_size, hidden_layer_size,\n tab_input_dim, linear_layers_dim, output_dim, dropout_rate, optimizer=\"adam\", learning_rate=0....
[ [ "torch.nn.Softmax", "torch.nn.Dropout", "torch.nn.Parameter", "torch.nn.ModuleList", "torch.nn.Embedding", "torch.nn.Linear", "torch.cuda.is_available", "torch.nn.ReLU" ] ]
PedroLelis/tensorflow
[ "8852b0032ad49acbc59009776665c60f86c06f91" ]
[ "tensorflow/contrib/tensor_forest/data/data_ops.py" ]
[ "# Copyright 2016 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.platform.resource_loader.get_path_to_datafile", "tensorflow.python.framework.ops.NotDifferentiable", "tensorflow.python.framework.load_library.load_op_library", "tensorflow.python.ops.array_ops.concat", "tensorflow.python.platform.tf_logging.info", "tensorflow.python.ops...
thodan/epos
[ "d67657bbb06da5a6adb8a035a2f58fc305e396f7", "d67657bbb06da5a6adb8a035a2f58fc305e396f7", "d67657bbb06da5a6adb8a035a2f58fc305e396f7", "d67657bbb06da5a6adb8a035a2f58fc305e396f7" ]
[ "external/slim/nets/s3dg.py", "external/slim/nets/i3d.py", "external/slim/nets/resnet_v1_test.py", "epos_lib/common.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required...
[ [ "tensorflow.multiply", "tensorflow.nn.sigmoid", "tensorflow.transpose", "tensorflow.reduce_mean", "tensorflow.truncated_normal_initializer", "tensorflow.squeeze", "tensorflow.variable_scope", "tensorflow.tile" ], [ "tensorflow.variable_scope", "tensorflow.squeeze", ...
gugerlir/rainforest
[ "85a9d51acf2036245f0cebf7232e735c2cf2dfc4" ]
[ "rainforest/common/utils.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nSet of functions that can be useful\n\nDaniel Wolfensberger\nMeteoSwiss/EPFL\ndaniel.wolfensberger@epfl.ch\nDecember 2019\n\"\"\"\n\n# Global imports\nimport datetime\nimport io\nimport os\nfrom collections import OrderedDict\nimport numpy as np\nfrom scipy....
[ [ "numpy.asarray", "numpy.squeeze", "numpy.cumsum", "numpy.max", "numpy.nanmean", "numpy.unique", "numpy.ceil", "numpy.apply_along_axis", "numpy.interp", "numpy.zeros", "numpy.min", "numpy.log10", "numpy.argsort", "numpy.array", "numpy.logical_and", "n...
ahmedqasem/image_tools
[ "6b6ecbe23769a5c5136b9dcccff1db898bdb7490" ]
[ "fix_data.py" ]
[ "import os\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport cv2\r\n\r\n\r\ndef load_images_and_labels(path):\r\n \"\"\" scan the data folder in and return a list of paths for images and labels \"\"\"\r\n folders = os.listdir(path)\r\n slices = []\r\n gt = []\r\n for f in folders:\r\...
[ [ "matplotlib.pyplot.imsave" ] ]
dgketchum/irr_impacts
[ "4a09296eb5cc6f36b63ecd4ca2a82b075e1581d5" ]
[ "bulk_analysis_figs.py" ]
[ "import os\nfrom calendar import monthrange\nfrom datetime import date\n\nfrom matplotlib import rcParams, pyplot as plt\nfrom pandas import read_csv, concat\nimport numpy as np\n\nfrom hydrograph import hydrograph\nfrom county_list import included_counties\nfrom state_county_names_codes import state_fips_code, sta...
[ [ "pandas.read_csv", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.subplots", "matplotlib.pyplot.savefig", "matplotlib.pyplot.gcf", "matplotlib.pyplot.xlim", "numpy.any", "matplotlib.pyplot.close", "matplotlib.pyplot.suptitle" ] ]
shigengtian/caffe2
[ "e19489d6acd17fea8ca98cd8e4b5b680e23a93c5", "e19489d6acd17fea8ca98cd8e4b5b680e23a93c5", "e19489d6acd17fea8ca98cd8e4b5b680e23a93c5", "e19489d6acd17fea8ca98cd8e4b5b680e23a93c5", "8f41717c46d214aaf62b53e5b3b9b308b5b8db91", "e19489d6acd17fea8ca98cd8e4b5b680e23a93c5", "e19489d6acd17fea8ca98cd8e4b5b680e23a93c...
[ "caffe2/python/operator_test/elementwise_op_broadcast_test.py", "caffe2/python/muji_test.py", "caffe2/python/operator_test/ceil_op_test.py", "caffe2/python/core_test.py", "caffe2/python/operator_test/deform_conv_test.py", "caffe2/python/operator_test/fc_operator_test.py", "caffe2/python/operator_test/fl...
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport unittest\n\nfrom hypothesis import given\nimport numpy as np\n\nfrom caffe2.proto import caffe2_pb2\nfrom caffe2.python import core, workspace\nimport ca...
[ [ "numpy.log", "numpy.random.seed", "numpy.power", "numpy.random.rand", "numpy.sum", "numpy.testing.assert_array_almost_equal" ], [ "numpy.all" ], [ "numpy.ceil" ], [ "numpy.array" ], [ "numpy.ones", "numpy.random.rand", "numpy.random.uniform", "nu...
pengzhou93/dancenet
[ "89bc44fe723d12bee87d87e1bcb5d19d6dcb8eb1" ]
[ "dancegen.py" ]
[ "\n# coding: utf-8\n\n# In[1]:\n\n\nfrom model import vae,decoder\nfrom keras.layers import Dropout\nfrom keras.layers import LSTM\nfrom keras.layers import Dense\nfrom keras.layers import Reshape\nfrom keras.layers import Input\nfrom keras.models import Model\nfrom keras.optimizers import adam\nfrom keras.callback...
[ [ "numpy.load", "numpy.array", "sklearn.preprocessing.MinMaxScaler" ] ]
Rblack999/github-slideshow
[ "f424ba5acdeb9a4d418c30f06ec5992f94c565a3" ]
[ "Biologic/Old_PyExpLabSys/sp150_CV_export.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Thu Dec 5 12:43:51 2019\r\n\r\n@author: Blackr\r\n\"\"\"\r\n\"\"\"Cyclic Voltammetry (CV) technique class.\r\n\r\nThe CV technique returns data on fields (in order):\r\n\r\n* time (float)\r\n* Ec (float)\r\n* I (float)\r\n* Ewe (float)\r\n* cycle (int)\r\n\"\"\"\r\n...
[ [ "numpy.append", "numpy.array", "numpy.transpose" ] ]
Syniez/Joint_360depth
[ "fcdec95bf3ad109767d27396434b51cf3aad2b4b", "4f28c3b5b7f648173480052e205e898c6c7a5151" ]
[ "evaluate/previous_works/svsyn/spherical/grid.py", "evaluate/previous_works/HoHoNet/lib/model/horizon_upsample/upsample1d.py" ]
[ "import torch\r\nimport numpy\r\n\r\ndef create_image_grid(width, height, data_type=torch.float32): \r\n v_range = (\r\n torch.arange(0, height) # [0 - h]\r\n .view(1, height, 1) # [1, [0 - h], 1]\r\n .expand(1, height, width) # [1, [0 - h], W]\r\n .type(data_type) # [1, H, W]...
[ [ "torch.stack", "torch.arange" ], [ "torch.nn.BatchNorm1d", "torch.nn.ReLU", "torch.nn.Conv1d" ] ]
Royzon/YOLOV4_MCMOT
[ "cd4c8b1b60f9cf809579609caa29d408432845ba" ]
[ "mAPEvaluate/TestmApDetect.py" ]
[ "# encoding=utf-8\n\nimport os\nimport cv2\nimport time\nimport numpy\nimport copy\nimport shutil\n\nimport mAPEvaluate.darknet as dn\nimport mAPEvaluate.cmp_det_label_sf as cdl\n\nfrom mAPEvaluate.ReadAndSaveDarknetDetRes import read_det_res, save_det_res\nfrom mAPEvaluate.ReadAnnotations import load_label\nfrom m...
[ [ "numpy.delete", "numpy.vstack" ] ]
rockwellw/dask
[ "c1f6d61368af6f9c67d39d23406eb267a0308bb9", "c1f6d61368af6f9c67d39d23406eb267a0308bb9", "c1f6d61368af6f9c67d39d23406eb267a0308bb9" ]
[ "dask/array/utils.py", "dask/dataframe/partitionquantiles.py", "dask/sizeof.py" ]
[ "import difflib\nimport functools\nimport math\nimport numbers\nimport os\nimport warnings\n\nimport numpy as np\nfrom toolz import frequencies, concat\n\nfrom .core import Array\nfrom ..highlevelgraph import HighLevelGraph\nfrom ..utils import has_keyword, ignoring, is_arraylike\n\ntry:\n AxisError = np.AxisErr...
[ [ "numpy.ones_like", "numpy.allclose", "numpy.isnan", "numpy.empty_like", "numpy.full", "numpy.full_like", "numpy.ones", "numpy.zeros_like", "numpy.isscalar", "numpy.errstate", "numpy.array", "numpy.zeros", "numpy.empty" ], [ "pandas.Categorical.from_codes...
myknotruby/recommenders
[ "d4a41de4e10cf0fa4db7f4e5c4d6bccc6629e201", "d4a41de4e10cf0fa4db7f4e5c4d6bccc6629e201" ]
[ "tests/unit/reco_utils/recommender/test_ncf_singlenode.py", "reco_utils/recommender/sar/sar_singlenode.py" ]
[ "# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License.\n\nimport os\nimport shutil\nimport numpy as np\nimport pytest\n\ntry:\n from reco_utils.recommender.ncf.ncf_singlenode import NCF\n from reco_utils.recommender.ncf.dataset import Dataset\n from reco_utils.commo...
[ [ "numpy.array_equal" ], [ "scipy.sparse.coo_matrix", "numpy.ones_like", "numpy.isnan", "numpy.issubdtype", "pandas.DataFrame", "numpy.zeros_like", "numpy.repeat", "numpy.array", "numpy.zeros" ] ]
paperstiger/MoE-public
[ "0f6f89d25dbbc83058e4f2750c70d79a3744856e", "0f6f89d25dbbc83058e4f2750c70d79a3744856e" ]
[ "Navigation-DRL/externalmodel.py", "Navigation-DRL/arguments.py" ]
[ "#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n# vim:fenc=utf-8\n#\n# Copyright © 2017 Gao Tang <gt70@duke.edu>\n#\n# Distributed under terms of the MIT license.\n\n\"\"\"\nexternalmodel.py\n\nDefine several user-defined models.\n\"\"\"\nimport gym\nfrom gym import error, spaces, utils\nfrom gym.utils import see...
[ [ "numpy.clip", "numpy.linalg.norm", "numpy.cos", "numpy.sin", "numpy.ones", "numpy.ceil", "numpy.random.normal", "numpy.mod", "numpy.random.uniform", "numpy.array", "numpy.zeros", "numpy.sum" ], [ "torch.cuda.is_available" ] ]
sehoonha/optskills
[ "d3b3ea46e7987f31f98e8b1772f927d3de32e569" ]
[ "optskills/problems/sim_jump.py" ]
[ "import numpy as np\nfrom numpy.linalg import norm\nfrom sim_problem import SimProblem, SPDController, JTController, STR\n\n\nclass SimJumpController(object):\n def __init__(self, _world):\n self.world = _world\n self.spd = SPDController(self.skel(), 250.0, 20.0, self.world.dt)\n self.spd.ta...
[ [ "numpy.random.rand", "numpy.array", "numpy.linalg.norm", "numpy.linspace" ] ]
csmithud/pfra-hydromet
[ "443da7105a35b004b33b361fcfaa459b9690e4b3" ]
[ "core/hydromet_traditional.py" ]
[ "import pathlib as pl\nimport os\nimport numpy as np\nimport pandas as pd\nfrom scipy.integrate import quad\nfrom scipy.optimize import minimize\nfrom scipy import interpolate, stats, special\nfrom matplotlib import pyplot as plt\nfrom cycler import cycler\nfrom IPython.display import display\nfrom hydromet import ...
[ [ "pandas.reset_option", "numpy.square", "pandas.concat", "pandas.read_csv", "numpy.maximum", "numpy.log", "scipy.stats.lognorm.ppf", "pandas.DataFrame", "numpy.array" ] ]
fbcotter/dtcwt_gainlayer
[ "32ec3e21066edc2a0d5edefaf70f43d031d1b4ac" ]
[ "experiments/networks/largekernel_nets.py" ]
[ "\"\"\" This module builds different networks with nonlinearities\n\"\"\"\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as func\nfrom dtcwt_gainlayer import WaveConvLayer\nfrom dtcwt_gainlayer.layers.dwt import WaveConvLayer as WaveConvLayer_dwt\nfrom collections import OrderedDict\n\n\nnets = {\...
[ [ "torch.nn.functional.log_softmax", "torch.nn.Conv2d", "torch.sum", "torch.nn.utils.clip_grad_value_", "torch.nn.Linear", "torch.nn.AvgPool2d", "torch.nn.MaxPool2d", "torch.nn.BatchNorm2d", "torch.nn.ReLU" ] ]
siddharth-143/Python
[ "293f4643a3a13e3b82d23fd8922db54dbb0f12bc", "293f4643a3a13e3b82d23fd8922db54dbb0f12bc" ]
[ "python-questions-for-pratices/Question-60.py", "OpenCV2/Feature_Detection_and_Description/Corner_Detection_with_Shi-Tomasi_coner_method.py" ]
[ "\"\"\"\nQuestion 60 :\n Write a program to read an ASCII string and convert it ta\n a unicode string.\n\n Hints : Use unicode() function to convert.\n\"\"\"\n\n# Solution :\nfrom numpy.core import unicode\n\ns = input(\"Enter a string : \")\nu = unicode(\"utf-8\", s)\nprint(u)\n\n\"\"\"\nOutput :\n cod...
[ [ "numpy.core.unicode" ], [ "numpy.int0", "matplotlib.pyplot.imshow", "matplotlib.pyplot.show" ] ]
congcy/TVINet
[ "c4b3a6d1c7a0d65ded62a53d6236493207993dbd" ]
[ "code/mdlnet.py" ]
[ "'''\n Jackie Yuan\n 2018.06\n'''\n\nfrom __future__ import print_function\nfrom keras.callbacks import ModelCheckpoint\nimport sgydata\nimport myunet\nimport numpy as np\n\n# input image dimensions\nimg_rows, img_cols = 1600, 200\nimg_rows2, img_cols2 = 200, 200\nnchannels=3\n\n# input data\n#shot1\nnumsgy1,x_...
[ [ "numpy.save", "numpy.concatenate", "numpy.savetxt", "numpy.load", "numpy.array" ] ]
Werberty/Projeto-CoppeliaSim
[ "2f60565f2e5e91d2d86e79576eb0f80a1106a18c", "2f60565f2e5e91d2d86e79576eb0f80a1106a18c" ]
[ "Campos_potenciais/teste_camposPotenc.py", "Testes/exemplo2.py" ]
[ "try:\n import sim\nexcept:\n print('--------------------------------------------------------------')\n print('\"sim.py\" could not be imported. This means very probably that')\n print('either \"sim.py\" or the remoteApi library could not be found.')\n print('Make sure both are in the same folder as ...
[ [ "numpy.sqrt", "numpy.cos", "numpy.sin", "numpy.arctan2", "numpy.deg2rad", "numpy.array" ], [ "numpy.cos", "numpy.sin", "numpy.deg2rad", "numpy.array", "matplotlib.pyplot.figure" ] ]
zabarah/MRCNN
[ "93fdd01e1e38200763a2d6adbc5b076aa0218d2c" ]
[ "MRCNN/Evalution.py" ]
[ "\nfrom __future__ import division\nfrom __future__ import print_function\nimport numpy as np\nimport os\nos.chdir(\"Target File\") \nimport sklearn.metrics as skm\nfrom sklearn.metrics import mean_squared_error as mse\nfrom sklearn.metrics import mean_absolute_error as mae\nfrom keras import backend as cmp\n\n\n#...
[ [ "sklearn.metrics.roc_auc_score", "numpy.unique", "sklearn.metrics.mean_absolute_error", "sklearn.metrics.mean_squared_error", "numpy.concatenate" ] ]
mt-huebsch/pymatgen
[ "92da4a6a3d7c7a2f4cfed19a49794d59f15b42e7" ]
[ "pymatgen/io/vasp/sets.py" ]
[ "# coding: utf-8\n# Copyright (c) Pymatgen Development Team.\n# Distributed under the terms of the MIT License.\n\n\"\"\"\nThis module defines the VaspInputSet abstract base class and a concrete\nimplementation for the parameters developed and tested by the core team\nof pymatgen, including the Materials Virtual La...
[ [ "numpy.product", "numpy.sqrt", "numpy.allclose", "numpy.abs", "numpy.round", "numpy.ceil", "numpy.average", "numpy.array" ] ]
WiFisunset/qiskit-terra
[ "6a2602a9ecf9b1a3345de1516b873ac7b3da587f", "6a2602a9ecf9b1a3345de1516b873ac7b3da587f", "6a2602a9ecf9b1a3345de1516b873ac7b3da587f", "6a2602a9ecf9b1a3345de1516b873ac7b3da587f" ]
[ "qiskit/opflow/gradients/natural_gradient.py", "test/python/circuit/library/test_nlocal.py", "qiskit/algorithms/optimizers/gsls.py", "qiskit/pulse/library/waveform.py" ]
[ "# This code is part of Qiskit.\n#\n# (C) Copyright IBM 2018, 2020.\n#\n# This code is licensed under the Apache License, Version 2.0. You may\n# obtain a copy of this license in the LICENSE.txt file in the root directory\n# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.\n#\n# Any modificatio...
[ [ "numpy.diag", "numpy.linalg.solve", "numpy.sqrt", "numpy.matmul", "numpy.linalg.norm", "sklearn.linear_model.Lasso", "numpy.linalg.lstsq", "sklearn.linear_model.Ridge", "numpy.real", "numpy.log10", "numpy.transpose", "numpy.mod" ], [ "numpy.arange", "num...
sgherbst/msdsl
[ "e38d5ecdb88b3574bda62f22a4f91ce3e4173d12", "e38d5ecdb88b3574bda62f22a4f91ce3e4173d12" ]
[ "tests/lowlevel/test_ctle2.py", "tests/func_sim/test_func_sim.py" ]
[ "import pytest\nimport numpy as np\nfrom pathlib import Path\nfrom scipy.interpolate import interp1d\nfrom scipy.signal import lfilter\nfrom scipy.signal import cont2discrete\nfrom msdsl.interp.interp import calc_interp_w\nfrom msdsl.interp.lds import SplineLDS\nfrom msdsl.interp.ctle import calc_ctle_abcd, calc_ct...
[ [ "numpy.linspace", "numpy.genfromtxt", "numpy.concatenate", "scipy.interpolate.interp1d", "scipy.signal.cont2discrete", "numpy.diff", "numpy.mean", "numpy.searchsorted", "scipy.signal.lfilter", "numpy.zeros" ], [ "numpy.random.seed", "numpy.clip", "numpy.mean...
astonzhang/Parameterization-of-Hypercomplex-Multiplications
[ "0e3f1ceebccce9f14ce629356733c07602eb351c" ]
[ "layers/qlib.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport tensorflow as tf\nimport numpy as np\nfrom numpy.random import RandomState\nfrom tensorflow.python.framework import dtypes\nfrom tensorflow.python.ops import random_ops\nimport random\n\n\"\"\" ...
[ [ "tensorflow.matmul", "tensorflow.multiply", "tensorflow.concat", "tensorflow.get_variable", "tensorflow.transpose", "tensorflow.shape", "tensorflow.nn.sigmoid", "tensorflow.reduce_sum", "tensorflow.reshape", "tensorflow.orthogonal_initializer", "tensorflow.contrib.layer...
pietrobarbiero/logic_explained_networks
[ "238f2a220ae8fc4f31ab0cf12649603aba0285d5", "238f2a220ae8fc4f31ab0cf12649603aba0285d5" ]
[ "data/load_structured_datasets.py", "tests/test_models.py" ]
[ "import pandas as pd\nimport numpy as np\nimport torch\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.impute import SimpleImputer\nfrom sklearn.linear_model import LogisticRegression\nfrom sklearn.model_selection import cross_val_score\nfrom sklearn.preprocessing import MinMaxScaler, KBinsDiscre...
[ [ "numpy.hstack", "pandas.read_csv", "numpy.unique", "sklearn.impute.SimpleImputer", "sklearn.preprocessing.KBinsDiscretizer", "torch.tensor", "torch.FloatTensor", "sklearn.preprocessing.MinMaxScaler" ], [ "torch.utils.data.TensorDataset", "sklearn.datasets.load_iris", ...
carlobar/PYPOWER-Dynamics
[ "bda06f027fa2b2b184d5abed5bfaf00ce730b85c" ]
[ "pydyn/events.py" ]
[ "#!python3\n#\n# Copyright (C) 2014-2015 Julius Susanto. All rights reserved.\n# Use of this source code is governed by a BSD-style\n# license that can be found in the LICENSE file.\n\n\"\"\"\nPYPOWER-Dynamics\nEvents Class\nSets up and handles events in the simulation\n\"\"\"\nfrom pdb import set_trace as bp\nimpo...
[ [ "numpy.delete" ] ]
yaswanthpalaghat/Movie-Recommendation-System-using-Machine-Learning
[ "546914401c4fd2cbcf1d32de69e3f64995d95c25" ]
[ "SentimentAnalysis.py" ]
[ "__author__ = \"Yaswanth Sai Palaghat\"\r\n\r\nimport nltk\r\nimport sklearn\r\nfrom sklearn.datasets import load_files\r\nfrom sklearn.feature_extraction.text import CountVectorizer\r\nfrom sklearn.feature_extraction.text import TfidfTransformer\r\nfrom sklearn.naive_bayes import MultinomialNB\r\nfrom sklearn.mode...
[ [ "sklearn.naive_bayes.MultinomialNB", "sklearn.model_selection.train_test_split", "sklearn.datasets.load_files", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.feature_extraction.text.TfidfTransformer" ] ]
wdwang/pyABC
[ "65f85d97f20ac47df6a6d95cb373adba35738f57", "65f85d97f20ac47df6a6d95cb373adba35738f57", "65f85d97f20ac47df6a6d95cb373adba35738f57" ]
[ "pyabc/transition/multivariatenormal.py", "pyabc/populationstrategy.py", "pyabc/visualization.py" ]
[ "from typing import Union\n\nimport numpy as np\nimport pandas as pd\nimport scipy.stats as st\nfrom .exceptions import NotEnoughParticles\nfrom .base import Transition\nfrom .util import smart_cov\n\n\ndef scott_rule_of_thumb(n_samples, dimension):\n \"\"\"\n Scott's rule of thumb.\n\n .. math::\n\n ...
[ [ "numpy.array", "scipy.stats.multivariate_normal", "numpy.zeros" ], [ "numpy.isnan" ], [ "matplotlib.pyplot.gca", "pandas.concat", "numpy.linspace", "matplotlib.pyplot.subplots", "pandas.DataFrame", "numpy.zeros" ] ]
XGX-CURRY/LDP-Bandit
[ "b04f84418d39fa9e0308f6fbb42a4ec236118061" ]
[ "Scheme1/plotters/plotters.py" ]
[ "import glob\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nimport tikzplotlib\n\nsns.set_style(\"ticks\")\nplt.rc('font', size=6)\nplt.rc('text', usetex=False)\nplt.rc('font', family='serif')\n\ndef smoother(x, a=0.9, w=10, mode=\"moving\"):\n if mode == \"movi...
[ [ "pandas.read_csv", "matplotlib.pyplot.rc", "numpy.std", "numpy.mean", "matplotlib.pyplot.subplots_adjust", "matplotlib.pyplot.figure" ] ]
dstallenberg/In-Phase
[ "21ddfd089b6e4111cc54ae00607aea01fdc94329" ]
[ "src/quantum_phase_estimation/plot_results.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jan 10 13:54:18 2020\n\n@author: Mio\n\"\"\"\n\nimport matplotlib.pyplot as plt\nimport numpy as np\nfrom collections import OrderedDict\n\n\ndef plot_results(result, nancillas, qubits, p_succes):\n\tif result['raw_text'] and len(result['raw_text']) > 1:\n\t\traise E...
[ [ "matplotlib.pyplot.gca", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.xticks", "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
data-RanDan/pandas
[ "b58ee5779583b31de513b3d5c12f5c69c035e920", "b58ee5779583b31de513b3d5c12f5c69c035e920" ]
[ "pandas/tests/io/test_parquet.py", "pandas/tests/series/indexing/test_datetime.py" ]
[ "\"\"\" test parquet compat \"\"\"\nimport datetime\nfrom distutils.version import LooseVersion\nfrom io import BytesIO\nimport os\nimport pathlib\nfrom warnings import catch_warnings\n\nimport numpy as np\nimport pytest\n\nfrom pandas.compat import PY38\nimport pandas.util._test_decorators as td\n\nimport pandas a...
[ [ "pandas.Series", "pandas.MultiIndex.from_tuples", "pandas.DataFrame", "pandas.read_parquet", "numpy.random.randn", "pandas._testing.ensure_clean_dir", "pandas._testing.assert_frame_equal", "pandas.CategoricalDtype", "numpy.arange", "pandas.io.parquet.to_parquet", "panda...
johncolezhang/DeepKE
[ "ea4552ec42cb003a835f00fc14fb454f9a9a7183", "ea4552ec42cb003a835f00fc14fb454f9a9a7183" ]
[ "src/deepke/relation_extraction/few_shot/dataset/processor.py", "example/re/document/predict.py" ]
[ "import csv\nimport pickle \nimport os\nimport logging\nfrom tqdm import tqdm, trange\nfrom torch.utils.data import TensorDataset\nimport torch.nn.functional as F\nimport numpy as np\nimport torch\nfrom collections import OrderedDict\n\nfrom transformers.utils.dummy_tokenizers_objects import BertTokenizerFast\n\nlo...
[ [ "torch.utils.data.TensorDataset", "torch.tensor" ], [ "torch.load", "numpy.isnan", "torch.utils.data.DataLoader", "numpy.concatenate", "torch.no_grad", "torch.cuda.is_available" ] ]
aFewThings/personal-snippets
[ "e404bc7599f1fbd24e5c2be612ec192456989f9b", "e404bc7599f1fbd24e5c2be612ec192456989f9b", "e404bc7599f1fbd24e5c2be612ec192456989f9b" ]
[ "python, pytorch/repeat, expand.py", "python, pytorch/weight sharing (use same layer).py", "python, pytorch/mask.py" ]
[ "import torch\n\nx = torch.randn((1, 5, 5))\nprint(x)\n\nx = x.unsqueeze(1)\nprint(x)\n# expand와 repeat은 특정 차원을 복제해서 반복시킨다. \nx = x.expand(-1, 2, -1, -1) # expand는 데이터 복사가 없음\n#x = x.repeat(1, 2, 1, 1) repeat은 데이터를 복사함\nprint(x)", "import torch\nimport copy\n\nclass DynamicNet(torch.nn.Module):\n def __init__(...
[ [ "torch.randn" ], [ "torch.nn.Linear", "torch.ones" ], [ "torch.randn", "torch.arange", "torch.tensor" ] ]
ACALJJ32/MMEditing_learning
[ "d3e45133c4c6d42e7c88904ac1925eb51ae1a945" ]
[ "ACALJJ32/basicvsr_v2_backup.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import ConvModule\nfrom mmcv.runner import load_checkpoint\nfrom torch.nn.parameter import Parameter\n\nfrom mmedit.models.common import (PixelShufflePack, ResidualBlockNoBN,\n flow_warp, make_layer...
[ [ "torch.cat", "torch.zeros", "torch.sin", "torch.nn.functional.interpolate", "torch.ones", "torch.randn", "torch.nn.Sigmoid", "torch.nn.functional.pad", "torch.cos", "torch.nn.Sequential", "torch.nn.BatchNorm1d", "torch.nn.functional.avg_pool2d", "torch.nn.Conv2d...
Janderson/pandasbt
[ "e3f6826d55be05330928750209297a014976a8c5", "e3f6826d55be05330928750209297a014976a8c5" ]
[ "tests/test_calc_signal.py", "pandasbt/build_timeframe.py" ]
[ "import sys\nimport os\nimport pandas as pd\nimport pytest\n\n# Avoid error module path\nsys.path.insert(0, os.path.abspath( # noqa: E402 - Avoid flake8 error 402\n os.path.join(os.path.dirname(__file__), '..'))\n)\n\nfrom pandasbt import calc_signal\nfrom pandasbt.calc_signal import calc_return\nfrom pandasbt ...
[ [ "pandas.DataFrame" ], [ "numpy.mod", "pandas.to_datetime", "numpy.where", "pandas.TimedeltaIndex" ] ]
CSautier/metrics
[ "32389fbc03b1bbbf0b15b05c56dc1db7a90bff97", "32389fbc03b1bbbf0b15b05c56dc1db7a90bff97", "32389fbc03b1bbbf0b15b05c56dc1db7a90bff97" ]
[ "tests/classification/test_iou.py", "torchmetrics/functional/regression/mean_squared_log_error.py", "tests/retrieval/helpers.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.Tensor", "sklearn.metrics.jaccard_score", "torch.tensor", "torch.arange", "torch.allclose" ], [ "torch.log1p" ], [ "numpy.full_like", "numpy.array", "numpy.mean", "torch.cuda.is_available" ] ]
gchhablani/financial-sentiment-analysis
[ "b18e9072f8edb9f09d0fef697892f2462d6d44e9" ]
[ "src/models/lstm_model.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torch.nn.utils.rnn import PackedSequence\n\nfrom src.utils.mapper import configmapper\n\n\ndef hotfix_pack_padded_sequence(\n input, lengths, batch_first=False, enforce_sorted=False\n):\n lengths = torch.as_tensor(lengths, dtype=torch.int64)\n lengths = lengths.cp...
[ [ "torch.nn.Dropout", "torch.nn.CrossEntropyLoss", "torch.nn.LSTM", "torch.cat", "torch.nn.Embedding", "torch.nn.utils.rnn.PackedSequence", "torch.nn.Linear", "torch.sort", "torch._C._VariableFunctions._pack_padded_sequence", "torch.as_tensor" ] ]
vered1986/reporting_bias_lms
[ "f4e3a26f41db30939c899855b413bad1ebe14d21" ]
[ "outcomes/src/generate_outcomes.py" ]
[ "import tqdm\nimport json\nimport torch\nimport random\nimport argparse\n\nfrom orderedset import OrderedSet\nfrom collections import defaultdict\n\nfrom outcomes.src.common import init_model\n\n\ndef main():\n ap = argparse.ArgumentParser()\n ap.add_argument(\"--device\", default=\"cpu\", type=str, help=\"cp...
[ [ "torch.device", "torch.tensor" ] ]
RichardScottOZ/map2loop-2
[ "0260080ad33edeb7f8184f9ccb1409626c51dc9b" ]
[ "map2loop/m2l_export.py" ]
[ "# from map2loop import m2l_topology\nimport networkx as nx\nimport random\nimport numpy as np\nimport pandas as pd\nimport os\nimport geopandas as gpd\nimport rasterio\nfrom rasterio import plot\nfrom rasterio.plot import show\nfrom rasterio.mask import mask\nfrom rasterio.transform import from_origin\nfrom raster...
[ [ "numpy.nanmax", "pandas.merge", "matplotlib.colors.BoundaryNorm", "numpy.linspace", "numpy.nanmin", "numpy.zeros_like", "numpy.mean", "numpy.arange", "matplotlib.colorbar.ColorbarBase", "numpy.zeros", "pandas.concat", "numpy.genfromtxt", "numpy.transpose", "...
likeand/ml
[ "fa54cebeb9998d8aa1241445b4b9492695bb4073" ]
[ "samples/decision_tree.py" ]
[ "# -*- coding: utf-8 -*-\n# @Date : 2020/5/26\n# @Author: Luokun\n# @Email : olooook@outlook.com\n\nimport sys\nfrom os.path import dirname, abspath\n\nimport numpy as np\n\nsys.path.append(dirname(dirname(abspath(__file__))))\n\n\ndef test_decision_tree():\n from models.decision_tree import DecisionTree\n\n ...
[ [ "numpy.array", "numpy.sum" ] ]
swagat5147/wallgen
[ "33f317d073a6ddb7519d8325a35c263d08305f3f" ]
[ "tools/points.py" ]
[ "import warnings\nimport numpy as np\nfrom scipy.spatial import Delaunay\nfrom skimage.filters import sobel\nfrom skimage import color, img_as_ubyte\nfrom PIL import Image, ImageDraw, ImageFilter\n\n\ndef distance(p1, p2):\n\t(x1, y1) = p1\n\t(x2, y2) = p2\n\n\td = int((y2-y1)**2 + (x2-x1)**2)**0.5\n\treturn d\n\nd...
[ [ "scipy.spatial.Delaunay", "numpy.random.choice" ] ]