repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
VISTAS-IVES/pyvistas
[ "2de1541c0fb40ccbac4014af758ff329ba0677b1" ]
[ "plugins/barchart/main.py" ]
[ "import random\nfrom io import BytesIO\n\nimport numpy\nimport wx\nfrom PIL import Image\nfrom matplotlib import pyplot\n\nfrom vistas.core.color import RGBColor\nfrom vistas.core.plugins.data import DataPlugin\nfrom vistas.core.plugins.option import Option, OptionGroup\nfrom vistas.core.plugins.visualization impor...
[ [ "matplotlib.pyplot.close", "numpy.unique", "matplotlib.pyplot.figure" ] ]
dPys/niworkflows
[ "071e3e27b6c0168a94fdb3996e63f225ab6de3bb" ]
[ "niworkflows/utils/images.py" ]
[ "\"\"\"Utilities to manipulate images.\"\"\"\nimport nibabel as nb\nimport numpy as np\n\n\ndef unsafe_write_nifti_header_and_data(fname, header, data):\n \"\"\"Write header and data without any consistency checks or data munging\n\n This is almost always a bad idea, and you should not use this function\n ...
[ [ "numpy.allclose" ] ]
VibhuJawa/mimic3-benchmarks
[ "4897d597d5ecc71d2dd2ce1ced76cae48dd50fb5" ]
[ "mimic3benchmark/util.py" ]
[ "import pandas as pd\n\ndef dataframe_from_csv(path, header=0, index_col=0):\n return pd.read_csv(path, header=header, index_col=index_col)\n" ]
[ [ "pandas.read_csv" ] ]
Jayant1234/Marsh_Ann
[ "34503f9b41df8c34cd41535207d7308f2916d4a6" ]
[ "marsh_plant_nn_predict.py" ]
[ "import numpy as np\nimport cv2\n\nimport torch\nimport torch.nn as nn\nfrom marsh_plant_dataset import MarshPlant_Dataset\n\nN_CLASSES = 7\nTHRESHOLD_SIG = 0.5\nbatch_size = 32\nbShuffle = False\nnum_workers = 8\n\n\nmodel_path = './modeling/saved_models/ResNet101_marsh_plants_20190415.torch'\n\nmodel = torch.load...
[ [ "torch.device", "numpy.empty", "numpy.savetxt", "torch.nn.Sigmoid", "torch.no_grad", "torch.utils.data.DataLoader", "torch.load" ] ]
LJJ12/Deep-Learning-for-SVD-and-Hybrid-Beamforming
[ "996e46a6b9f6a229f722708e0581a5c1e4f53146" ]
[ "my/myfun/python/learning_rate.py" ]
[ "# 初始的学习速率是0.1,总的迭代次数是1000次,如果staircase=True,那就表明每decay_steps次计算学习速率变化,更新原始学习速率,\n# 如果是False,那就是每一步都更新学习速率。红色表示False,蓝色表示True。\nimport tensorflow as tf\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nlearning_rate = 0.1 # 初始学习速率时0.1\ndecay_rate = 0.96 # 衰减率\nglobal_steps = 1000 # 总的迭代次数\ndecay_steps = 10...
[ [ "tensorflow.Session", "matplotlib.pyplot.figure", "tensorflow.constant", "matplotlib.pyplot.show", "tensorflow.train.exponential_decay" ] ]
sjm4976/KSTAR_NN_simulator
[ "1dd4d7a687d32574e6d1ddf6f3f6559492d5df4d" ]
[ "common/model_structure.py" ]
[ "import json, zipfile\nimport numpy as np\nfrom tensorflow.keras import models, layers\n\nclass k2rz():\n def __init__(self, model_path, n_models=1, ntheta=64, closed_surface=True, xpt_correction=True):\n self.nmodels, self.ntheta = n_models, ntheta\n self.closed_surface, self.xpt_correction = clos...
[ [ "numpy.array", "numpy.zeros_like", "numpy.matmul", "numpy.zeros", "numpy.argmin", "numpy.exp", "numpy.mean", "tensorflow.keras.layers.Dense", "numpy.shape", "tensorflow.keras.models.load_model", "numpy.tanh", "numpy.subtract", "numpy.argmax", "tensorflow.ker...
arturbeg/tensor2tensor
[ "43b70752311d3b8dc5f11f63d0dea3efdf8ee25b" ]
[ "tensor2tensor/utils/dgmm.py" ]
[ "import tensorflow as tf\nimport numpy as np\nfrom tensor2tensor.utils.dgmm_estimator import Estimator\nimport math\n\n\ndef dgmm(z, is_training, mixtures=3, lambda_1=0.1, lambda_2=0.005):\n \"\"\"\n :param is_training: a tensorflow placeholder to indicate whether it is in the training phase or not\n :par...
[ [ "tensorflow.exp", "tensorflow.constant_initializer", "tensorflow.diag", "tensorflow.ones_initializer", "tensorflow.matmul", "numpy.tile", "tensorflow.identity", "tensorflow.random_normal", "tensorflow.cast", "tensorflow.shape", "tensorflow.matrix_diag_part", "tensor...
AaltoML/Newt-test
[ "e3a725124eb63e9994653ed756be7ae8632f52b2" ]
[ "experiments/binary/binary.py" ]
[ "import sys\nimport bayesnewton\nimport objax\nimport numpy as np\nimport time\nimport pickle\n\nprint('generating some data ...')\nnp.random.seed(99)\nN = 10000 # number of points\nx = np.sort(70 * np.random.rand(N))\nsn = 0.01\nf = lambda x_: 12. * np.sin(4 * np.pi * x_) / (0.25 * np.pi * x_ + 1)\ny_ = f(x) + np...
[ [ "numpy.sin", "numpy.random.rand", "numpy.random.seed", "numpy.random.permutation", "numpy.math.sqrt", "numpy.random.randn", "numpy.split", "numpy.sign", "numpy.arange", "numpy.linspace" ] ]
TUIlmenauAMS/rl_singing_voice
[ "60204c698d48f27b44588c9d6c8dd2c66a13fcd5" ]
[ "nn_modules/cls_basic_conv1ds.py" ]
[ "# -*- coding: utf-8 -*-\n__author__ = 'S.I. Mimilakis'\n__copyright__ = 'MacSeNet'\n\n# imports\nimport numpy as np\nimport torch\nimport torch.nn as nn\n\n\nclass ConvEncoder(nn.Module):\n \"\"\"\n Class for building the analysis part\n of the Front-End ('Fe'), with randomly\n initialized ...
[ [ "numpy.ceil", "numpy.int", "torch.nn.init.kaiming_uniform_", "torch.nn.ConvTranspose1d", "numpy.zeros", "torch.nn.Conv1d", "torch.nn.Tanh", "torch.nn.ReLU" ] ]
NathanDai5287/AMC-10-Answer-Checker
[ "8b4226f1bc8e84be07a84da1087d293aa648c406" ]
[ "answer.py" ]
[ "from typing import Tuple\nfrom selectorlib import Extractor\nfrom pprint import pformat\nimport json\nimport requests\nimport pandas as pd\n\ndef summarize(score: int, cutoff: int, correct: dict, incorrect: dict, skipped: dict) -> str:\n\t\"\"\"formats information\n\n\tArgs:\n\t\tscore (int): score on test\n\t\tcu...
[ [ "pandas.read_html" ] ]
jzhanson/alfred
[ "d5b540e7c9b53d3f70cc2907503935fecff00018" ]
[ "models/nn/resnet.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torchvision import models, transforms\n\n\nclass Resnet18(object):\n '''\n pretrained Resnet18 from torchvision\n '''\n\n def __init__(self, args, eval=True, share_memory=False, use_conv_feat=True):\n self.model = models.resnet18(pretrained=True)\n\n ...
[ [ "torch.device", "torch.cat", "torch.set_grad_enabled" ] ]
KColdrick/pvtrace
[ "b4b99905fae0f8b16358ca4e229379b6566f6020", "b4b99905fae0f8b16358ca4e229379b6566f6020" ]
[ "pvtrace/scene/renderer.py", "pvtrace/geometry/utils.py" ]
[ "import numpy as np\nimport os\nimport time\nimport io\nfrom typing import Tuple\nfrom contextlib import contextmanager\nfrom collections import deque\nfrom anytree import LevelOrderIter, PostOrderIter\nfrom pvtrace.geometry.sphere import Sphere\nfrom pvtrace.geometry.cylinder import Cylinder\nfrom pvtrace.geometry...
[ [ "numpy.array", "numpy.column_stack", "numpy.copy" ], [ "numpy.logical_or", "numpy.array", "numpy.arccos", "numpy.dot", "numpy.linalg.norm", "numpy.errstate", "numpy.sin", "numpy.absolute", "numpy.roots", "numpy.allclose", "numpy.finfo", "numpy.any", ...
aoranwu/grace
[ "1e28915f6f6e8189ef33c0c7d8d3ce314e0a493e" ]
[ "grace_dl/dist/compressor/qsgd.py" ]
[ "import torch\nfrom grace_dl.dist import Compressor\n\n\nclass QSGDCompressor(Compressor):\n\n def __init__(self, quantum_num, bucket_size=128):\n super().__init__()\n self.quantum_num = quantum_num\n self.bucket_size = bucket_size\n\n def compress(self, tensor, name):\n shape = te...
[ [ "torch.zeros", "torch.sqrt", "torch.ones", "torch.sum", "torch.empty_like" ] ]
xinzheshen/WaveRNN
[ "f6cb1a3d6d6b58dbbba5301a88d05c1beb9230af" ]
[ "train_wavernn.py" ]
[ "import os, time\nimport numpy as np\nfrom torch import optim\nimport torch.nn.functional as F\nfrom utils.display import stream, simple_table\nfrom utils.dataset import get_vocoder_datasets\nfrom utils.distribution import discretized_mix_logistic_loss\nimport hparams as hp\nfrom models.fatchord_version import Wave...
[ [ "numpy.cumprod" ] ]
grzegorznowak/tensorflow-rrn-server
[ "1011ea465c298263fa177ba34ba0db0897985d8f" ]
[ "src/rnn_time_series_server_tests.py" ]
[ "import unittest\r\nimport requests\r\nimport rnn_time_series_server as rnn\r\nimport os\r\nimport numpy as np\r\nfrom numpy.testing import assert_array_equal\r\n\r\nclass RNNTimeSeriesServerTestRequests(unittest.TestCase):\r\n\r\n\r\n def test_predict(self):\r\n response = requests.get('http://localhost:...
[ [ "numpy.array" ] ]
BeeGass/Agents
[ "7785b010625e3a9409849a293badd00500647807" ]
[ "agents/MC/mc.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\nimport numpy as np\nimport random\nfrom collections import defaultdict\n#-------------------------------------------------------------------------\n'''\n Monte-Carlo\n In this problem, you will implememnt an AI player for Blackjack.\n The main goal of this ...
[ [ "numpy.argmax", "numpy.zeros" ] ]
ioshchepkov/gmeterpy
[ "594cf7c15193ae86b98c9474259843eeadc04f5b" ]
[ "gmeterpy/meters/tsoft.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"TSoft format reader.\n\n\"\"\"\n\nimport re\nimport numpy as np\nimport pandas as pd\n\n# possible tags in TSoft format\n_TAGS = ['TSF-file', 'TIMEFORMAT', 'COUNTINFO', 'INCREMENT', 'CHANNELS',\n 'UNITS', 'UNDETVAL', 'COMMENT', 'DATA', 'LABEL',\n 'LININTERPOL', 'CUBIN...
[ [ "pandas.to_datetime", "pandas.DataFrame", "numpy.asarray" ] ]
tphanson/tf-agent-labs
[ "c6cb79be5f0f06d9669a32439b56b4d287faeb69" ]
[ "run.py" ]
[ "import os\nimport numpy as np\nimport tensorflow as tf\n\nfrom env import CartPole\nfrom agent.dqn import DQN\n\n# Compulsory config for tf_agents\ntf.compat.v1.enable_v2_behavior()\n\n# Saving dir\nPOLICY_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),\n './models/policy')\...
[ [ "tensorflow.compat.v1.enable_v2_behavior" ] ]
TL-Rubick/tensorflow
[ "6cf1ccf6060a95aad3ccc84544d0aa166990ec72", "be084bd7a4dd241eb781fc704f57bcacc5c9b6dd", "6cf1ccf6060a95aad3ccc84544d0aa166990ec72", "6cf1ccf6060a95aad3ccc84544d0aa166990ec72" ]
[ "tensorflow/python/keras/optimizer_v2/adadelta.py", "tensorflow/python/saved_model/load_v1_in_v2.py", "tensorflow/python/data/experimental/kernel_tests/optimize_dataset_test.py", "tensorflow/python/distribute/parameter_server_strategy_v2_test.py" ]
[ "# Copyright 2018 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "numpy.array", "tensorflow.python.util.tf_export.keras_export", "tensorflow.python.keras.backend_config.epsilon", "tensorflow.python.training.gen_training_ops.ResourceSparseApplyAdadelta", "tensorflow.python.framework.ops.convert_to_tensor_v2_with_dispatch", "tensorflow.python.training.gen...
ruaruaruabick/waveglow
[ "636d2ba2bda4f4efd5f13f8e46aef23d8b7881bd" ]
[ "train.py" ]
[ "# -*- coding: utf-8 -*\n# *****************************************************************************\n# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions ...
[ [ "torch.cuda.manual_seed", "torch.optim.lr_scheduler.StepLR", "torch.no_grad", "numpy.mean", "torch.cuda.device_count", "torch.manual_seed", "torch.utils.data.DataLoader", "torch.load", "torch.utils.data.distributed.DistributedSampler" ] ]
HanxunH/MDAttack
[ "fd4107c857f11385685b6daf0de7a455749528d5" ]
[ "defense/Overfitting.py" ]
[ "'''\nBased on code from https://github.com/locuslab/robust_overfitting\n'''\nimport math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport os\nimport torchvision.transforms as tf\nfrom models.wideresnet import WideResNet\nfrom . import utils\n\nif torch.cuda.is_available():\n device ...
[ [ "torch.device", "torch.cuda.is_available", "torch.load" ] ]
vishalbelsare/zvt
[ "d55051147274c0a4157f08ec60908c781a323c8f", "d55051147274c0a4157f08ec60908c781a323c8f" ]
[ "src/zvt/recorders/joinquant/misc/jq_hk_holder_recorder.py", "src/zvt/contract/api.py" ]
[ "import pandas as pd\nfrom jqdatapy.api import run_query\n\nfrom zvt.contract.api import df_to_db, get_data\nfrom zvt.contract.recorder import TimestampsDataRecorder\nfrom zvt.domain import Index\nfrom zvt.domain.misc.holder import HkHolder\nfrom zvt.recorders.joinquant.common import to_entity_id\nfrom zvt.utils.pd...
[ [ "pandas.to_datetime", "pandas.Timestamp.now" ], [ "pandas.read_sql" ] ]
robbierobinette/rcv-tensorflow
[ "984852902f465bb6f61ba863e4b76092249911d0" ]
[ "BallotTest.py" ]
[ "import matplotlib.pyplot as plt\n\nfrom Ballot import Ballot\nfrom DefaultConfigOptions import *\nfrom PartyPrimaryElection import PartyPrimaryElection\n\n\ndef main():\n ideology = []\n for i in range(1000):\n print(\".\")\n if (i + 1) % 100 == 0:\n print(\"\")\n\n ideology.a...
[ [ "matplotlib.pyplot.xlabel", "matplotlib.pyplot.hist", "matplotlib.pyplot.show", "matplotlib.pyplot.ylabel" ] ]
mretegan/silx
[ "2c8b05ff1c8c1fc00e3d4a08331c76ff5b44996b" ]
[ "silx/gui/plot/items/curve.py" ]
[ "# coding: utf-8\n# /*##########################################################################\n#\n# Copyright (c) 2017-2020 European Synchrotron Radiation Facility\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Soft...
[ [ "numpy.array", "numpy.isfinite" ] ]
nayyarv/bayesnets
[ "090abd1a0a91c2b9d6d57a182ee5be1f65a22e11" ]
[ "tests/test_metrics.py" ]
[ "import numpy as np\nfrom swarm import metrics\nimport pytest\n\n# Example y with 11 points from -1.5 to 1.5.\ny = np.array(\n [\n -0.997495,\n -0.9320391,\n -0.78332686,\n -0.5646425,\n -0.29552022,\n 0.0,\n 0.29552022,\n 0.5646425,\n 0.78332686,\n ...
[ [ "numpy.max", "numpy.array", "numpy.min", "numpy.mean", "numpy.abs", "numpy.all" ] ]
robbisg/mvpa_itab_wu
[ "e3cdb198a21349672f601cd34381e0895fa6484c", "e3cdb198a21349672f601cd34381e0895fa6484c" ]
[ "mvpa_itab/script/misc/colors.py", "mvpa_itab/script/mambo/c2b/simulations/results-20200907.py" ]
[ "from __future__ import (absolute_import, division, print_function,\n unicode_literals)\n\nimport six\n\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom matplotlib import colors\n\n\ncolors_ = list(six.iteritems(colors.cnames))\n\n# Add the single letter colors.\nfor name, rgb in si...
[ [ "numpy.lexsort", "matplotlib.colors.hex2color", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.colors.rgb2hex", "matplotlib.colors.rgb_to_hsv" ], [ "numpy.logical_not", "numpy.logical_or", "matplotlib.animation.FuncAnimation", "pandas.concat", "...
gregunz/ml2017
[ "6235003ef849a13b1da95e4842b9cabd30b70fd3" ]
[ "project01/src/helpers.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"some helper functions for project 1.\"\"\"\r\nimport csv\r\nimport numpy as np\r\n\r\ndef load_csv_data(data_path, sub_sample=False):\r\n \"\"\"Loads data and returns y (class labels), tX (features) and ids (event ids)\"\"\"\r\n y = np.genfromtxt(data_path, delimiter=\",\", s...
[ [ "numpy.concatenate", "numpy.array", "numpy.genfromtxt", "numpy.where", "numpy.arange" ] ]
nonconvexopt/jax
[ "8b489134c818364577f630ada6aa63beefd7376a" ]
[ "tests/lax_numpy_test.py" ]
[ "# Copyright 2018 Google LLC\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed ...
[ [ "numpy.diag_indices", "numpy.triu_indices_from", "numpy.tile", "numpy.trim_zeros", "numpy.resize", "numpy.tensordot", "numpy.tril_indices", "numpy.unique", "numpy.random.random", "numpy.logspace", "numpy.full_like", "numpy.bincount", "numpy.count_nonzero", "...
jlenain/ctapipe
[ "65a6950dded44f81d5c218f4e117e1e38fce8fd4" ]
[ "ctapipe/io/tests/test_astropy_helpers.py" ]
[ "#!/usr/bin/env python3\nimport warnings\nimport numpy as np\nfrom astropy import units as u\nimport tables\nimport pytest\nfrom astropy.time import Time\n\nfrom astropy.io.fits.verify import VerifyWarning\n\nfrom ctapipe.core import Container, Field\nfrom ctapipe.containers import ReconstructedEnergyContainer, Tel...
[ [ "numpy.array", "numpy.random.default_rng", "numpy.allclose", "numpy.arange", "numpy.all", "numpy.logspace" ] ]
mysteryshen/AICIG
[ "95bd3c711bc70661bf16c88635bd2bf660b61ff5" ]
[ "batch_generator.py" ]
[ "import numpy as np\nfrom dataset import load_data\n\nclass BatchGenerator:\n TRAIN = 1\n TEST = 0\n\n def __init__(self, data_src, seed, batch_size=32, dataset='MNIST'):\n self.batch_size = batch_size\n self.data_src = data_src\n\n # Load data\n ((x, y), (x_test, y_test)) = loa...
[ [ "numpy.array", "numpy.random.shuffle", "numpy.arange", "numpy.transpose", "numpy.unique" ] ]
YuHuang42/cogdl
[ "36eafd4a2ced8a513643b99a3e63e9919c38717c", "36eafd4a2ced8a513643b99a3e63e9919c38717c" ]
[ "examples/gnn_models/grand.py", "examples/gnn_models/sgc.py" ]
[ "import torch\n\nfrom utils import print_result, set_random_seed, get_dataset\nfrom cogdl.tasks import build_task\nfrom cogdl.utils import build_args_from_dict\n\nDATASET_REGISTRY = {}\n\n\ndef build_default_args_for_node_classification(dataset):\n cpu = not torch.cuda.is_available()\n args = {\n \"lr\...
[ [ "torch.cuda.is_available" ], [ "torch.cuda.is_available" ] ]
y0ast/flax
[ "01afb539c4b91ff9e6c83ad9b5f6b36b3babffa8" ]
[ "tests/core/scope_test.py" ]
[ "# Copyright 2021 The Flax Authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or a...
[ [ "numpy.array", "numpy.ones" ] ]
TonySoloProjects/lake_analyses
[ "08a07306b4da3b85e3445732999cb0742ca03e87" ]
[ "old/numpy-examples.py" ]
[ "# fun with numpy\nimport numpy as np\n\ndef f(x,y):\n print(f'x=\\n{x}')\n print(f'y=\\n{y}')\n return x+y\n\nz = np.fromfunction(f,(4,3))\n\nprint(f'z=\\n{z}')\n" ]
[ [ "numpy.fromfunction" ] ]
sharanjeetsinghmago/online_reward_shaping
[ "55ac60f59ea6cc48fc8a788625aa50ff08453c1d" ]
[ "src/terrain.py" ]
[ "from OpenGL.GL import *\nfrom OpenGL.arrays import vbo\nfrom OpenGL.GLU import *\n\nfrom PyQt5.QtGui import QColor, QVector3D, QMatrix4x4\nfrom PyQt5.QtCore import QRect\n\nfrom shader import Shader\nfrom textures import bindHeightMap, ReadTexture, bindRewardMap, createEmptyTexture\n\nimport cv2 as cv\n\nimport nu...
[ [ "numpy.array", "numpy.zeros" ] ]
jinyeom/general-bipedal-walker
[ "fd76be55d0b29b55008846d6dfbee572a6ce8ef3" ]
[ "general_bipedal_walker/robot.py" ]
[ "import math\nimport numpy as np\nfrom Box2D.b2 import (\n edgeShape, \n circleShape, \n fixtureDef, \n polygonShape, \n revoluteJointDef, \n contactListener,\n rayCastCallback\n)\nfrom .color import Color\n\nclass Hull:\n VERTICES = [(-30, 9), (6, 9), (34, 1), (34, -8), (-30, -8)]\n\n def __init__(self, ...
[ [ "numpy.concatenate", "numpy.sign", "numpy.ones", "numpy.abs" ] ]
kinow/bcdp
[ "f4366a307672d84ed7992f3bb68a04303a107c56" ]
[ "examples/scripts/bcdp_ocw_benchmark.py" ]
[ "from contextlib import contextmanager\nfrom datetime import datetime\nimport time\nimport os\nimport glob\nimport numpy as np\nimport matplotlib\nimport pandas as pd\nmatplotlib.use('Agg')\nimport matplotlib.pyplot as plt\nimport bcdp\nimport ocw.data_source.local as local\nimport ocw.dataset_processor as dsp\nfro...
[ [ "matplotlib.use", "matplotlib.style.use", "pandas.DataFrame", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylabel" ] ]
Complicateddd/Fairmot_Adpoted
[ "576f252496f48c95be882db6dcb001882596eeac" ]
[ "src/lib/models/networks/pose_dla_dcn.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport logging\nimport math\nfrom os.path import join\n\nimport numpy as np\nimport torch\nimport torch.nn.functional as F\nimport torch.utils.model_zoo as model_zoo\nfrom torch import nn\n\nfrom .DCNv...
[ [ "numpy.array", "torch.cat", "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.init.constant_", "torch.nn.BatchNorm2d", "torch.nn.functional.interpolate", "torch.utils.model_zoo.load_url", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.lo...
IshchenkoRoman/pommerman
[ "117824dca6974822d90e8fc3345da32eeb43cb43" ]
[ "cli/run_battle.py" ]
[ "\"\"\"Run a battle among agents.\n\nCall this with a config, a game, and a list of agents. The script will start separate threads to operate the agents\nand then report back the result.\n\nAn example with all four test agents running ffa:\npython run_battle.py --agents=test::agents.SimpleAgent,test::agents.SimpleA...
[ [ "numpy.random.seed", "numpy.iinfo" ] ]
q2675315436/underwater_sub
[ "334e945f04d6c309285ffdde19384344b8180720" ]
[ "mmdet/core/post_processing/bbox_nms.py" ]
[ "import torch\nfrom mmcv.ops.nms import batched_nms\n\n\ndef multiclass_nms(multi_bboxes,\n multi_scores,\n score_thr,\n nms_cfg,\n max_num=-1,\n score_factors=None):\n \"\"\"NMS for multi-class bboxes.\n\n Args:\n ...
[ [ "torch.onnx.is_in_onnx_export", "torch.stack", "torch.masked_select" ] ]
finalelement/MONAI
[ "8e8e1b391fa649d1227087164dba208008d00bc4" ]
[ "monai/apps/mmars/mmars.py" ]
[ "# Copyright 2020 - 2021 MONAI Consortium\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n# Unless required by applicable law or agre...
[ [ "torch.jit.load", "torch.load" ] ]
zhangdongkun98/rl-lib
[ "50e36c18b130cff40abc6621923becd6cdc48e2b" ]
[ "rllib/utils/tools.py" ]
[ "\nimport torch\nimport torch.nn as nn\n\n\ndef soft_update(target, source, t):\n for target_param, source_param in zip(target.parameters(), source.parameters()):\n target_param.data.copy_( (1 - t) * target_param.data + t * source_param.data )\n\ndef hard_update(target, source):\n for target_param, sou...
[ [ "torch.nn.init.orthogonal_", "torch.no_grad", "torch.nn.init.constant_", "torch.svd" ] ]
flycoderRuan/rzq_retinanet
[ "a449398745cea8b5e53c0caecdb8039a89e77379" ]
[ "retinanet/losses.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\n\ndef calc_iou(a, b):\n area = (b[:, 2] - b[:, 0]) * (b[:, 3] - b[:, 1])\n\n iw = torch.min(torch.unsqueeze(a[:, 2], dim=1), b[:, 2]) - torch.max(torch.unsqueeze(a[:, 0], 1), b[:, 0])\n ih = torch.min(torch.unsqueeze(a[:, 3], dim=1), b[:, 3]) - torc...
[ [ "torch.zeros", "torch.stack", "torch.eq", "torch.max", "torch.ne", "torch.le", "torch.clamp", "torch.ones", "torch.unsqueeze", "torch.abs", "torch.tensor", "torch.lt", "torch.log", "torch.ge", "torch.Tensor", "torch.pow" ] ]
atb00ker/scripts-lab
[ "71a5cc9c7f301c274798686db4a227e84b65926a" ]
[ "scripts/spam-filter/LogisticRegressionModel.py" ]
[ "import pandas as pd\nimport numpy as np\n# scikit-learn\nfrom sklearn.metrics import accuracy_score, precision_score, recall_score, f1_score\nfrom sklearn.linear_model.logistic import LogisticRegression\nfrom sklearn.feature_extraction.text import (\n CountVectorizer,\n TfidfVectorizer,\n HashingVectorize...
[ [ "sklearn.metrics.accuracy_score", "sklearn.linear_model.logistic.LogisticRegression", "sklearn.feature_extraction.text.CountVectorizer", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
mlund/scipp
[ "26648fdcda49b21a7aacdafd58625fab7ee3403b" ]
[ "tests/plotting/plot_methods_test.py" ]
[ "# SPDX-License-Identifier: BSD-3-Clause\n# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)\n# @file\n# @author Neil Vaytet\n\nimport numpy as np\nimport scipp as sc\nimport matplotlib\n\nmatplotlib.use('Agg')\n\n\ndef test_plot_variable():\n v = sc.arange('x', 10.0, unit='m')\n v.plot().clos...
[ [ "matplotlib.use", "numpy.random.random" ] ]
FCeoni/astropop-1
[ "cc7fa7f5e20a7335bf30ee70f18a178222f80cd7" ]
[ "astropop/tests/test_pyutils.py" ]
[ "# Licensed under a 3-clause BSD style license - see LICENSE.rst\n\nimport sys\nimport os\nimport pytest\nfrom astropop.py_utils import mkdir_p, string_fix, process_list, \\\n check_iterable, batch_key_replace, \\\n run_command, IndexedDict\nimport numpy as ...
[ [ "numpy.arange", "numpy.ones", "numpy.array_equal", "numpy.zeros" ] ]
fmi-basel/gzenke-nonlinear-transient-amplification
[ "f3b0c8c89b42c34f1aad740c7026865cf3164f1d" ]
[ "src/Fig_6_supplement_1_Plotting.py" ]
[ "import numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom matplotlib import patches\nimport matplotlib.patches as mpatches\nimport scipy.io as sio\n\n# plotting configuration\nratio = 1.5\nfigure_len, figure_width = 15*ratio, 12*ratio\nfont_size_1, font_size_2 = 36*ratio, 36*ratio\nlegend_si...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.plot", "matplotlib.pyplot.yticks", "matplotlib.pyplot.figure", "matplotlib.pyplot.tick_params", "matplotlib.pyplot.hlines", "matplotlib.pyplot.yla...
StrangeGirlMurph/CodingProjects
[ "8400a610c0a54a2721a73824df7aab4e92ec891d" ]
[ "07-AdventOfCode2021/05/day-05.py" ]
[ "import numpy as np\n\nlines = open(\"input.txt\", \"r\").readlines()\nlines = [line[:-1] for line in lines]\nlines = [line.split(\" -> \") for line in lines]\nlines = [list(([int(num) for num in coordinate.split(\",\")]) for coordinate in line) for line in lines]\n\n# filter all diagonal\ntemplines = []\nfor idx, ...
[ [ "numpy.sum", "numpy.zeros", "numpy.diff" ] ]
ardalanghadimi/ATC
[ "cbe7eece9c7b8b316a0503f9e6e805c47f688d77" ]
[ "openmdao/recorders/sqlite_recorder.py" ]
[ "\"\"\"\nClass definition for SqliteRecorder, which provides dictionary backed by SQLite.\n\"\"\"\n\nimport io\nimport os\nimport sqlite3\n\nimport warnings\nimport numpy as np\nfrom six import iteritems\nfrom six.moves import cPickle as pickle\n\nfrom openmdao.recorders.base_recorder import BaseRecorder\nfrom open...
[ [ "numpy.load", "numpy.save" ] ]
danielmlow/composition
[ "d3de032cfe60f4b73e88b50afac78077b0af8f84" ]
[ "models/cnn41_gs.py" ]
[ "'''\nThis is based on cnn35_64. This is after the first pilot. \nChanges:\n-don't filter out # in the tokenizer, tokenize both together. or save tokenizer https://stackoverflow.com/questions/45735070/keras-text-preprocessing-saving-tokenizer-object-to-file-for-scoring\n-use 'number' w2v as representation for any d...
[ [ "matplotlib.pyplot.switch_backend", "tensorflow.set_random_seed", "numpy.array", "numpy.random.seed", "pandas.DataFrame", "numpy.round" ] ]
paulkogni/backpack
[ "3122de062d5bbcdcba8f8e02d24adb1bd2cdada6" ]
[ "examples/example_indiv_grads.py" ]
[ "\"\"\"Compute the gradient with PyTorch and the variance with BackPACK.\"\"\"\n\nfrom torch.nn import CrossEntropyLoss, Flatten, Linear, Sequential\n\nfrom backpack import backpack, extend, extensions\nfrom backpack.utils.examples import load_mnist_data\n\nB = 4\nX, y = load_mnist_data(B)\n\nprint(\"# Gradient wit...
[ [ "torch.nn.Linear", "torch.nn.CrossEntropyLoss", "torch.nn.Flatten" ] ]
MarouaJaoua/cells-nuclei-segmentation
[ "09d65db104a7297ec6f4c975b668bb7ca93c7372", "09d65db104a7297ec6f4c975b668bb7ca93c7372" ]
[ "source/model/layers/fusion_net_layers.py", "source/train/train.py" ]
[ "\"\"\"Source: https://github.com/marshuang80/cell-segmentation\"\"\"\nimport torch.nn as nn\n\n\nclass ConvLayer(nn.Module):\n def __init__(self, in_channels, out_channels, kernel_size,\n padding=1, stride=1, name=None):\n super(ConvLayer, self).__init__()\n\n block = []\n b...
[ [ "torch.nn.MaxPool2d", "torch.nn.Sequential", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.ReLU", "torch.nn.Conv2d" ], [ "torch.device", "torch.max", "torch.no_grad", "torch.optim.Adam", "torch.optim.SGD", "numpy.mean", "torch.cuda.is_availab...
carterjgreen/undergrad-thesis
[ "b6cd0270ab06eb889bd409f585f44953b1994887" ]
[ "AN24_05.py" ]
[ "# AN77_05 -- Mimo processing\nimport Class.Adf24Tx2Rx4 as Adf24Tx2Rx4\nimport Class.RadarProc as RadarProc\nimport time as time\nimport matplotlib.pyplot as plt\nfrom numpy import *\n\n# (1) Connect to DemoRad\n# (2) Enable Supply\n# (3) Configure RX\n# (4) Configure TX\n# (5) Start Measurements\n# (6) Conf...
[ [ "matplotlib.pyplot.ion", "matplotlib.pyplot.show", "matplotlib.pyplot.draw", "matplotlib.pyplot.pause", "matplotlib.pyplot.clf", "matplotlib.pyplot.imshow" ] ]
soddencarpenter/dataviz
[ "289ac890b04820acf1c0fc516e0cb502570626e4" ]
[ "ExplorePy/one.py" ]
[ "import pandas as pd\nimport numpy as np\n\ndata = np.array(['python','php','java'])\nseries = pd.Series(data)\nprint (series)\n\n# Create a Dict from a input\ndata = {'Courses' :\"pandas\", 'Fees' : 20000, 'Duration' : \"30days\"}\ns2 = pd.Series(data)\nprint (s2)\n\n\n# read the chicago temperature csv into a dat...
[ [ "numpy.array", "pandas.read_csv", "pandas.Series" ] ]
0xflotus/rembg
[ "7fb6683169d588f653281d53c3c258838194c950" ]
[ "src/rembg/u2net/detect.py" ]
[ "import errno\nimport os\nimport time\nimport urllib.request\nimport sys\n\nimport numpy as np\nimport pkg_resources\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nimport torchvision\nfrom PIL import Image\nfrom skimage import transform\nfrom torchvision import transforms\nfrom tqdm import t...
[ [ "torch.device", "numpy.array", "torch.min", "numpy.zeros", "torch.max", "torch.no_grad", "torch.cuda.is_available", "torch.load" ] ]
orestmy/Facial-Similarity-with-Siamese-Networks-in-Pytorch
[ "96570ffece22d23f82e8218147d94d49ec125722" ]
[ "src/main.py" ]
[ "import torchvision.datasets as dset\nfrom torch.utils.data import DataLoader\nimport torch\nfrom torchvision.transforms import transforms\nfrom data import SiameseNetworkDataset\nfrom helpers import Config, show_plot\nfrom models import SiameseNetwork, SoftMaxLoss\n\nclass Trainer():\n def __init__(self):\n\n ...
[ [ "torch.utils.data.DataLoader", "torch.load" ] ]
VincentLa/pandas
[ "67112b813af6c367f604366f2352c9a1bb1fedf3" ]
[ "pandas/core/indexes/interval.py" ]
[ "\"\"\" define the IntervalIndex \"\"\"\nimport textwrap\nimport warnings\n\nimport numpy as np\n\nfrom pandas.compat import add_metaclass\nfrom pandas.core.dtypes.missing import isna\nfrom pandas.core.dtypes.cast import (\n find_common_type, maybe_downcast_to_dtype, infer_dtype_from_scalar)\nfrom pandas.core.dt...
[ [ "numpy.nextafter", "pandas.core.arrays.interval.IntervalArray.from_tuples", "pandas.core.common._all_not_none", "pandas._libs.interval.IntervalMixin.__new__", "pandas.core.dtypes.cast.maybe_downcast_to_dtype", "numpy.where", "pandas.core.dtypes.cast.find_common_type", "pandas.core....
leandroaquinopereira/cnn-comparison
[ "65f45c4a44a364f97a500b38d9dced43c9f83f91" ]
[ "experiments/googlenet.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"GoogLeNet.ipynb\n\nAutomatically generated by Colaboratory.\n\nOriginal file is located at\n https://colab.research.google.com/drive/1LMqTT0uVAZgFbN6wyy5NlctyS9pb0AYo\n\n# References\n\nhttps://medium.com/mlearning-ai/implementation-of-googlenet-on-keras-d9873aeed83c\n\nhttps://ww...
[ [ "tensorflow.keras.callbacks.TensorBoard", "tensorflow.test.gpu_device_name", "tensorflow.keras.layers.Input", "tensorflow.keras.preprocessing.image_dataset_from_directory", "tensorflow.keras.layers.AveragePooling2D", "tensorflow.keras.layers.Flatten", "tensorflow.keras.callbacks.ModelC...
Babdus/Protolanguage
[ "050aeed5e7ac5905515a887dcbab434457ae2f47" ]
[ "Code/IPA/parse_IPA_single_symbols.py" ]
[ "import sys\nimport pandas as pd\nfrom collections import Counter\n\ndef main(argv):\n df = pd.io.parsers.read_csv(argv[0],index_col=0)\n # print(df)\n #\n # IPA_dict = {}\n # for i, row in df.iterrows():\n # temp_dict = {}\n # for col_name in row.index:\n # print(i, col_name...
[ [ "pandas.io.parsers.read_csv" ] ]
ashoknar/TensorNetwork
[ "82636b75a0c53b5447c84d9a4e85226fe0e6f43a" ]
[ "tensornetwork/tests/split_node_symmetric_test.py" ]
[ "# Copyright 2019 The TensorNetwork 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...
[ [ "numpy.random.seed", "numpy.testing.assert_allclose", "numpy.full", "numpy.random.randint" ] ]
sandeep-krishnamurthy/keras-mxnet-tests
[ "94772497798b98231202c26ebd49027128e41ca5" ]
[ "keras1.2/nightly_test/test_variational_autoencoder.py" ]
[ "'''\nThis code is forked from https://github.com/fchollet/keras/blob/master/examples/\nand modified to use as MXNet-Keras integration testing for functionality and sanity performance\nbenchmarking.\n\nThis script demonstrates how to build a variational autoencoder with Keras.\n\nReference: \"Auto-Encoding Variatio...
[ [ "numpy.prod" ] ]
jlpalomino/matplotcheck
[ "b225e51d645f6a6b3b7a6db139350c9ff4e22451" ]
[ "matplotcheck/timeseries.py" ]
[ "import numpy as np\nimport matplotlib.dates as mdates\nfrom dateutil.relativedelta import relativedelta\nimport math\n\nfrom .base import PlotTester\n\n\nclass TimeSeriesTester(PlotTester):\n \"\"\"A PlotTester for 2 dimensional time series plots.\n\n Parameters\n ----------\n ax: ```matplotlib.axes.Ax...
[ [ "matplotlib.dates.num2date", "numpy.isin", "numpy.testing.assert_equal" ] ]
wwoods/job_stream
[ "7bed3d9d42b8a08bcc92dfbc632f389d6ecc9b7d" ]
[ "python/job_stream/test/test_baked.py" ]
[ "\nfrom .common import ExecuteError, JobStreamTest\n\nimport pandas as pd\n\n\nclass TestBaked(JobStreamTest):\n OUT_PATH = \"/tmp/js_out.csv\"\n\n @classmethod\n def setUpClass(cls):\n src = \"\"\"\n from job_stream.inline import getCpuCount, Work\n with Work([1]) as w...
[ [ "pandas.read_csv" ] ]
hillarypan/plato
[ "181ad0e0e00b0b7486fa364200a8187d879a450e" ]
[ "plato/draw/blender/Scene.py" ]
[ "from ... import draw\nimport numpy as np\nimport bpy\n\nclass Scene(draw.Scene):\n __doc__ = draw.Scene.__doc__\n\n RENDER_COUNT = 0\n\n def render(self):\n new_scene = bpy.data.scenes.new('plato_{}'.format(self.RENDER_COUNT))\n (width, height) = self.size_pixels\n new_scene.render.re...
[ [ "numpy.max", "numpy.linalg.norm", "numpy.asarray", "numpy.sum", "numpy.atleast_2d" ] ]
asparsh/cuddly-spoon
[ "63d0a481c7274cb572ad5340d6dd2218a01d1816" ]
[ "train_neural_network.py" ]
[ "import torch\nimport torch.nn as nn\n\ndef training_routine(net,train_loader,n_iters,gpu):\n \n optimizer = torch.optim.SGD(net.parameters(),lr=0.0001,momentum=0.8)\n criterion = nn.BCELoss()\n loss_list = []\n index_list = []\n \n for j in range(n_iters): \n running_loss = 0\n ...
[ [ "torch.nn.BCELoss" ] ]
clowdr/clowdr
[ "346263ee806ae7c992a37dfc9bd9b87db3fa48c3" ]
[ "clowdr/task.py" ]
[ "#!/usr/bin/env python\n#\n# This software is distributed with the MIT license:\n# https://github.com/gkiar/clowdr/blob/master/LICENSE\n#\n# clowdr/task.py\n# Created by Greg Kiar on 2018-02-28.\n# Email: gkiar@mcin.ca\n\nfrom argparse import ArgumentParser\nfrom datetime import datetime\nfrom time import mktime, l...
[ [ "pandas.DataFrame" ] ]
DeShrike/C_python_ipc
[ "14380f6b82003585580ce452d5d5581bdf54ad07" ]
[ "sender.py" ]
[ "# http://weifan-tmm.blogspot.kr/2015/07/a-simple-turorial-for-python-c-inter.html\nimport sysv_ipc\nimport numpy as np\nimport struct\n\nBUFF_SIZE = 16\n\nfrom type_definitions import *\n\nif __name__ == \"__main__\":\n msg_string = \"sample string\\0\"\n msg_double1 = 1234.56789\n msg_double2 = 9876.1234...
[ [ "numpy.arange" ] ]
kakun45/MTADashVisualization
[ "7edac4de650c54671356a11ac91d1c1f477d33bc" ]
[ "history_of_changes/callback2-for-MTA-01-works.py" ]
[ "import dash\nimport dash_core_components as dcc\nimport dash_html_components as html\nfrom dash.dependencies import Input, Output\nimport plotly.graph_objs as go\nimport pandas as pd\n\n# get help from installed module:\n# in terminal\n# import dash_html_components as html\n# print(help(html.Div))\n\n# Create a fi...
[ [ "pandas.read_csv" ] ]
davidjwilson/pceb
[ "259cf4b18b51b7163d6ce84ab150c5f65f8cfdec" ]
[ "eg_uma/.ipynb_checkpoints/find_line-checkpoint.py" ]
[ "import numpy as np\nimport matplotlib.pyplot as plt\nimport astropy.io.fits as fits\nimport glob\nfrom astropy.table import Table\nfrom astropy.io import ascii\nfrom astropy.convolution import convolve, Box1DKernel\nimport astropy.units as u\n\nx1 = []\n\ndef on_key(event):\n global x1\n if event.key == 'w':...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.step", "matplotlib.pyplot.close", "matplotlib.pyplot.figure", "matplotlib.pyplot.show", "matplotlib.pyplot.axvline" ] ]
christiaanjs/phylo-hacking
[ "b4095995a8c789267cee4268d8e6ba107d1b8428" ]
[ "pymc/eval/variational_analysis.py" ]
[ "import numpy as np\nimport theano.tensor as tt\nfrom pylo.topology import TreeTopology\nimport pylo.transform\nimport newick\nimport pymc3 as pm\nfrom pylo.tree.coalescent import CoalescentTree, ConstantPopulationFunction\nfrom pylo.hky import HKYSubstitutionModel\nfrom pylo.pruning import LeafSequences\nimport sy...
[ [ "numpy.ones", "numpy.empty" ] ]
moneygeek/zipline
[ "c90019754d4a02d7118c181535d3932e40430633" ]
[ "zipline/utils/factory.py" ]
[ "#\n# Copyright 2016 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...
[ [ "pandas.Timestamp" ] ]
HAL-42/DeepLabV2YQ
[ "96bfcf1055da7adeb4a7c1ed841f6ec29957be59" ]
[ "python/utils/crf.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n#\n# Author: Kazuto Nakashima\n# URL: https://kazuto1011.github.io\n# Date: 09 January 2019\n\n\nimport numpy as np\nimport pydensecrf.densecrf as dcrf\nimport pydensecrf.utils as utils\n\n\nclass DenseCRF(object):\n def __init__(self, iter_max, pos_w, pos_xy_std, bi...
[ [ "numpy.ascontiguousarray", "numpy.array" ] ]
joeferg425/clarke_park_exploration
[ "9834dfbb1211f477c9dc99499f30cfb02175c302" ]
[ "clarke_park_3d.py" ]
[ "\"\"\"This python script plots the Clarke and Park Transforms.\r\n\r\nThe Transforms of three-phase helixes allow user interaction with a variety\r\nof functions variables.\r\n\r\nAuthor: joe f.\r\nGitHub: https://github.com/joeferg425\r\n\"\"\"\r\nfrom typing import Any\r\nimport numpy as np\r\nimport dash\r\nfro...
[ [ "numpy.max", "numpy.array", "numpy.sin", "numpy.zeros", "numpy.ones", "numpy.min", "numpy.einsum", "numpy.cos", "numpy.sqrt", "numpy.linspace" ] ]
omerlux/Recurrent_Neural_Network_-_Part_2
[ "afaa4f31fcaf1c9fcf97f6757263c1ed6b0fa4eb" ]
[ "mos-pytorch1.1/PTB-20201018-170341-SOTA/scripts/model.py" ]
[ "import math\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\n\n\nfrom embed_regularize import embedded_dropout\nfrom locked_dropout import LockedDropout\nfrom weight_drop import WeightDrop\n\nclass RNNModel(nn.Module):\n \"\"\"Container module with an encoder, a recurrent module, and a dec...
[ [ "torch.nn.Linear", "torch.nn.LSTM", "torch.nn.ModuleList", "torch.nn.Tanh", "torch.LongTensor", "torch.nn.functional.softmax", "torch.nn.Embedding" ] ]
yangliu-re/nasbench
[ "bfd4328afc24727d1e7d5e33f8d8839310101830" ]
[ "nasbench/lib/model_builder.py" ]
[ "# Copyright 2019 The Google Research 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 applicab...
[ [ "tensorflow.reshape", "tensorflow.gradients", "tensorflow.compat.v1.trainable_variables", "tensorflow.compat.v1.train.piecewise_constant", "tensorflow.control_dependencies", "tensorflow.compat.v1.layers.dense", "tensorflow.one_hot", "tensorflow.identity", "tensorflow.cast", ...
ecohydro/GlobalUrbanHeat
[ "0590fc16420f32cbe834f1838745d6e7e9704132" ]
[ "src/json_to_csv.py" ]
[ "##################################################################################\n#\n# Trends\n# By Cascade Tuholske July 2021\n#\n# Write json outputs to .csv\n#\n#################################################################################\n\n# Depedencies\nimport pandas as pd\nimport os \nimport glo...
[ [ "pandas.read_json" ] ]
Meatplay/steam-vr-wheel
[ "01d02d9036d5a718b570b5a3316d9a3989f0f7f2" ]
[ "steam_vr_wheel/_wheel.py" ]
[ "from collections import deque\r\nfrom math import pi, atan2, sin, cos\r\n\r\nimport numpy as np\r\nimport openvr\r\nimport os\r\nimport copy\r\n\r\nfrom steam_vr_wheel._virtualpad import VirtualPad, RightTrackpadAxisDisablerMixin\r\nfrom steam_vr_wheel.pyvjoy import HID_USAGE_X\r\n\r\n\r\n\r\nFULLTURN = 4\r\n\r\n\...
[ [ "numpy.cumsum", "numpy.array", "numpy.diff" ] ]
Swanson-Hysell-Group/2018_Midcontinent_Rift
[ "9dfa585fb43a2305ed284f306801fdda7db5a055" ]
[ "Code/bayesian_inversion/kewee_inversion/apw_path.py" ]
[ "from __future__ import print_function\nimport os, sys\nimport numpy as np\nimport scipy.stats as st\nimport pandas as pd\n\nsys.path.append(os.path.abspath('../mcplates'))\nimport mcplates\n\n# Shift all longitudes by 180 degrees to get around some plotting\n# issues. This is error prone, so it should be fixed eve...
[ [ "pandas.read_csv" ] ]
GekFreeman/SparrowRecSys
[ "4592dd7fa556e9ee30512ca244b81885d045ba02" ]
[ "TFRecModel/src/com/wzhe/sparrowrecsys/offline/tensorflow/DeepFM.py" ]
[ "import tensorflow as tf\n\n# Training samples path, change to your local path\nTRAIN_DATA_URL = \"file:///Users/zhewang/Workspace/SparrowRecSys/src/main/resources/webroot/sampledata/modelSamples.csv\"\nsamples_file_path = tf.keras.utils.get_file(\"modelSamples.csv\", TRAIN_DATA_URL)\n\n\n# load sample as tf datase...
[ [ "tensorflow.feature_column.categorical_column_with_identity", "tensorflow.keras.utils.get_file", "tensorflow.keras.layers.Input", "tensorflow.keras.layers.DenseFeatures", "tensorflow.feature_column.categorical_column_with_vocabulary_list", "tensorflow.feature_column.numeric_column", "t...
numenic/pyNastran
[ "fd5d3f0bf18db6595d85b9ac152f611e23122a68", "fd5d3f0bf18db6595d85b9ac152f611e23122a68" ]
[ "pyNastran/op2/tables/oes_stressStrain/real/oes_bend.py", "pyNastran/bdf/cards/elements/beam.py" ]
[ "from itertools import cycle\nimport numpy as np\n\nfrom pyNastran.utils.numpy_utils import integer_types\nfrom pyNastran.op2.tables.oes_stressStrain.real.oes_objects import (\n StressObject, StrainObject, OES_Object)\nfrom pyNastran.f06.f06_formatting import write_floats_13e, write_floats_8p1e\n\n\nclass RealBe...
[ [ "numpy.allclose", "numpy.array_equal", "numpy.zeros" ], [ "numpy.full", "numpy.array", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros" ] ]
catalystneuro/brody-lab-to-nwb
[ "bb792591eae988b2dec1a3a608979832da8f884d" ]
[ "brody_lab_to_nwb/interfaces/customsortingextractor.py" ]
[ "import numpy as np\n\nimport spikeextractors as se\n\n\nclass CustomSortingExtractor(se.SortingExtractor):\n extractor_name = \"custom\"\n is_writable = False\n\n def __init__(self):\n super().__init__()\n self._units = {}\n self.is_dumpable = False\n\n def set_sampling_frequency(s...
[ [ "numpy.where", "numpy.array" ] ]
Inevitable-Marzipan/pandas
[ "ff50b46045886604dd70438f73df7bf9da3da89b" ]
[ "pandas/core/nanops.py" ]
[ "import functools\nimport itertools\nimport operator\nfrom typing import Any, Optional, Tuple, Union\n\nimport numpy as np\n\nfrom pandas._config import get_option\n\nfrom pandas._libs import iNaT, lib, tslibs\nfrom pandas.compat._optional import import_optional_dependency\n\nfrom pandas.core.dtypes.cast import _in...
[ [ "pandas._libs.tslibs.Timedelta", "numpy.where", "numpy.iscomplexobj", "numpy.apply_along_axis", "pandas.core.dtypes.common.is_float_dtype", "pandas.core.dtypes.common.is_any_int_dtype", "pandas.core.dtypes.cast.maybe_upcast_putmask", "pandas.core.dtypes.common.is_datetime64_dtype",...
vadim0x60/mimic3-benchmarks
[ "2f6fa1ff32ac8b75b9bb0c900fea14124a6976f2" ]
[ "mimic3models/multitask/main.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import print_function\n\nfrom mimic3models.multitask import utils\nfrom mimic3benchmark.readers import MultitaskReader\nfrom mimic3models.preprocessing import Discretizer, Normalizer\nfrom mimic3models import metrics\nfrom mimic3models import keras_utils\nfro...
[ [ "numpy.equal", "numpy.array" ] ]
liyingben/kaggle-airbus-ship-detection
[ "21d89b2f1273b31a6ffafb4fe5f7e643ffbbc567" ]
[ "src/models/linknet.py" ]
[ "from collections import OrderedDict\nimport torch.nn as nn\nimport torchvision.models as models\n\n\nclass LinkNet(nn.Module):\n def __init__(self, num_classes, resnet_size=18, pretrained_encoder=True):\n super().__init__()\n self.num_classes = num_classes\n\n # The LinkNet encoder is a Res...
[ [ "torch.nn.ReLU", "torch.nn.BatchNorm2d", "torch.nn.ConvTranspose2d", "torch.nn.Conv2d" ] ]
isaacsultan/comp-550
[ "24e7d22a6f998a94ad6eb020f1df13970da4b150" ]
[ "src/models/glove_filter.py" ]
[ "import pickle\r\nimport csv\r\nimport os\r\n\r\nimport pandas as pd\r\nimport numpy as np\r\n\r\nfrom util.params import Params\r\n\r\n\r\ndef filter_glove(word_indices_path, filtered_output):\r\n\r\n print(\"Read files...\")\r\n iterator = pd.read_csv('data/glove.42B.300d.txt', header=None, index_col=0, \r\...
[ [ "pandas.DataFrame", "pandas.read_csv" ] ]
xihuaiwen/chinese_bert
[ "631afbc76c40b0ac033be2186e717885246f446c" ]
[ "code_examples/tensorflow/cosmoflow/models/cosmoflow.py" ]
[ "\"\"\"Configurable model specification for CosmoFlow\"\"\"\n\nimport tensorflow as tf\nimport tensorflow.keras.layers as layers\n\nfrom .layers import scale_1p2\n\n\ndef build_model(input_shape, target_size,\n conv_size=16, kernel_size=2, n_conv_layers=5,\n fc1_size=128, fc2_size=64,\...
[ [ "tensorflow.keras.layers.Lambda", "tensorflow.keras.layers.Flatten", "tensorflow.keras.layers.Conv3D", "tensorflow.keras.layers.Dense", "tensorflow.keras.layers.Dropout", "tensorflow.keras.models.Sequential" ] ]
JIAQING-XIE/Google_NLP_DL
[ "45f45e8cbca695ad079af58790edd0619783b0c2" ]
[ "9.11/tor/model_lstm/lstm.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom config import *\nfrom torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence\n\nclass LSTM(nn.Module):\n def __init__(self, vocab_size, embedding_size, word_embedding_matrix):\n super(LSTM, self).__init__()\n\n ...
[ [ "torch.nn.Linear", "torch.nn.Embedding.from_pretrained", "torch.nn.Dropout", "torch.nn.LSTM", "torch.max", "torch.nn.init.xavier_uniform_", "torch.from_numpy", "torch.nn.functional.log_softmax", "torch.nn.functional.softmax", "torch.randn" ] ]
acumos/acumos-c-client
[ "717e97e10c04fead31cb116a1dd30342cde3b726" ]
[ "acumos_cpp/tests/test_protogen.py" ]
[ "# -*- coding: utf-8 -*-\n# ===============LICENSE_START=======================================================\n# Acumos Apache-2.0\n# ===================================================================================\n# Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.\n# =...
[ [ "pandas.DataFrame", "numpy.sum" ] ]
selonsy/MachineLearning
[ "4e1be16aeab6a312511206751e9c168963d31839", "4e1be16aeab6a312511206751e9c168963d31839" ]
[ "asimo/train/Config.py", "asimo/Z_DaSiamRPN/utils.py" ]
[ "\"\"\"\nConfiguration for training SiamFC and tracking evaluation\nWritten by Heng Fan\n\"\"\"\nimport numpy as np\n\nclass Config:\n def __init__(self):\n\n\n self.show_interval = 100 # 用于多久显示一次训练的信息\n self.anchor_scales = np.array([32, 64, 128, 256]) # np.array([8, ]) siameseRPN; siamFPN: 32, ...
[ [ "numpy.array" ], [ "numpy.array", "numpy.linalg.norm", "numpy.array_equal", "numpy.zeros", "torch.is_tensor", "numpy.mean", "torch.from_numpy", "torch.squeeze", "numpy.transpose", "numpy.sqrt" ] ]
DiegoOrtegoP/Software
[ "4a07dd2dab29db910ca2e26848fa6b53b7ab00cd", "4a07dd2dab29db910ca2e26848fa6b53b7ab00cd" ]
[ "catkin_ws/src/f23-LED/led_detection/include/led_detection/LEDDetector_forloops.py", "catkin_ws/src/ros_cap/src/line_detector.py" ]
[ "from api import LEDDetector\nfrom duckietown_msgs.msg import Vector2D, LEDDetection, LEDDetectionArray\nfrom led_detection import logger\nfrom math import floor, ceil\nimport numpy as np\nimport rospy\nimport time\n\n# plotting \nimport matplotlib.pyplot as plt\nimport matplotlib.cm as cm\nfrom matplotlib.patches ...
[ [ "numpy.mean", "numpy.sign", "matplotlib.patches.Rectangle", "numpy.ndindex", "matplotlib.pyplot.subplots", "numpy.swapaxes", "numpy.argmax", "matplotlib.pyplot.gca", "numpy.array", "matplotlib.pyplot.title", "matplotlib.pyplot.figure", "scipy.ndimage.filters.maximum...
solapark/frcnn_keras_original
[ "3561d1de18f41868efc9cec927761613d75a5dc3" ]
[ "utils.py" ]
[ "import cv2\nimport numpy as np\n\ndef get_concat_img(img_list, cols=3):\n rows = int(len(img_list)/cols)\n hor_imgs = [np.hstack(img_list[i*cols:(i+1)*cols]) for i in range(rows)]\n ver_imgs = np.vstack(hor_imgs)\n return ver_imgs\n\ndef draw_box(image, box, color = (0, 255, 0)):\n x1, y1, x2, y2 = ...
[ [ "numpy.square", "numpy.zeros", "numpy.argmin", "numpy.hstack", "numpy.vstack" ] ]
qxzcode/aoc_2019
[ "5a6ae570d4ec62a1e05456b58562cb05d1c10f71" ]
[ "08/second.py" ]
[ "import sys # argv\nimport numpy as np\n\n\n# load the input file\nwith open(sys.argv[1]) as f:\n arr = np.array([int(d) for d in f.read().strip()])\n\nwidth = int(sys.argv[2])\nheight = int(sys.argv[3])\narr = arr.reshape(-1, height, width)\n\nfirst_non2 = np.vectorize(lambda arr: arr[np.where(arr != 2)[0][0]],...
[ [ "numpy.where", "numpy.apply_along_axis" ] ]
mathcbc/nn_robust_attacks
[ "5c80091dcf2b80d6d22af8e5e1b103218c36e889" ]
[ "setup_inception.py" ]
[ "## Modified by Nicholas Carlini to match model structure for attack code.\n## Original copyright license follows.\n\n\n# Copyright 2015 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 Lic...
[ [ "numpy.array", "tensorflow.app.flags.DEFINE_integer", "tensorflow.app.flags.DEFINE_string", "tensorflow.GraphDef", "tensorflow.gfile.Exists", "tensorflow.import_graph_def", "tensorflow.Session", "tensorflow.reshape", "tensorflow.gfile.GFile", "tensorflow.placeholder", "...
odidev/cmdstanpy
[ "49f00baff21bfd11541b3c98a5f2fb36e6b7d9ce" ]
[ "cmdstanpy/cmdstan_args.py" ]
[ "\"\"\"\nCmdStan arguments\n\"\"\"\nimport logging\nimport os\nfrom enum import Enum, auto\nfrom numbers import Integral, Real\nfrom time import time\nfrom typing import List, Union\n\nfrom numpy.random import RandomState\n\nfrom cmdstanpy.utils import (\n cmdstan_path,\n cmdstan_version_at,\n get_logger,\...
[ [ "numpy.random.RandomState" ] ]
yhyeh/LG-FedAvg
[ "f64a2943c7f1fed214412033e0fa0a63f3c03fb8" ]
[ "main_local.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# Python version: 3.6\n\nimport copy\nimport os\nimport pickle\nimport pandas as pd\nimport numpy as np\nimport torch\nfrom torch import nn\nfrom torch.utils.data import DataLoader\n\nfrom utils.options import args_parser\nfrom utils.train_utils import get_data, get_...
[ [ "pandas.DataFrame", "numpy.array", "torch.cuda.is_available", "torch.nn.CrossEntropyLoss" ] ]
psridhar-asapp/espnet
[ "7825783ef60cfe6b3a218d58008cafbe71559a11" ]
[ "utils/convert_fbank_to_wav.py" ]
[ "#!/usr/bin/env python3\n\n# Copyright 2018 Nagoya University (Tomoki Hayashi)\n# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)\n\nimport argparse\nimport logging\nimport os\n\nfrom distutils.version import LooseVersion\n\nimport librosa\nimport numpy as np\nfrom scipy.io.wavfile import write\n\nfrom es...
[ [ "numpy.dot", "numpy.random.rand", "numpy.linalg.pinv", "numpy.power", "numpy.abs", "numpy.iinfo" ] ]
simpeg/geosci-labs
[ "0963c5766477e59af6625954036f580481cfaf82" ]
[ "geoscilabs/em/DipoleWidget1D.py" ]
[ "from __future__ import print_function\nfrom __future__ import absolute_import\nfrom __future__ import unicode_literals\n\nimport numpy as np\nfrom SimPEG import electromagnetics as EM\nimport matplotlib.pyplot as plt\nimport matplotlib.ticker as ticker\nimport matplotlib\nimport matplotlib.gridspec as gridspec\n\n...
[ [ "numpy.ones_like", "matplotlib.pyplot.figure", "numpy.arange", "matplotlib.pyplot.tight_layout", "numpy.abs", "numpy.linspace", "matplotlib.pyplot.subplot" ] ]
mihirp1998/sbnet_3d_tensorflow
[ "2a990c6e16d33b5b89815c9543819a3e42ebab1d" ]
[ "sbnet_tensorflow/benchmark/sparse_conv_lib.py" ]
[ "\"\"\"\n\n Sparse Blocks Network\n Copyright (c) 2017, Uber Technologies, Inc.\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENS...
[ [ "tensorflow.contrib.layers.batch_norm", "tensorflow.nn.conv2d", "tensorflow.load_op_library", "tensorflow.matmul", "tensorflow.ones_like", "numpy.tile", "tensorflow.reshape", "tensorflow.scatter_nd", "tensorflow.zeros_like", "tensorflow.stack", "tensorflow.greater", ...
wollbo/threshold
[ "378a32260fe4f4c5fa481138f778398427fb82e3" ]
[ "main.py" ]
[ "import numpy as np\nimport argparse\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom lightgbm import LGBMClassifier\nfrom sklearn import metrics, model_selection\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn.pipeline import make_pipeline\nfrom data import core\n\n\ndef arg_parse():\n ...
[ [ "matplotlib.pyplot.xlim", "matplotlib.pyplot.savefig", "numpy.arange", "numpy.around", "matplotlib.use", "matplotlib.pyplot.close", "matplotlib.pyplot.hist", "matplotlib.rcParams.update", "sklearn.model_selection.train_test_split", "matplotlib.pyplot.axvline", "matplotl...
EnsembleGovServices/Kamodo-ccmc-readers
[ "75841f7ad832997159046d4b2523e0a244316e9d" ]
[ "kamodo_ccmc/flythrough/SF_utilities.py" ]
[ "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Fri Apr 23 17:09:14 2021\r\n\r\n@author: rringuet\r\n\r\nMost needed functions to support the SatelliteFlythrough and SingleSatelliteFlythrough\r\nsoftwares. The corresponding height function to be inverted by CalcIlev\r\nwill need to be labeled H_ilev for ilev, H_il...
[ [ "numpy.array", "numpy.isnan", "numpy.float64", "numpy.where", "numpy.abs", "numpy.linspace", "numpy.unique" ] ]
711e/mmdetection
[ "89da8dbe4dbcfd7c92a184d54c7c87675e49c70c" ]
[ "mmdet/models/anchor_heads/ssd_head.py" ]
[ "import numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom mmcv.cnn import xavier_init\n\nfrom mmdet.core import (AnchorGenerator, anchor_target, weighted_smoothl1,\n multi_apply)\nfrom .anchor_head import AnchorHead\nfrom ..registry import HEADS\n\n\n@HEA...
[ [ "torch.cat", "torch.nn.ModuleList", "torch.nn.functional.cross_entropy", "torch.nn.Conv2d", "torch.LongTensor", "numpy.sqrt", "numpy.floor" ] ]