repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
anirudh-chakravarthy/SipMask
[ "fc82b12c13abb091e271eb4f1b6734da18234443" ]
[ "SipMask-mmdetection/mmdet/datasets/pipelines/loading.py" ]
[ "import os.path as osp\n\nimport mmcv\nimport numpy as np\nimport pycocotools.mask as maskUtils\n\nfrom ..registry import PIPELINES\n\n\n@PIPELINES.register_module\nclass LoadImageFromFile(object):\n\n def __init__(self, to_float32=False, color_type='color'):\n self.to_float32 = to_float32\n self.c...
[ [ "numpy.array", "numpy.ones", "numpy.zeros" ] ]
MrLogarithm/cdli-accounting-viz
[ "17d1f0d0be987104ef635e07627fa94f34dc9b7c" ]
[ "code/commodify.py" ]
[ "import json\nimport segment\nimport convert\nimport semantic\nimport data\nimport numpy as np\nimport re\nimport os\nimport oyaml\nimport gzip\n\nfrom entry import *\n\nfrom collections import defaultdict\n\n#import mariadb\nimport MySQLdb as mariadb\n\n##################################################\n# CONFIGU...
[ [ "numpy.load" ] ]
iArunava/CycleGAN
[ "73e53d7b7eb47c5a68502df442778771f19ef8a2" ]
[ "models/BNConvt.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass BNConvt(nn.Module):\n\n def __init__(self, in_channels, out_channels, kernel_size, stride,\n padding, bias=False, eps=1e-5, momentum=0.1, conv_first=True, relu=False):\n\n super(BNConvt, self).__init__()\n \n if conv_first:\n ...
[ [ "torch.nn.ReLU", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d" ] ]
jeisch/bokeh
[ "6be4d5ebbec04117f2bb0693fe64dc664f8f1bb1" ]
[ "tests/unit/bokeh/core/property/test_primitive.py" ]
[ "#-----------------------------------------------------------------------------\n# Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors.\n# All rights reserved.\n#\n# The full license is in the file LICENSE.txt, distributed with this software.\n#---------------------------------------------------------...
[ [ "numpy.int8", "numpy.uint8", "numpy.uint32", "numpy.bool8", "numpy.float16", "numpy.complex256", "numpy.uint16", "numpy.complex128", "numpy.float64", "numpy.complex64", "numpy.float32", "numpy.uint64", "numpy.int64", "numpy.int32", "numpy.int16" ] ]
NeonicPlasma/TheBrainOfTWOWCentral
[ "05a3748df0d233bcd85ee8e4edaf7d977159fd07" ]
[ "Config/_functions.py" ]
[ "import numpy as np\nimport random, string, re\nfrom Config._const import ALPHABET, OPTION_DESC, ORIGINAL_DECK\nfrom PIL import Image, ImageFont, ImageDraw, ImageChops\n\ndef alt_font(z): return ImageFont.truetype(\"Fonts/ARIALUNI.TTF\", z)\ndef default(z): return ImageFont.truetype(\"Fonts/RobotoCondensed-Regular....
[ [ "numpy.sin", "numpy.log", "numpy.arcsin", "numpy.sqrt", "numpy.cos", "numpy.deg2rad" ] ]
KwanYu/Airbnb-Backend
[ "d5d77f3541f329bbb28142d18606b22f115b7df6" ]
[ "venv/Lib/site-packages/astropy/io/ascii/tests/test_read.py" ]
[ "# -*- coding: utf-8 -*-\n# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\n\nimport re\nfrom io import BytesIO, open\nfrom collections import OrderedDict\nimport locale\nimport platform\nfrom io import StringIO\n\nimport pathlib\nimport pytest\nimport numpy as np\n\nfrom astropy.io import ascii\nf...
[ [ "numpy.all", "numpy.array" ] ]
Richard-Tarbell/polsalt
[ "e953985ffbc786fd071d0b48ebca5bd1dac9a960" ]
[ "scripts/correct_files.py" ]
[ "import os\nimport sys\nimport copy\nimport numpy as np\nfrom astropy.io import fits\n\npolsaltdir = '/'.join(os.path.realpath(__file__).split('/')[:-2])\ndatadir = polsaltdir+'/polsalt/data/'\nsys.path.extend((polsaltdir+'/polsalt/',))\n\nfrom specpolwollaston import correct_wollaston, read_wollaston\n\ndef correc...
[ [ "numpy.arange" ] ]
SammyEK/kensu-py
[ "8a210c8fe53ec28ef759aa1b43faa5f4402bea3f" ]
[ "kensu/utils/kensu.py" ]
[ "import datetime\nimport getpass\nimport json\nimport logging\nimport os\nimport time\n\nfrom kensu.client import *\nfrom kensu.utils.dsl.extractors.external_lineage_dtos import KensuDatasourceAndSchema\nfrom kensu.utils.dsl import mapping_strategies\nfrom kensu.utils.dsl.extractors import Extractors\nfrom kensu.ut...
[ [ "pandas.DataFrame" ] ]
prabhatrmishra/IDCardInfoExtr
[ "c59270f61a3251a6aff55bc7d81f2057c4663a37" ]
[ "Recognition/prepare_data.py" ]
[ "import os\nimport numpy as np \nimport cv2\nimport lmdb\nimport argparse\n\n\ncnt = 0\ndef filter_text(lang,text):\n #print(lang,text)\n unicode_range = {'odia':'[^\\u0020-\\u0040-\\u0B00-\\u0B7F]','kanada':'[^\\u0020-\\u0040-\\u0C80-\\u0CFF]',\n 'tamil':'[^\\u0020-\\u0040-\\u0B80-\\u0BFF]','malyalam':'[^\\u002...
[ [ "numpy.max", "numpy.array", "numpy.min", "numpy.shape" ] ]
Orbitery/Herzenssache_Finale_Abgabe
[ "18e726f3e8f53b92b9e87eea6758df81f515d872" ]
[ "decide.py" ]
[ "import numpy as np\ndef decider(predicted, ecg_names,data_samples,data_names, is_binary_classifier):\n \"\"\"[Prediction results are analyzed. Each ECG signal is assigned a class by majority vote. This classification is then returned.\n e.g. in an ECG signal 50 \"A heartbeats\" and 2 \"O heartbeats\" wer...
[ [ "numpy.array" ] ]
zihangdai/reexamine-srnn
[ "8f467a8267ec52e2610fc34d8f9b6536007d1243" ]
[ "speech/create_permuted_data.py" ]
[ "import os, sys\nfrom shutil import copyfile\nimport glob\nimport argparse\n\nimport torch\n\nSEED = 123456\n\ndef permute_data(data, perm):\n if isinstance(data, list):\n return list([permute_data(d, perm) for d in data])\n else:\n if data.dim() == 2:\n data = data.mean(1)\n\n ...
[ [ "torch.manual_seed", "torch.save", "torch.randperm", "torch.load" ] ]
roy-wang-py/behavioralCloning
[ "d3a28679cee78cd49ecefa3d37bbd6cdb393a16f" ]
[ "model.py" ]
[ "import os\nimport csv\nfrom keras.models import Sequential, Model\nfrom keras.layers import Cropping2D,Flatten,Lambda,Dense,Activation,Dropout,MaxPooling2D\nimport cv2\nimport numpy as np\nimport sklearn\nfrom sklearn.model_selection import train_test_split\nfrom keras.models import load_model\nfrom keras.layers.c...
[ [ "sklearn.model_selection.train_test_split", "scipy.ndimage.imread", "numpy.array", "sklearn.utils.shuffle" ] ]
TianHongZXY/Fengshenbang-LM
[ "ea13855627264a1c3d7e19d7e9d0e0ca7ab6cac4" ]
[ "fengshen/models/bart/modeling_bart.py" ]
[ "import warnings\nfrom pytorch_lightning import LightningModule\nfrom fengshen.models import transformer_utils\n\nimport torch\nimport torch.utils.checkpoint\nfrom torch import nn\nimport torch.nn.functional as F\n\nfrom dataclasses import dataclass\nfrom typing import Optional, Tuple\n\nfrom transformers.file_util...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.sigmoid", "torch.nn.MSELoss", "torch.nn.functional.linear", "torch.tensor", "torch.mean", "torch.nn.CrossEntropyLoss" ] ]
packtpartner/pymc3
[ "48cc820494ff22a3010ac2440fc1c5d28e09d87e" ]
[ "benchmarks/benchmarks/benchmarks.py" ]
[ "import time\nimport timeit\n\nimport numpy as np\nimport pandas as pd\nimport pymc3 as pm\nimport theano\nimport theano.tensor as tt\n\n\ndef glm_hierarchical_model(random_seed=123):\n \"\"\"Sample glm hierarchical model to use in benchmarks\"\"\"\n np.random.seed(random_seed)\n data = pd.read_csv(pm.get_...
[ [ "numpy.random.normal", "numpy.array", "numpy.ones_like", "numpy.random.choice", "numpy.log", "numpy.random.seed", "numpy.mean", "numpy.arange", "numpy.sqrt" ] ]
DavidHuizingh/pixelsort
[ "1f300a61d5d8ccfc0efcc44e86aa354974048684" ]
[ "Prototyping Code/array_test/arrays_and_images.py" ]
[ "\nfrom pathlib import Path\nfrom PIL import Image\nfrom time import sleep\nimport numpy as np\n\nimport skimage\n\n\n\n# F:\\GitHub\\pixelsort\\array_test\nfolder = Path(__file__).parent\ntest_image = folder / \"pixels.jpg\"\n\n\nimage = Image.open(test_image)\nimage.show()\n\nimage_np = np.array(image)\nimage_fro...
[ [ "numpy.array", "numpy.shape" ] ]
nicolaseberle/flyTracker
[ "387b64a7c92d7ecf503dfccde29d7db9efb07cfb" ]
[ "dev/pytorch_dataset_loader/removing_open_cv.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nimport torch\nfrom flytracker.utils import FourArenasQRCodeMask\nfrom torch.utils.data import DataLoader\nfrom itertools import takewhile\nimport matplotlib.pyplot as plt\nfrom torchvision.transforms.functional import rgb_to_grayscale, to_tensor\nimport cv2 a...
[ [ "torch.tensor", "torch.utils.data.DataLoader" ] ]
uncbiag/MedicalNet
[ "02507c71bd3e5ae431850f4fffa97da4900837f5" ]
[ "datasets/cbct_onthefly.py" ]
[ "'''\nDataset for training\nWritten by Whalechen\n'''\n\nimport math\nimport os\nimport random\n\nimport numpy as np\nfrom torch.utils.data import Dataset\nimport nibabel\nimport SimpleITK as sitk\nfrom scipy import ndimage\nimport blosc\nblosc.set_nthreads(1)\n\n\nclass CbctOnTheFlyDataset(Dataset):\n\n def __i...
[ [ "numpy.max", "numpy.array", "numpy.reshape", "numpy.min", "numpy.where", "scipy.ndimage.interpolation.zoom" ] ]
alexshtf/inc_prox_pt
[ "a826c7179a528757399e661c5619a68dad254711" ]
[ "examples/minibatch_cvxlin_logistic.py" ]
[ "import math\nimport torch\nfrom torch.utils.data import DataLoader, TensorDataset\n\nfrom minibatch_cvxlin import MiniBatchConvLinOptimizer, Logistic\n\n# generate a two-dimensional least-squares problem\nN = 10000\nx_star = torch.tensor([2., -5.]) # the label-generating separating hyperplane\nfeatures = torch.ra...
[ [ "torch.zeros", "torch.rand", "torch.mv", "torch.distributions.Normal", "torch.tensor", "torch.utils.data.DataLoader", "torch.zeros_like", "torch.utils.data.TensorDataset" ] ]
mayurand/deepRL-p2-Continuous-Control
[ "02b9eef254dde34c3c13f1736b4e3ef88d642f7d" ]
[ "p2_continuous-control/tests/policy_agent_reinforce.py" ]
[ "import numpy as np\nimport random\nfrom collections import namedtuple, deque\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torch.optim as optim\n\ndevice = torch.device(\"cuda:0\" if torch.cuda.is_available() else \"cpu\")\n\nclass Policy(nn.Module):\n \"\"\"\n This class im...
[ [ "torch.nn.Linear", "numpy.random.normal", "torch.from_numpy", "torch.cuda.is_available", "numpy.clip", "torch.Tensor" ] ]
dennyzz/Pathfinder-v2
[ "e7853c1b86d0c76ebbf7c1b68aa76fadcf37f7fc" ]
[ "python/misc.py" ]
[ "#import the necessary packages\nfrom picamera.array import PiRGBArray\nfrom picamera import PiCamera\nimport time\nimport cv2\nimport numpy as np\nimport motorshield\nimport VL53L0X\n\n# # initialize the camera and grab a reference to the raw camera capture\ncamera = PiCamera()\ncamera.resolution = (320, 240)\ncam...
[ [ "numpy.sin", "numpy.cos" ] ]
NeoBert/czipline
[ "e7a5e097c419bed7816d3cd6c370b5171db37b33" ]
[ "zipline/finance/risk/cumulative.py" ]
[ "#\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 required by applicable law or...
[ [ "numpy.isnan", "numpy.cov", "pandas.tseries.index.DatetimeIndex", "pandas.DataFrame", "numpy.std", "pandas.Series", "pandas.tseries.tools.normalize_date", "numpy.vstack" ] ]
epizzigoni/pandas
[ "3b66021ecb74da2c35e16958121bd224d5de5264" ]
[ "pandas/tests/indexes/period/test_period.py" ]
[ "import numpy as np\nimport pytest\n\nfrom pandas._libs.tslibs.period import IncompatibleFrequency\nimport pandas.util._test_decorators as td\n\nimport pandas as pd\nfrom pandas import (\n DataFrame,\n DatetimeIndex,\n Index,\n NaT,\n Period,\n PeriodIndex,\n Series,\n date_range,\n offse...
[ [ "pandas.DatetimeIndex", "pandas.offsets.Day", "pandas.concat", "numpy.random.random", "pandas._testing.assert_series_equal", "pandas.period_range", "pandas._testing.round_trip_pickle", "pandas.PeriodIndex", "pandas.offsets.BusinessDay", "pandas.Period", "numpy.array", ...
zilnuken/python
[ "b989f1f10b8c56b5e8a900245e6e9090a0f702e0" ]
[ "examples/command-line/pilimage.py" ]
[ "from PIL import Image # pip install Pillow\nim = Image.open('qr.jpg')\n# im.show()\n\nimport numpy\nimport dbr\nimport cv2\n\ndbr.initLicense('LICENSE-LEY')\n\nopencvImage = cv2.cvtColor(numpy.array(im), cv2.COLOR_RGB2BGR)\n\nresults = dbr.decodeBuffer(opencvImage, 0x3FF | 0x2000000 | 0x4000000 | 0x8000000 | 0x100...
[ [ "numpy.array" ] ]
pzheng2018/MutualGuide
[ "e0ea62abf128925836e4337a7fef400b135b7cbe" ]
[ "utils/box/prior_box.py" ]
[ "#!/usr/bin/python\n# -*- coding: utf-8 -*-\n\nimport torch\nimport math\nfrom math import sqrt as sqrt\nfrom itertools import product as product\n\n\ndef PriorBox(base_anchor, size, base_size):\n \"\"\"Predefined anchor boxes\"\"\"\n \n if base_size == 320:\n repeat = 4\n elif base_size == 512:\...
[ [ "torch.Tensor" ] ]
KingStorm/AutoEq
[ "832675eb960b5ea5e7746decf57adfc08da9c24d" ]
[ "frequency_response.py" ]
[ "# -*- coding: utf-8 -*_\n\nimport os\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport argparse\nimport math\nimport pandas as pd\nfrom io import StringIO\nfrom scipy.interpolate import InterpolatedUnivariateSpline\nfrom scipy.signal import savgol_filter, find_peaks, minimum_phase, firwi...
[ [ "tensorflow.compat.v1.disable_v2_behavior", "tensorflow.compat.v1.log", "numpy.tile", "numpy.min", "numpy.mean", "numpy.sign", "numpy.where", "tensorflow.compat.v1.reset_default_graph", "tensorflow.compat.v1.reduce_sum", "tensorflow.compat.v1.constant", "tensorflow.comp...
Anustup900/models
[ "a6a4402cec646925be50c768da45ae79d88c8398" ]
[ "official/vision/detection/GSOC 21/Mask RCNN/Experiments/Experiment 01/Custom Code Base/utils/generate_anchors.py" ]
[ "\n\nimport numpy as np\nfrom six.moves import range\n\n\ndef generate_anchors(base_size=16, ratios=[0.5, 1, 2],\n scales=2**np.arange(3, 6)):\n \"\"\"\n Generate anchor (reference) windows by enumerating aspect ratios X\n scales wrt a reference (0, 0, 15, 15) window.\n \"\"\"\n\n ...
[ [ "numpy.array", "numpy.round", "numpy.arange", "numpy.sqrt", "numpy.hstack" ] ]
YongBeomKim/py-finance
[ "7c7830904b67cd23c47e793e1f47a9702e7765f3" ]
[ "Chapter06/chapter_6_utils.py" ]
[ "import numpy as np\nfrom scipy.stats import norm\n\n\ndef simulate_gbm(s_0, mu, sigma, n_sims, T, N, random_seed=42, antithetic_var=False):\n '''\n Function used for simulating stock returns using Geometric Brownian Motion.\n \n Parameters\n ----------\n s_0 : float\n Initial stock price\n...
[ [ "numpy.concatenate", "numpy.zeros_like", "numpy.log", "numpy.random.seed", "numpy.exp", "numpy.mean", "numpy.polyval", "numpy.where", "numpy.polyfit", "numpy.sqrt", "numpy.cumsum", "scipy.stats.norm.cdf" ] ]
zeynepCankara/NTU_DLCV2019
[ "2dc44584ec7b9e1d84e688551eb8cef48d501b45" ]
[ "final/beto/GatedConvolution_pytorch/evaluation/inception_score/inception_score.py" ]
[ "import torch\nfrom torch import nn\nfrom torch.autograd import Variable\nfrom torch.nn import functional as F\nimport torch.utils.data\n\nfrom torchvision.models.inception import inception_v3\n\nimport numpy as np\nfrom scipy.stats import entropy\n\ndef inception_score(imgs, cuda=True, batch_size=32, resize=True, ...
[ [ "numpy.zeros", "torch.autograd.Variable", "torch.nn.functional.interpolate", "scipy.stats.entropy", "numpy.mean", "numpy.std", "torch.cuda.is_available", "torch.utils.data.DataLoader", "torch.nn.functional.softmax" ] ]
gkanapathy/neural_prophet
[ "ceabfca7a11b9501e318b78b032251601268eaeb" ]
[ "neuralprophet/forecaster.py" ]
[ "import time\nfrom collections import OrderedDict\nimport numpy as np\nimport pandas as pd\n\nimport torch\nfrom torch.utils.data import DataLoader\nimport logging\nfrom tqdm import tqdm\n\nfrom neuralprophet import configure\nfrom neuralprophet import time_net\nfrom neuralprophet import time_dataset\nfrom neuralpr...
[ [ "torch.zeros", "numpy.concatenate", "torch.cos", "numpy.log", "pandas.DataFrame", "torch.no_grad", "torch.utils.data.DataLoader", "torch.ones_like", "pandas.concat", "torch.zeros_like", "pandas.Series", "numpy.expand_dims", "torch.sum" ] ]
ramunter/dopamine_mirror
[ "711e188344b199abd925ecc3aa7c991332b3ee83" ]
[ "tests/dopamine/discrete_domains/checkpointer_test.py" ]
[ "# coding=utf-8\n# Copyright 2018 The Dopamine 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 b...
[ [ "tensorflow.gfile.Exists", "tensorflow.test.main" ] ]
DATEXIS/EntEval-1
[ "71810e6f4462bd2c12fadab1d2f3383d940f4331" ]
[ "enteval/efp.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the\n# LICENSE file in the root directory of this source tree.\n#\n\n'''\nEntity Factuality Prediction classification\n'''\nfrom __future__ import absolute_import, division, unicode_li...
[ [ "numpy.array", "numpy.vstack" ] ]
ThmCuong/IIC-Python3
[ "5a02b40ffa07b159fa7e89cf5b4ed781f4798ff1" ]
[ "code_icc/scripts/semisup/IID_semisup_STL10.py" ]
[ "from __future__ import print_function\n\nimport argparse\nimport os\nimport pickle\nimport sys\nfrom datetime import datetime\n\nimport matplotlib\nimport torch\nimport torchvision\n\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport torch.nn as nn\n\nimport code_icc.archs as archs\nfrom code_icc.arch...
[ [ "matplotlib.use", "matplotlib.pyplot.subplots", "torch.utils.data.DataLoader", "torch.load", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel" ] ]
harryputterman/Cirq
[ "b0096307da010a050d67c28fa55d1797d210b366" ]
[ "cirq/protocols/has_unitary.py" ]
[ "# Copyright 2018 The Cirq Developers\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law o...
[ [ "numpy.empty_like" ] ]
pavanteja295/few-shot
[ "96a1377c846674fb92ef35f4e4daedc7cea18b10" ]
[ "experiments/infer.py" ]
[ "\"\"\"\nScript for domain transfer experiments\n\n\"\"\"\nfrom torch.optim import Adam\nfrom torch.utils.data import DataLoader\nimport argparse\n\nfrom few_shot.models import FewShotClassifier\nfrom few_shot.datasets import OmniglotDataset, MiniImageNet, FashionDataset\nfrom few_shot.models import get_few_shot_en...
[ [ "torch.utils.data.DataLoader" ] ]
adehad/plotly.py
[ "bca292530c400c61e8b7f8a6571262a9dde43ee3" ]
[ "packages/python/plotly/plotly/tests/test_optional/test_px/test_px.py" ]
[ "import plotly.express as px\nimport numpy as np\nimport pytest\nfrom itertools import permutations\n\n\ndef test_scatter():\n iris = px.data.iris()\n fig = px.scatter(iris, x=\"sepal_width\", y=\"sepal_length\")\n assert fig.data[0].type == \"scatter\"\n assert np.all(fig.data[0].x == iris.sepal_width)...
[ [ "numpy.all", "numpy.in1d" ] ]
mlitre/Deep-Cure-Learning
[ "c3fe00d0917ea2cec2fcefc491d29ef706d99839" ]
[ "deep_cure_learning/stable.py" ]
[ "import gym\r\nimport numpy as np\r\nfrom envs.deep_cure_env import DeepCure, random_base_infect_rate, random_lifetime, ForeignCountry\r\nimport matplotlib.pyplot as plt\r\nfrom plotting import plot\r\nfrom stable_baselines3 import DQN, A2C\r\nimport torch as th \r\nfrom stable_baselines3.common.callbacks import Ev...
[ [ "numpy.sqrt" ] ]
BynaryCobweb/joliGAN
[ "a712b540b61f09691bb99406a49646dc8746cb7f" ]
[ "models/modules/cut_networks.py" ]
[ "import torch.nn as nn\nfrom .utils import init_net\nimport torch\n\nclass PatchSampleF(nn.Module):\n def __init__(self, use_mlp=False, init_type='normal', init_gain=0.02, nc=256, gpu_ids=[]):\n # potential issues: currently, we use the same patch_ids for multiple images in the batch\n super(PatchS...
[ [ "torch.nn.Linear", "torch.randperm", "torch.nn.ReLU" ] ]
jiangwenfan/pythonScripts
[ "c9004944f162af575e111522f98d4de4f59885e6" ]
[ "learnEnglish/wordsWallpaper/randomSetWords.py" ]
[ "import cv2\r\nfrom PIL import ImageFont, ImageDraw, Image\r\nimport numpy as np\r\nimport random\r\n\r\n\"\"\"\r\n读取words文件,将单词数据打乱,生成随机含有单词的背景图。\r\n\"\"\"\r\n\r\nwordsFile = \"wordsInput.txt\" # set word source file\r\ninputImage = \"imageInput.png\" # set picture output location\r\n\r\n# font color pond\r\nfon...
[ [ "numpy.array" ] ]
ruanjiandong/tensorflow
[ "8284401718fedc0c5ae1cdf19ea399efcca6c03f" ]
[ "tensorflow/python/eager/function.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.python.ops.array_ops.identity", "tensorflow.python.eager.context.context", "tensorflow.python.ops.functional_ops.partitioned_call", "tensorflow.python.util.nest.flatten", "tensorflow.python.pywrap_tensorflow.TF_FunctionToFunctionDef", "tensorflow.python.pywrap_tensorflow.TF_Get...
Knowledge-Precipitation-Tribe/Decision-tree-and-Random-forest
[ "1b7331af6e91ba4f377beba74ea88e53e7e95016" ]
[ "code/decisionTreeRegressor/decisionTreeRegressor.py" ]
[ "# -*- coding: utf-8 -*-#\n'''\n# Name: decisionTreeRegressor\n# Description: \n# Author: super\n# Date: 2020/3/17\n'''\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom sklearn.tree import DecisionTreeRegressor\n\ndef load_data():\n N = 100\n x = np.random.rand(N) * 6 - 3 # [...
[ [ "numpy.sin", "numpy.random.rand", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.legend", "numpy.random.randn", "sklearn.tree.DecisionTreeRegressor", "matplotlib.pyplot.show", "numpy.linspace" ] ]
shiminhu/jittor
[ "8aa5974fef8106d3ddea8209fb44b33cec120a09" ]
[ "python/jittor/dataset/dataset.py" ]
[ "# ***************************************************************\n# Copyright (c) 2020 Jittor. Authors: \n# Meng-Hao Guo <guomenghao1997@gmail.com>\n# Dun Liang <randonlang@gmail.com>. \n# All Rights Reserved.\n# This file is subject to the terms and conditions defined in\n# file 'LICENSE.txt', which is p...
[ [ "numpy.concatenate", "numpy.ndarray", "numpy.int32" ] ]
Klettgau/CSC-332
[ "cf0563d1230cac124ed2146ab2e211a15f216c23" ]
[ "ciphers/Hill.py" ]
[ "import string\nimport numpy\nfrom flask import jsonify\nfrom flask_restful import Resource\n\n\ndef generate_key( dimension, test_flag):\n counter = 0\n if test_flag == 1:\n return numpy.array([[23, 2, 17, 17],\n [15, 25, 21, 18],\n [21, 19, 9, 13]...
[ [ "numpy.array", "numpy.dot", "numpy.linalg.det", "numpy.where", "numpy.random.randint", "numpy.arange", "numpy.size", "numpy.linalg.inv", "numpy.mod" ] ]
jackw01/serial-grapher
[ "24d873e2274b8da14c2f0d688ab8a6d3599dc37d" ]
[ "serialgrapher/__init__.py" ]
[ "__version__ = \"0.1.0\"\n\nimport argparse\nimport time\nimport collections\nimport threading\nimport csv\n\nimport serial\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n#serialgrapher -p COM3 --y-max 100\n#serialgrapher -p COM3 -l 5000 --y-max 100 --rate-limit 0.1\n\ndef main():\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.animation.FuncAnimation" ] ]
ivandebono/nnest
[ "490b0797312c22a1019f5f400db684b1be5e8fe5" ]
[ "examples/mcmc/gauss.py" ]
[ "import os\nimport sys\nimport argparse\n\nimport numpy as np\nfrom scipy.stats import multivariate_normal\n\nsys.path.append(os.getcwd())\n\n\ndef main(args):\n\n from nnest import MCMCSampler\n\n def loglike(x):\n return multivariate_normal.logpdf(x, mean=np.zeros(args.x_dim), cov=np.eye(args.x_dim) ...
[ [ "numpy.zeros", "numpy.eye" ] ]
vincnt/tcn-audio-fx
[ "c3ca38a7975ca99f7aebebf310a016e1cbcfdf0c" ]
[ "model_utilities.py" ]
[ "import torch\nimport torch.nn as nn\n\nclass GatedActivation(nn.Module):\n def __init__(self, num_channels):\n super().__init__()\n self.num_channels = num_channels\n def forward(self, input):\n out_hidden_split = torch.split(input, self.num_channels, dim=1)\n out = torch.tanh(out...
[ [ "torch.nn.Linear", "torch.sigmoid", "torch.nn.Conv1d", "torch.nn.SiLU", "torch.split", "torch.nn.ReLU", "torch.tanh", "torch.chunk" ] ]
ITBOX-ITBOY/cvat-centos7-pg
[ "fd0c8fbc62713ef0ff619ab67c351e93cbc7dd7c" ]
[ "datumaro/tests/test_widerface_format.py" ]
[ "import os.path as osp\nfrom unittest import TestCase\n\nimport numpy as np\nfrom datumaro.components.extractor import (AnnotationType, Bbox, DatasetItem,\n Label, LabelCategories)\nfrom datumaro.components.dataset import Dataset\nfrom datumaro.plugins.widerface_format import WiderFaceConverter, WiderFaceImporte...
[ [ "numpy.ones" ] ]
joeyzhou85/python
[ "9c0cbe33076a570a3c02825b7c6d9866a760e777" ]
[ "machine_learning/linear_regression.py" ]
[ "\"\"\"\nLinear regression is the most basic type of regression commonly used for\npredictive analysis. The idea is pretty simple, we have a dataset and we have\na feature's associated with it. The Features should be choose very cautiously\nas they determine, how much our model will be able to make future predictio...
[ [ "numpy.square", "numpy.matrix", "numpy.dot", "numpy.zeros", "numpy.ones" ] ]
Golbstein/BayesianOptimization
[ "ad76e37ab21db6abea052c087e5efd34a5fbfd98" ]
[ "bayes_opt/bayesian_optimization.py" ]
[ "import warnings\nimport numpy as np\n\nfrom .target_space import TargetSpace\nfrom .event import Events, DEFAULT_EVENTS\nfrom .logger import _get_default_logger\nfrom .util import UtilityFunction, acq_max, ensure_rng\n\nfrom sklearn.gaussian_process.kernels import Matern\nfrom sklearn.gaussian_process import Gauss...
[ [ "sklearn.gaussian_process.kernels.Matern" ] ]
wmkirby1/CS-VQE
[ "9a0a7634dcb77f064957c772cf229b7103cce3a8" ]
[ "misc/legacy/fermions/yaferp/circuits/circuit.py" ]
[ "'''\nCreated on 17 Dec 2014\n\n@author: andrew\n\nprobably an inefficient strategy for all this but what the hell.\n'''\n\n'''define a general struct for gates'''\nimport string\nimport numpy\nimport scipy.sparse\nimport copy\nimport math\nfrom yaferp.general import directFermions\nimport cirq\n\n#import cPickle\n...
[ [ "numpy.full", "numpy.sin", "numpy.angle", "numpy.exp", "numpy.cos" ] ]
gautamkmr/caffe2
[ "cde7f21d1e34ec714bc08dbfab945a1ad30e92ff" ]
[ "caffe2/python/test_util.py" ]
[ "## @package test_util\n# Module caffe2.python.test_util\nfrom __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\nimport numpy as np\nfrom caffe2.python import workspace\n\nimport unittest\n\n\ndef rand_array(*dims):\n ...
[ [ "numpy.random.rand" ] ]
hotttao/gostock
[ "3aac0d9cd08d32329fde9d17109945299ed8c443" ]
[ "spider/db_tools/mysql_db.py" ]
[ "import os\nimport pandas\nfrom sqlalchemy import create_engine\n\nMYSQL_USER = os.getenv(\"MYSQL_USER\")\nMYSQL_PASSWORD = os.getenv(\"MYSQL_PASSWORD\")\nMYSQL_HOST = os.getenv(\"MYSQL_HOST\")\nMYSQL_PORT = os.getenv(\"MYSQL_PORT\")\nMYSQL_DEFAULT_DB = os.getenv(\"MYSQL_DEFAULT_DB\")\nMYSQL_DSN = os.getenv(\"MYSQL...
[ [ "pandas.read_sql" ] ]
YusukeNagasaka/Batched-SpMM
[ "bb7d1989bbf57fc3a22dfa1483749c4c6a1acad3" ]
[ "batched_call.py" ]
[ "import tensorflow as tf\nfrom tensorflow.python.framework import ops\n\nfrom tensorflow.python.framework import sparse_tensor\nfrom tensorflow.python.ops import array_ops\nfrom tensorflow.python.ops import gen_sparse_ops\nfrom tensorflow.python.ops import math_ops\nfrom tensorflow.python.ops import sparse_ops\n\nc...
[ [ "tensorflow.shape", "tensorflow.python.ops.array_ops.gather", "tensorflow.load_op_library", "tensorflow.reshape", "tensorflow.python.framework.ops.RegisterGradient", "tensorflow.python.ops.math_ops.reduce_sum", "tensorflow.python.ops.array_ops.transpose" ] ]
brendaneross/AlgoTrader2A
[ "cac938b78f8602f3aa7623b6626f54e6f3734b02" ]
[ "main.py" ]
[ "import numpy as np\r\nimport pandas as pd\r\nimport requests\r\nimport math\r\nfrom scipy import stats\r\nimport xlsxwriter\r\nfrom secrets import IEX_CLOUD_API_TOKEN\r\nfrom tabulate import tabulate\r\n\r\n\r\ndef get_stock_data(symbol):\r\n sandbox_api_url = f'https://sandbox.iexapis.com/stable/stock/{symbol}...
[ [ "pandas.DataFrame", "pandas.read_csv", "pandas.Series", "pandas.ExcelWriter" ] ]
LcpMarvel/face_recognition_backend
[ "b392e2c392b6f2ff238fc2c0d5b680f31a86c0f5" ]
[ "app/app/service/face_recognition.py" ]
[ "import numpy as np\nimport json\nimport face_recognition\nimport math\n\nfrom .face_interface import FaceInterface, FaceNotFoundException\nfrom ..config import app\nfrom ..model.face import Face\n\nclass FaceRecognition(FaceInterface):\n def encode(self, image_info):\n file = face_recognition.load_image_file(i...
[ [ "numpy.argmin" ] ]
bl6g6/nanodet_ir
[ "5ce60b9def5d1d86dd69be8def86a7ffccb25e76" ]
[ "nanodet/trainer/task.py" ]
[ "# Copyright 2021 RangiLyu.\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 to...
[ [ "torch.no_grad" ] ]
quantmew/okex-py
[ "3e96413cd4e6dd5779ff2c47b8c76be53448783d" ]
[ "okex/v5/public_api.py" ]
[ "import datetime\nfrom typing import Union, Optional, Iterable\n\nfrom .client import Client\nfrom .consts import *\nfrom .utils import enum_to_str, iterable_to_str\nfrom ..exceptions import OkexParamsException\n\nfrom .insttype import InstType\nfrom .ccytype import CcyType\n\nimport pandas as pd\n\nclass PublicAPI...
[ [ "pandas.DataFrame" ] ]
seyuboglu/meerkat
[ "3c6ee2da8b84c609804ec22ccb1a663360769347" ]
[ "tests/meerkat/ops/test_merge.py" ]
[ "\"\"\"Unittests for Datasets.\"\"\"\nimport os\nfrom typing import Dict\n\nimport numpy as np\nimport pytest\nimport torch\n\nfrom meerkat.columns.abstract import AbstractColumn\nfrom meerkat.columns.image_column import ImageColumn\nfrom meerkat.columns.list_column import ListColumn\nfrom meerkat.columns.numpy_col...
[ [ "torch.arange", "numpy.random.seed", "numpy.diff", "numpy.where", "numpy.arange" ] ]
emikoifish/woltka
[ "e4207bba3550b75bb153c7d094d0b1a577a15bc4" ]
[ "woltka/tests/test_biom.py" ]
[ "#!/usr/bin/env python3\n\n# ----------------------------------------------------------------------------\n# Copyright (c) 2020--, Qiyun Zhu.\n#\n# Distributed under the terms of the Modified BSD License.\n#\n# The full license is in the file LICENSE, distributed with this software.\n# -----------------------------...
[ [ "pandas.DataFrame", "numpy.testing.assert_array_equal", "pandas.testing.assert_frame_equal" ] ]
cabustillo13/Imagenes-microscopicas
[ "ab1a3d749cdc90e27c96a701eb6a7ce6e8e50854" ]
[ "segmentacionHistograma.py" ]
[ " # -*- coding: utf-8 -*-\n \n\"\"\" Segmentar imágenes del microscopio a través del histograma\"\"\"\n\nfrom skimage import io, img_as_ubyte, img_as_float\nfrom matplotlib import pyplot as plt\nimport numpy as np\nfrom skimage.restoration import denoise_nl_means, estimate_sigma\nfrom scipy import ndimage as nd\n\n...
[ [ "matplotlib.pyplot.show", "numpy.ones", "numpy.zeros", "matplotlib.pyplot.imshow" ] ]
thetak11/learning-kis
[ "f1c380f351a050291e092d13093f68f173f881b8" ]
[ "lkis.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n\"\"\" Learning Koopman Invariant Subspace\n (c) Naoya Takeishi, 2017.\n takeishi@ailab.t.u-tokyo.ac.jp\n\"\"\"\n\nimport numpy\nfrom scipy import linalg\nfrom chainer import link\nfrom chainer import Variable\nfrom chainer import Chain\nfrom chainer import dataset\nfrom c...
[ [ "numpy.dot", "numpy.zeros", "scipy.linalg.svd", "numpy.where", "scipy.linalg.eig", "numpy.diag" ] ]
MarchRaBBiT/pipelinex
[ "ea8def32a71752b667f9f3522acba3fd79102fe1" ]
[ "src/pipelinex/extras/decorators/pandas_decorators.py" ]
[ "from functools import wraps\nimport pandas as pd\nfrom typing import Callable, List, Union\n\nimport logging\n\nlog = logging.getLogger(__name__)\n\n\ndef log_df_summary(func: Callable) -> Callable:\n @wraps(func)\n def wrapper(df, *args, **kwargs):\n log = logging.getLogger(__name__)\n if isin...
[ [ "pandas.Timestamp" ] ]
wavelets/chainer
[ "100773c7b86e699a320e54fe43b182a4158af771" ]
[ "chainer/functions/basic_math.py" ]
[ "import math\nfrom numbers import Number\n\nimport numpy\n\nfrom chainer import cuda\nfrom chainer import function\nfrom chainer import utils\nfrom chainer.utils import type_check\nfrom chainer import variable\n\n\n# ------------------------------------------------------------------------------\n# Arithmetic\n# ---...
[ [ "numpy.sin", "numpy.log", "numpy.exp", "numpy.sign", "numpy.cos" ] ]
TwentyBN/pytorch2keras
[ "d5ef05261c40cbf14db6aa00055a90f461bb39a7" ]
[ "tests/resnet18_channels_last.py" ]
[ "import numpy as np\nimport torch\nfrom torch.autograd import Variable\nfrom pytorch2keras.converter import pytorch_to_keras\nimport torchvision\n\n\nif __name__ == '__main__':\n max_error = 0\n for i in range(10):\n model = torchvision.models.resnet18()\n for m in model.modules():\n ...
[ [ "numpy.max", "torch.FloatTensor", "numpy.random.uniform" ] ]
DavidAshraf/Logo-Classifier-
[ "0e425ab9b1dd2cff2bc1cd60ebc8235bd6c162b3" ]
[ "web app/image_utils.py" ]
[ "import torch\nimport numpy as np\nresize_size=255\nimage_size=224\nmean= np.array([0.485, 0.456, 0.406])\nstd = np.array([0.229, 0.224, 0.225])\nfrom flask import jsonify\ndef process_image(image):\n ''' Scales, crops, and normalizes a PIL image for a PyTorch model,\n returns an Numpy array\n '''\n ...
[ [ "numpy.array", "torch.exp", "torch.no_grad", "torch.from_numpy" ] ]
rizoic/fluff
[ "5887071d4e5b919438a0746be501ca75e658c31f" ]
[ "fluff/fluffio.py" ]
[ "# Copyright (c) 2012-2013 Simon van Heeringen <s.vanheeringen@ncmls.ru.nl>\n#\n# This script is free software. You can redistribute it and/or modify it under \n# the terms of the MIT License\n# \nimport os\nimport sys\nimport tempfile\n\nimport numpy as np\nimport pybedtools\n\nfrom fluff.track import Track\n\ndef...
[ [ "numpy.zeros" ] ]
alsheabi/Detection_and_classification_of_small_objects
[ "49031b5d662390fb7e9fb6f43f7d829a97d827fd" ]
[ "loss.py" ]
[ "import torch\r\nimport torch.nn as nn\r\n\r\n\r\ndef calc_iou(a, b):\r\n\r\n area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])\r\n iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])\r\n ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torch....
[ [ "torch.zeros", "torch.stack", "torch.eq", "torch.max", "torch.ne", "torch.le", "torch.clamp", "torch.unsqueeze", "torch.ones", "torch.abs", "torch.cuda.is_available", "torch.tensor", "torch.lt", "torch.log", "torch.ge", "torch.Tensor", "torch.pow...
plancky/mathematical_physics_II
[ "c912dca1a58c218ddb06dc6cbca021b03a703540" ]
[ "direction_fields.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\n\nplt.style.use(\"dark_background\")\nf = lambda t,x : np.sin(x*t)\n\nt,x = np.linspace(-5,5,10),np.linspace(-5,5,10)\nT,X = np.meshgrid(t,x)\nf_i = 1/np.sqrt(1+f(T,X)**2)\nf_j = f(t,x)/np.sqrt(1+f(T,X)**2)\nfig,ax = plt.subplots(1,1,figsize=(5,5))\nplt.quiver(T...
[ [ "numpy.sin", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.linspace", "matplotlib.pyplot.style.use", "matplotlib.pyplot.show", "matplotlib.pyplot.quiver", "numpy.meshgrid" ] ]
uc-cdis/ndh-demo
[ "a4657036aefe2cffde525ee22f17602d40c85a59" ]
[ "demo/DMID_notebook/nde_dmid_function.py" ]
[ "import matplotlib.pyplot as plt\nimport numpy as np\nimport requests\nimport json\nimport os\n\nimport warnings\nwarnings.filterwarnings('ignore')\n\n# Create a list of query variables\nsummary_order_LHV = [\n \"_study_count\",\n \"_subject_count\",\n \"_demographic_count\",\n \"_exposure_count\",\n ...
[ [ "numpy.std", "numpy.log10", "numpy.mean", "matplotlib.pyplot.figure" ] ]
connorjward/loopy
[ "752d758c61faa980b5841d92b7d5acbe4c3f8135" ]
[ "test/test_domain.py" ]
[ "__copyright__ = \"Copyright (C) 2012 Andreas Kloeckner\"\n\n__license__ = \"\"\"\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 righ...
[ [ "numpy.dtype" ] ]
SulmanK/Cyberpunk-2077-Twitter-Sentiment-Analysis
[ "eccd0b0cb2ef84808a9639031ce58c41b3c62ca2" ]
[ "App_Deployment/model/data_pull.py" ]
[ "#--------------------- Packages\r\nfrom vaderSentiment.vaderSentiment import SentimentIntensityAnalyzer\r\n\r\nimport numpy as np\r\nimport pandas as pd\r\nimport psycopg2\r\n#--------------------- Data Gathering\r\n\"\"\" Script to pull the tweets from the PostgreSQL database, retrieves the dataframe and initiali...
[ [ "pandas.DataFrame", "pandas.read_sql" ] ]
SamSamhuns/ml_linear_logistic_regression
[ "fb13f96a51d9f838cfecc382667f420d82d8bfaf" ]
[ "src/logistic_regression.py" ]
[ "import numpy as np\nimport logging\nimport sys\nfrom enum import Enum\nimport matplotlib.pyplot as plt\nfrom collections import namedtuple\nfrom tqdm import tqdm\nfrom sklearn.metrics import plot_confusion_matrix\nfrom sklearn.datasets import load_breast_cancer\nfrom sklearn.preprocessing import PolynomialFeatures...
[ [ "numpy.dot", "numpy.exp", "numpy.mean", "numpy.where", "numpy.concatenate", "numpy.log", "numpy.random.randint", "numpy.ndarray.flatten", "numpy.zeros", "matplotlib.pyplot.title", "numpy.std", "matplotlib.pyplot.style.use", "sklearn.model_selection.KFold", "...
JunguangJiang/SuperResolution
[ "f11751cffc93b7eed999eba492cd3899783fd442" ]
[ "preprocess/net_interpolation.py" ]
[ "import sys\nimport torch\nfrom collections import OrderedDict\n\"\"\"\npython net_interpolation.py [model1_path] [model2_path] [net_interp_path] [alpha]\ne.g. python net_interpolation.py ../../experiment/baseline_edsr_mse2/model/model_best.pt ../../experiment/esrgan/model/model_best.pt ../../experiment/interpolati...
[ [ "torch.save", "torch.load" ] ]
harvineet/gpytorch
[ "8aa8f1a4298ef61cfea9c4d11c75576a84ffcc3e" ]
[ "gpytorch/utils/interpolation.py" ]
[ "#!/usr/bin/env python3\n\nimport torch\nfrom .broadcasting import _matmul_broadcast_shape\n\n\nclass Interpolation(object):\n \"\"\"\n \"\"\"\n\n def _cubic_interpolation_kernel(self, scaled_grid_dist):\n \"\"\"\n Computes the interpolation kernel u() for points X given the scaled\n g...
[ [ "torch.Size", "torch.zeros", "torch.nonzero", "torch.min", "torch.arange", "torch.ones", "torch.abs", "torch.tensor", "torch.floor" ] ]
gleefe1995/KP2D
[ "adfb5a71e0e894f1b892a76d2720088a6d2e3db4" ]
[ "kp2d/utils/logging.py" ]
[ "# Copyright 2020 Toyota Research Institute. All rights reserved.\n\n\"\"\"Logging utilities for training\n\"\"\"\nimport os\n\nfrom termcolor import colored\nimport horovod.torch as hvd\nimport numpy as np\nimport torch\n\nfrom kp2d.utils.wandb import WandBLogger\n\n\ndef printcolor_single(message, color=\"white\...
[ [ "torch.device" ] ]
AleksCipri/IMNN
[ "57dd6225205a65b436931df6cee78cf1de199bcb" ]
[ "IMNN/IMNN.py" ]
[ "\"\"\"Information maximising neural network\nThis module provides the methods necessary to build and train an information\nmaximising neural network to optimally compress data down to the number of\nmodel parameters.\n\nTODO\n____\nStill some docstrings which need finishing\nSequential training for large data\nUse...
[ [ "tensorflow.exp", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow.function", "tensorflow.reshape", "tensorflow.linalg.slogdet", "tensorflow.cast", "tensorflow.einsum", "tensorflow.concat", "tensorflow.GradientTape", "tensorflow.TapeGradient", "tensorflow.subtr...
tehstu/adventofcode
[ "afd2dd4d229606411d57821431e21ab9e30a0ec4" ]
[ "2021/day1.py" ]
[ "# Advent of Code 2021\n# Day 1\n\nimport pandas as pd\n\ndf = pd.read_csv(\"day1_input.txt\", header=None)\n\nincrease = 0\n\nfor i in range(len(df.index) - 1):\n current = df[0][i]\n next = df[0][i+1]\n if next > current:\n increase += 1\n\nprint(\"Number of increases = \", increase)" ]
[ [ "pandas.read_csv" ] ]
jonjon33/sandbox
[ "33aec6dc0bada8d9fe26a6df73d45eaf34e509c6" ]
[ "python/dsbook/1.17-exercises/sudoku.py" ]
[ "'''sudokusolver'''\nfrom __future__ import print_function # want that end=''\nimport numpy as np # using ndarray instead of a traditional array/list\n\nclass Sudoku(object):\n '''sudoku game state and solver class'''\n def __init__(self):\n '''initialize the board and vars'''\n opt = input('cho...
[ [ "numpy.array" ] ]
vuiseng9/BRECQ
[ "e455d62e93c70351961f8991c913b59435bd165f" ]
[ "quant/quant_block.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\nfrom quant.quant_layer import QuantModule, UniformAffineQuantizer, StraightThrough\nfrom models.resnet import BasicBlock, Bottleneck\nfrom models.regnet import ResBottleneckBlock\nfrom models.mobilenetv2 import InvertedResidual\n\n\nclass Base...
[ [ "torch.nn.ReLU6" ] ]
xianyuMeng/nvdiffrast
[ "1004b70efbd4b852a2f61117c432b3ef3eadcb93" ]
[ "samples/torch/cube.py" ]
[ "# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.\n#\n# NVIDIA CORPORATION and its licensors retain all intellectual property\n# and proprietary rights in and to this software, related documentation\n# and any modifications thereto. Any use, reproduction, disclosure or\n# distribution of this softwa...
[ [ "numpy.matmul", "numpy.asarray", "torch.no_grad", "torch.optim.Adam", "numpy.load", "numpy.rint", "torch.from_numpy", "torch.ones", "torch.abs", "numpy.random.uniform", "torch.tensor", "numpy.repeat", "torch.mean" ] ]
tripathiaakash/transformers
[ "8e73e56cf648418e6c9701fa64ee0dd56f02cb5f" ]
[ "examples/run_language_modeling.py" ]
[ "import argparse\nimport glob\nimport logging\nimport os\nimport pickle\nimport random\nimport re\nimport shutil\nfrom typing import Dict, List, Tuple\n\nimport numpy as np\nimport torch\nfrom torch.nn.utils.rnn import pad_sequence\nfrom torch.utils.data import DataLoader, Dataset, RandomSampler, SequentialSampler\...
[ [ "torch.distributed.get_world_size", "torch.cuda.is_available", "torch.nn.DataParallel", "torch.distributed.init_process_group", "torch.manual_seed", "torch.tensor", "torch.utils.data.DataLoader", "torch.distributed.get_rank", "torch.device", "torch.cuda.manual_seed_all", ...
KwonGihyun/DiagonalGAN
[ "9e401c00e741d700f85df2c715ee11c1e66e1d1c" ]
[ "dataset.py" ]
[ "from io import BytesIO\n\n# import lmdb\nfrom PIL import Image\nfrom torch.utils.data import Dataset\nimport os\nimport torchvision.transforms as transforms\nimport random\nimport torch\n\nclass MultiResolutionDataset(Dataset):\n def __init__(self, path, resolution=8):\n\n files = os.listdir(path)\n ...
[ [ "torch.load" ] ]
maurov/xraysloth
[ "6f18ddcb02050431574693d46bcf4b89c719c40b" ]
[ "examples/xdata_tests.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\"\"\"Examples for xdata\n=====================\n\"\"\"\nimport numpy as np\n\nfrom sloth.utils.xdata import (ELEMENTS, SHELLS, LINES_DICT,\\\n LINES_K, LINES_L, LINES_M, LINES, TRANSITIONS)\n\nfrom sloth.utils.xdata import (ene_res, flu...
[ [ "numpy.interp", "numpy.mean" ] ]
yoon28/realsr-noise-injection
[ "402679490bf0972d09aaaadee3b5b9850c2a36e4" ]
[ "codes/models/SRGAN_model.py" ]
[ "import logging\nfrom collections import OrderedDict\nimport torch\nimport torch.nn as nn\nimport torch.nn.parallel as P\nfrom torch.nn.parallel import DataParallel, DistributedDataParallel\nimport models.networks as networks\nimport models.lr_scheduler as lr_scheduler\nfrom .base_model import BaseModel\nfrom model...
[ [ "torch.cat", "torch.nn.SyncBatchNorm.convert_sync_batchnorm", "torch.nn.MSELoss", "torch.nn.functional.interpolate", "torch.optim.Adam", "torch.no_grad", "torch.clamp", "torch.cuda.device_count", "torch.cuda.current_device", "torch.nn.L1Loss", "torch.nn.parallel.DataPar...
AurelienNioche/ToyPulseRecommender
[ "561c24ed7e350de90cbd3babb785ceb2eb49ebc7" ]
[ "main.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom stable_baselines3.common.env_checker import check_env\n\nfrom stable_baselines3 import PPO\nfrom stable_baselines3.ppo import MlpPolicy\n\nimport gym\nfrom gym import spaces\n\nimport serial\nimport json\n\nimport os\nimport time\n\n\nclass CustomEnv(gym....
[ [ "numpy.array", "numpy.mean" ] ]
Bob620/superman-web
[ "e13ae7305962cd348c2af74485ffa3e0b6855c02" ]
[ "backend/handlers/upload.py" ]
[ "from __future__ import absolute_import, print_function, division\nimport h5py\nimport logging\nimport numpy as np\nimport os\nimport pandas as pd\nimport time\nimport yaml\nfrom io import BytesIO, StringIO\nfrom six.moves import xrange\nfrom superman.file_io import parse_spectrum\nfrom threading import Thread\nfro...
[ [ "numpy.char.strip", "numpy.array", "numpy.array_equal", "numpy.genfromtxt", "numpy.interp", "numpy.diff", "numpy.arange", "numpy.argsort", "numpy.isfinite", "numpy.searchsorted", "pandas.read_csv", "numpy.issubdtype", "numpy.char.encode" ] ]
vishnubk/ml_tutorial_pulsars
[ "1a1b1eabbce43c39222b32974e29dfff5a722601" ]
[ "extract_pfd_features_gbncc_data3.py" ]
[ "import sys, os, glob\nsys.path.append('/home/psr/software/psrchive/install/lib/python2.7/site-packages')\nsys.path.append('/home/psr')\nimport numpy as np\nfrom ubc_AI.training import pfddata\nimport math\nimport time\nt0 = time.time()\n#pfd_files_pulsars = glob.glob('/beegfs/vishnu/scripts/neural_network/test/pul...
[ [ "numpy.save" ] ]
mgoldchild/FastMOT
[ "090c8ae357f143658fc81b1059060263105734e8" ]
[ "fastmot/flow.py" ]
[ "import logging\nimport itertools\nimport numpy as np\nimport numba as nb\nimport cv2\n\nfrom .utils.rect import to_tlbr, get_size, get_center\nfrom .utils.rect import mask_area, intersection, crop, transform\n\n\nLOGGER = logging.getLogger(__name__)\n\n\nclass Flow:\n \"\"\"\n A KLT tracker based on optical ...
[ [ "numpy.concatenate", "numpy.full", "numpy.copyto", "numpy.empty", "numpy.linalg.norm", "numpy.asarray", "numpy.sum", "numpy.rint", "numpy.where", "numpy.float32", "numpy.sqrt", "numpy.append", "numpy.empty_like" ] ]
dmilios/dirichletGPC
[ "7e460ca07005a5aed97937d2bf2a8a47b6f8051e" ]
[ "results/plot_monitoring_result.py" ]
[ "#!/usr/bin/python3\n# Copyright 2018 Dimitrios Milios, Raffaello Camoriano, \n# Pietro Michiardi,Lorenzo Rosasco, Maurizio Filippone\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 ...
[ [ "matplotlib.pylab.ylabel", "matplotlib.pylab.legend", "matplotlib.pylab.show", "matplotlib.pylab.figure", "matplotlib.pylab.xlabel", "matplotlib.pylab.ylim", "matplotlib.pylab.tight_layout", "matplotlib.pylab.title", "matplotlib.pylab.plot" ] ]
ravi-teja-mullapudi/ViZDoom
[ "7aa037fc9b25aac200f4b1496f91c8d10b30703c" ]
[ "examples/python/train_sptm/src/common/util.py" ]
[ "#!/usr/bin/env python\nimport cPickle\nimport cv2\nimport numpy as np\nimport h5py\nfrom vizdoom import *\nimport math\nimport os\nimport os.path\nimport sys\nimport random\nimport scipy.misc\n\nfrom constants import *\nfrom video_writer import *\n\nimport cv2\nimport os\nimport cPickle\nimport numpy as np\nnp.ran...
[ [ "numpy.concatenate", "numpy.array", "numpy.zeros_like", "numpy.zeros", "numpy.random.seed", "numpy.argmax" ] ]
cjg91/tinygrad
[ "32d42c2667ce7e7231fc9197f2975eafb2663935" ]
[ "models/vit.py" ]
[ "import numpy as np\nfrom tinygrad.tensor import Tensor\nfrom models.transformer import TransformerBlock\n\nclass ViT:\n def __init__(self, layers=12, embed_dim=192, num_heads=3):\n self.embedding = (Tensor.uniform(embed_dim, 3, 16, 16), Tensor.zeros(embed_dim))\n self.cls = Tensor.ones(1, 1, embed_dim)\n ...
[ [ "numpy.transpose" ] ]