repo_name
stringlengths
6
130
hexsha
list
file_path
list
code
list
apis
list
cjvilla/Project-2
[ "5e575abec6d2eb0c298fda6e5561cdc8deb2363b" ]
[ "combined/app.py" ]
[ "from flask import Flask, render_template, redirect, jsonify, request, url_for, request\nfrom sqlalchemy import create_engine\nimport sqlite3 as lite\nimport pandas as pd\nimport json \nimport folium\nfrom folium import plugins\nimport ipywidgets\nimport geocoder\nimport geopy\nimport plotly.express as px\n\n\napp ...
[ [ "pandas.read_csv", "pandas.read_sql_query" ] ]
salvacarrion/fairseq
[ "009552b09d8e2a66706cfe0474af6db4ff1e41d0" ]
[ "fairseq/tasks/translation.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nfrom dataclasses import dataclass, field\nimport itertools\nimport json\nimport logging\nimport os\nfrom typing import Optional\nfro...
[ [ "torch.is_tensor", "numpy.array" ] ]
MarcWong/matlabTools
[ "183b437707e2a9ddf7a8b5be0a4e874109fcfaa7" ]
[ "pythonUtils/coco_processor.py" ]
[ "# Author: Tao Hu <taohu620@gmail.com>\n\nfrom pycocotools.coco import COCO\nfrom pycocotools import mask\nfrom tensorpack.utils.segmentation.segmentation import visualize_label\nimport numpy as np\n\n\n\ncoco_dataset = \"/data1/dataset/coco/2014\"\ndetection_json_train = \"/data2/dataset/annotations/instances_trai...
[ [ "numpy.where", "numpy.zeros" ] ]
DIG-Beihang/PSN
[ "3d4d469bb2439a59a9e77c9135de2f2c5675494f" ]
[ "lib/model/utils/net_utils.py" ]
[ "# coding:utf-8\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F\nfrom torch.autograd import Variable,Function\nimport numpy as np\nimport torchvision.models as models\nfrom model.utils.config import cfg\nfrom model.roi_crop.functions.roi_crop import RoICropFunction\nimport cv2\nimport pdb\ni...
[ [ "torch.cat", "torch.sqrt", "torch.stack", "numpy.asarray", "torch.arange", "numpy.minimum", "numpy.round", "torch.randperm", "torch.abs", "torch.nn.functional.grid_sample", "torch.nn.functional.max_pool2d", "torch.randn", "torch.pow" ] ]
rphilipzhang/AI-blog
[ "4eecce51e2a24763baf1274e19e374891952d2aa" ]
[ "CartPole-basic.py" ]
[ "# OpenGym CartPole-v0\n# -------------------\n#\n# This code demonstrates use of a basic Q-network (without target network)\n# to solve OpenGym CartPole-v0 problem.\n#\n# Made as part of blog series Let's make a DQN, available at: \n# https://jaromiru.com/2016/10/03/lets-make-a-dqn-implementation/\n# \n# author: J...
[ [ "numpy.array", "numpy.amax", "numpy.zeros" ] ]
CBIIT/nci-hitif
[ "2f825cbcba92ff2fdffac60de56604578f31e937" ]
[ "utils/profile/watershed/util/input/watershed_infer_profile.py" ]
[ "from remove_large_objects import *\nfrom skimage.morphology import remove_small_objects\nfrom skimage.segmentation import watershed\nfrom skimage.measure import label\nfrom skimage.morphology import closing, disk\nfrom skimage.transform import resize\nimport configparser\n# import tensorflow as tf\nfrom keras.mode...
[ [ "numpy.array", "numpy.zeros", "numpy.lib.pad", "numpy.load", "numpy.stack", "numpy.amax", "numpy.swapaxes", "numpy.transpose", "numpy.squeeze", "numpy.expand_dims" ] ]
basflearn/ensemble
[ "d8346edd3c82c08154589024f3c8e7fa91cf7077" ]
[ "basf/extract_submol.py" ]
[ "#!/usr/bin/python\n\n# MIT License\n#\n# Copyright (c) 2018 Stefan Chmiela\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the r...
[ [ "numpy.savez_compressed" ] ]
Anonymous9999999/Pretrain-via-MTC
[ "bc47c162aecb68708b68d8ff7c9bfd54b0fc485e" ]
[ "game_seq_embedder/app/run_finetune.py" ]
[ "import argparse\nimport h5py\nimport sys\nfrom torch import optim\nimport random\nimport ipdb\n\nsys.path.append('..')\nfrom game_seq_embedder import init_behavior_sequence_embedder\n\n\n# [BPE, Use Time Embedding]\n# python run_finetune.py --model_dir /home/iamlxb3/temp_rsync_dir/game_bert/bert_model/game_bert_ti...
[ [ "torch.optim.SGD" ] ]
justinxu421/224n-project
[ "d7782ec15ca944c67b3808fd55b7fa11a2f5124e" ]
[ "NMT_Analogies/utils.py" ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\n\"\"\"\nCS224N 2018-19: Homework 4\nnmt.py: NMT Model\nPencheng Yin <pcyin@cs.cmu.edu>\nSahil Chopra <schopra8@stanford.edu>\n\"\"\"\n\nimport math\nfrom typing import List\n\nimport numpy as np\nimport torch\nimport torch.nn as nn\nimport torch.nn.functional as F...
[ [ "numpy.random.shuffle" ] ]
DengZhuangSouthRd/SatelliteDetector
[ "090ad65f495a665226d00023cc0a1e954d21ead3" ]
[ "object_detection/eval.py" ]
[ "# Copyright 2017 The TensorFlow Authors. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless requ...
[ [ "tensorflow.app.run", "tensorflow.logging.set_verbosity", "tensorflow.gfile.MakeDirs" ] ]
ekzhang/semantic-segmentation
[ "12169882f443f0e1a026d3d04275908a0f14b463" ]
[ "network/lraspp.py" ]
[ "\"\"\"Lite Reduced Atrous Spatial Pyramid Pooling\n\nArchitecture introduced in the MobileNetV3 (2019) paper, as an\nefficient semantic segmentation head.\n\nThis file was modified from FastSeg. Original source:\nhttps://github.com/ekzhang/fastseg\n\"\"\"\n\nimport torch\nimport torch.nn as nn\nimport torch.nn.fun...
[ [ "torch.nn.Sigmoid", "torch.nn.AvgPool2d", "torch.nn.BatchNorm2d", "torch.nn.functional.interpolate", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.nn.AdaptiveAvgPool2d" ] ]
ZLJ2015106/CAMP_iccv19
[ "18d9ae24932b13905f1f5451efe13e77b3ec8e89" ]
[ "model.py" ]
[ "import torch\nimport torch.nn as nn\nimport torch.distributed as dist ## 分布式通信,可以做分布式训练,多线程多节点训练\nimport torch.nn.init ## 参数初始化\nimport torchvision.models as models ## pytorch中集成的经典模型,resnet等\nfrom torch.autograd import Variable ## 图的自动求导机制\nfrom torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequen...
[ [ "torch.nn.Linear", "torch.cat", "torch.nn.GRU", "numpy.load", "torch.cuda.is_available", "torch.LongTensor", "torch.nn.utils.rnn.pack_padded_sequence", "torch.nn.CrossEntropyLoss", "torch.nn.DataParallel", "torch.nn.Conv1d", "torch.autograd.Variable", "torch.nn.AvgP...
JungAh12/GA3C
[ "dd5b508669cddaefc5d6b9832885097b4bdfadd5" ]
[ "GA3C_ipy/ProcessAgent.py" ]
[ "#!/usr/bin/env python\n# coding: utf-8\n\n# In[1]:\n\n\nfrom datetime import datetime\nfrom multiprocessing import Process, Queue, Value\n\n\n# In[2]:\n\n\nimport numpy as np\nimport time\n\n\n# In[3]:\n\n\nfrom Config import Config\nfrom Environment import Environment\nfrom Experience import Experience\n\n\n# In[...
[ [ "numpy.array", "numpy.random.choice", "numpy.random.rand", "numpy.eye", "numpy.arange", "numpy.argmax", "numpy.clip" ] ]
boazmohar/zarr-python
[ "5c71212ccf5abe9f8a5ab7996c5ce3abbbbd61e2" ]
[ "zarr/n5.py" ]
[ "\"\"\"This module contains a storage class and codec to support the N5 format.\n\"\"\"\nimport os\nimport struct\nimport sys\nimport warnings\n\nimport numpy as np\nfrom numcodecs.abc import Codec\nfrom numcodecs.compat import ndarray_copy\nfrom numcodecs.registry import get_codec, register_codec\n\nfrom .meta imp...
[ [ "numpy.dtype", "numpy.zeros", "numpy.frombuffer" ] ]
petrosgk/tensorforce
[ "dd04f904acac78fd185ea8ee2c3ce6bac8859c1d" ]
[ "tensorforce/models/model.py" ]
[ "# Copyright 2017 reinforce.io. All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by ap...
[ [ "tensorflow.assign_add", "tensorflow.clip_by_value", "tensorflow.control_dependencies", "tensorflow.report_uninitialized_variables", "tensorflow.identity", "tensorflow.shape", "tensorflow.train.latest_checkpoint", "tensorflow.get_default_graph", "tensorflow.summary.histogram", ...
brian41005/transformers
[ "2195c0d5f9464385d14c43605a7e9f9a93a91b9a" ]
[ "examples/distillation/distiller.py" ]
[ "# coding=utf-8\n# Copyright 2019-present, the HuggingFace Inc. team and Facebook, 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/LICE...
[ [ "torch.zeros", "torch.nonzero", "torch.cat", "torch.optim.AdamW", "torch.nn.MSELoss", "torch.nn.CosineEmbeddingLoss", "torch.FloatTensor", "torch.no_grad", "torch.randperm", "torch.nn.parallel.DistributedDataParallel", "torch.nn.functional.log_softmax", "torch.nn.KL...
nhh1501/deepsp
[ "c57d30954b8df1a614dad1b2f656b647eb076e87" ]
[ "decoder.py" ]
[ "#!/usr/bin/env python\n# ----------------------------------------------------------------------------\n# Copyright 2015-2016 Nervana Systems Inc.\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 ...
[ [ "torch.IntTensor", "torch.max" ] ]
Mandroide/Research
[ "41e875d7be8194a55b4d97d7e56ffa464da71fbc" ]
[ "box_track/box_level_tracking.py" ]
[ "# code for box_level tracking\n# -*- coding: UTF-8 -*-\nimport copy\nimport numpy as np\nimport cv2\nimport pickle\nimport math\nimport os\n\nscore_threshold = 0.5 # threshold for detection score\nmask_threshold = 0.5 # threshold for abnormal mask\nlink_iou_threshold = 0.4 # linking IoU 1\niou_threshold = 0.1 # li...
[ [ "numpy.mean" ] ]
AnonymousAuthor-2021/pyxdf
[ "f4969abd7a862c05261e850fe5bb5bc26fa42ed0" ]
[ "pyxdf/pyxdf.py" ]
[ "# Authors: Christian Kothe & the Intheon pyxdf team\n# Chadwick Boulay\n# Tristan Stenner\n# Clemens Brunner\n#\n# License: BSD (2-clause)\n\n\"\"\"Defines the function load_xdf, which imports XDF files.\n\nThis function is closely following the load_xdf reference implementation.\n\"\"\"...
[ [ "numpy.dot", "numpy.ones_like", "numpy.median", "numpy.copy", "numpy.min", "numpy.where", "numpy.finfo", "numpy.linalg.lstsq", "numpy.frombuffer", "numpy.dtype", "numpy.divide", "numpy.max", "numpy.zeros_like", "numpy.concatenate", "numpy.arange", "n...
calmisential/HRNet_Pose_Estimation_TensorFlow2
[ "ba1ada9b2ca49a5a2f0bb0a7ef6bfa94e55d4afd" ]
[ "test.py" ]
[ "import tensorflow as tf\nimport cv2\nfrom pathlib import Path\n\nfrom configuration.base_config import Config\nfrom utils.tools import get_config_params\nfrom utils.transforms import read_image\nfrom utils.work_flow import get_model, print_model_summary, inference\n\n\ndef image_preprocess(cfg, picture_dir):\n ...
[ [ "tensorflow.config.list_physical_devices", "tensorflow.image.resize", "tensorflow.config.experimental.set_memory_growth", "tensorflow.expand_dims" ] ]
Jaikinator/xitorch
[ "053db8d27a7777baa7f572c2d37004e788ff4cb8", "053db8d27a7777baa7f572c2d37004e788ff4cb8" ]
[ "xitorch/_tests/test_pure_function.py", "xitorch/_impls/integrate/mcsamples/mcmc.py" ]
[ "import xitorch\r\nimport torch\r\nimport pytest\r\nfrom xitorch._core.pure_function import get_pure_function, PureFunction\r\n\r\ndef func1(x, a, b):\r\n return x * a + b\r\n\r\n@torch.jit.script\r\ndef jitfunc1(x, a, b):\r\n return x * a + b\r\n\r\nclass TorchModule(torch.nn.Module):\r\n def __init__(sel...
[ [ "torch.allclose", "torch.tensor" ], [ "torch.zeros", "torch.rand", "torch.numel", "torch.cos", "torch.tan", "torch.atan", "torch.randn_like", "torch.tensor", "torch.empty", "numpy.polynomial.legendre.leggauss", "torch.empty_like" ] ]
r00ta/pandas
[ "3f1e5940e3929577f094ea2708f94ee184e7a336" ]
[ "pandas/core/dtypes/dtypes.py" ]
[ "\"\"\" define extension dtypes \"\"\"\nimport re\nimport warnings\n\nimport numpy as np\nimport pytz\n\nfrom pandas._libs.interval import Interval\nfrom pandas._libs.tslibs import NaT, Period, Timestamp, timezones\n\nfrom pandas.core.dtypes.generic import ABCCategoricalIndex, ABCIndexClass\n\nfrom pandas import co...
[ [ "pandas._libs.tslibs.timezones.maybe_get_tz", "pandas.core.dtypes.common.is_string_dtype", "pandas.tseries.frequencies.to_offset", "pandas.Index", "numpy.asarray", "pandas.core.dtypes.common.is_datetime64tz_dtype", "numpy.bitwise_xor.reduce", "pandas.compat.text_type", "pandas....
bozhikovstanislav/UI-Pylinac
[ "ecccf4627adbe4b7a44a577e93c9cc9f4b42da7d" ]
[ "pylinacnew/winston_lutz.py" ]
[ "\"\"\"The Winston-Lutz module loads and processes EPID images that have acquired Winston-Lutz type images.\n\nFeatures:\n\n* **Automatic field & BB positioning** - When an image or directory is loaded, the field CAX and the BB\n are automatically found, along with the vector and scalar distance between them.\n* *...
[ [ "scipy.ndimage.binary_erosion", "numpy.median", "numpy.min", "numpy.mean", "scipy.ndimage.measurements.center_of_mass", "numpy.histogram", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "numpy.logical_and", "scipy.ndimage.measurements.label", "numpy.arange",...
SunnyMarkLiu/Datacastle_Travel_Services_Predict
[ "0823a8aaab4e42a7ee5067171901c6f597bc5d7e" ]
[ "model/model_roof/lq_rf_roof.py" ]
[ "# _*_ coding: utf-8 _*_\nfrom __future__ import absolute_import, division, print_function\n\nimport os\nimport sys\n\nmodule_path = os.path.abspath(os.path.join('..'))\nsys.path.append(module_path)\n\nimport numpy as np\nimport pandas as pd\nfrom sklearn.model_selection import StratifiedKFold\nfrom sklearn.ensembl...
[ [ "sklearn.model_selection.StratifiedKFold", "numpy.zeros", "sklearn.ensemble.RandomForestClassifier", "pandas.DataFrame", "numpy.mean", "sklearn.metrics.auc", "sklearn.metrics.roc_curve" ] ]
gallif/raft
[ "11a35ff5ede31918a360eca2f1481bc5fec9b5e5" ]
[ "train.py" ]
[ "from __future__ import print_function, division\nimport sys\nsys.path.append('core')\n\nimport argparse\nimport os\nimport cv2\nimport time\nfrom datetime import datetime\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimport tensorflow as tf\nfrom tqdm import tqdm\n\nimport torch\nimport torch.nn as nn\ni...
[ [ "numpy.concatenate", "torch.cat", "torch.optim.lr_scheduler.OneCycleLR", "numpy.array", "torch.split", "torch.no_grad", "numpy.tile", "numpy.mean", "torch.cuda.device_count", "torch.tensor", "torch.utils.data.DataLoader", "torch.load", "numpy.abs", "torch.nn...
SanyHe/pyro_processor
[ "2a11a8158a18bd92bc7f14d9006be64c2a60e6ba" ]
[ "Fe3_calculation_program/vir_env_windows/Lib/site-packages/pandas/io/excel/_base.py" ]
[ "import abc\r\nimport datetime\r\nfrom distutils.version import LooseVersion\r\nimport inspect\r\nfrom io import BufferedIOBase, BytesIO, RawIOBase\r\nimport os\r\nfrom textwrap import fill\r\nfrom typing import IO, Any, Dict, Mapping, Optional, Union, cast\r\nimport warnings\r\nimport zipfile\r\n\r\nfrom pandas._c...
[ [ "pandas.io.excel._util.get_writer", "pandas.io.parsers.TextParser", "pandas.io.common.validate_header_arg", "pandas.io.excel._util.maybe_convert_usecols", "pandas.util._decorators.deprecate_nonkeyword_arguments", "pandas.io.common.IOHandles", "pandas.core.dtypes.common.is_bool", "p...
giovastabile/EZyRB
[ "c89b5347add0ece109f2169295db467b2c2b23c2" ]
[ "ezyrb/gpr.py" ]
[ "\"\"\"\nModule wrapper exploiting `GPy` for Gaussian Process Regression\n\"\"\"\nimport GPy\nimport numpy as np\nfrom scipy.optimize import minimize\n\nfrom .approximation import Approximation\n\n\nclass GPR(Approximation):\n \"\"\"\n Multidimensional regression using Gaussian process.\n\n :cvar numpy.nda...
[ [ "numpy.array", "numpy.random.uniform", "scipy.optimize.minimize", "numpy.atleast_2d" ] ]
ai-iilab/aic_jetson_dev
[ "383cb529e1688404aabb944bb5390571b5c2c83e" ]
[ "Yolov5s_Python/utils/general.py" ]
[ "# General utils\n\nimport glob\nimport logging\nimport math\nimport os\nimport platform\nimport random\nimport re\nimport subprocess\nimport time\nfrom pathlib import Path\n\nimport cv2\nimport numpy as np\nimport torch\nimport torchvision\nimport yaml\n\nfrom utils.google_utils import gsutil_getsize\nfrom utils.m...
[ [ "torch.cat", "numpy.set_printoptions", "numpy.copy", "torch.set_printoptions", "torch.hub.download_url_to_file", "numpy.bincount", "numpy.concatenate", "torch.tensor", "torch.Tensor", "torch.zeros", "torch.device", "numpy.savetxt", "torch.min", "torch.max", ...
willgdjones/snps
[ "31efc35c9c82f0af78939de817a7d8174bfb7cf9" ]
[ "src/snps/io/writer.py" ]
[ "\"\"\" Class for writing SNPs.\n\n\"\"\"\n\n\"\"\"\nBSD 3-Clause License\n\nCopyright (c) 2019, Andrew Riha\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code m...
[ [ "pandas.DataFrame", "pandas.notna", "numpy.vectorize", "pandas.concat" ] ]
eloygeenjaar/pysindy
[ "2f68e0a705da2d549bc5320ffadb0bfaf7276d9a" ]
[ "pysindy/feature_library/generalized_library.py" ]
[ "import numpy as np\nfrom sklearn import __version__\nfrom sklearn.utils import check_array\nfrom sklearn.utils.validation import check_is_fitted\n\nfrom .base import BaseFeatureLibrary\nfrom .weak_pde_library import WeakPDELibrary\n\n\nclass GeneralizedLibrary(BaseFeatureLibrary):\n \"\"\"Put multiple libraries...
[ [ "sklearn.utils.validation.check_is_fitted", "numpy.asarray", "numpy.zeros", "numpy.sum", "numpy.shape", "numpy.any", "numpy.where", "numpy.ravel", "sklearn.utils.check_array", "numpy.unique" ] ]
sj6077/Megatron-LM
[ "3860e995269df61d234ed910d4756e104e1ab844" ]
[ "pretrain_ict.py" ]
[ "# coding=utf-8\n# Copyright (c) 2019, NVIDIA CORPORATION. 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...
[ [ "torch.distributed.get_world_size", "torch.cat", "torch.arange", "torch.split", "torch.empty_like", "torch.distributed.all_gather", "torch.cuda.LongTensor", "torch.transpose", "torch.nn.functional.log_softmax", "torch.nn.functional.nll_loss", "torch.distributed.get_rank...
emaballarin/fhpc_assignments_2019-2020
[ "3b6c2484ef02a068e27703bd941baee484c5c2db" ]
[ "A02/utils/data_acq/runacq.py" ]
[ "#!/usr/bin/env python3\n#\n# (C) 2019-* Emanuele Ballarin <emanuele@ballarin.cc>\n# Distribution: MIT License.\n\n# IMPORTS:\nimport os\nimport subprocess as proc\nfrom subprocess import PIPE\nimport time\nimport numpy as np\n\n\n#####################################################################################...
[ [ "numpy.asarray" ] ]
tridungduong16/counterfactual_fairness_game_theoretic
[ "794d5224f9c656c06e5eb197ebbe1875f1856e7e", "794d5224f9c656c06e5eb197ebbe1875f1856e7e" ]
[ "src/law_test.py", "src/run_law_data.py" ]
[ "import torch\nimport pandas as pd\nimport sys\nimport numpy as np\n\nfrom tqdm import tqdm\nfrom model_arch.discriminator import DiscriminatorLaw\nfrom dfencoder.autoencoder import AutoEncoder\nfrom dfencoder.dataframe import EncoderDataFrame\nfrom utils.evaluate_func import evaluate_pred, evaluate_distribution, e...
[ [ "torch.device", "sklearn.linear_model.LinearRegression", "torch.cuda.is_available", "torch.load", "sklearn.model_selection.train_test_split", "pandas.read_csv" ], [ "sklearn.preprocessing.LabelEncoder", "numpy.array", "sklearn.linear_model.LinearRegression", "numpy.mean...
guanghaoyin/RTCAN-1D
[ "238a80609896155d0478dbad5274862e7c1547bc" ]
[ "data/AMIGOS/data_loader_1D.py" ]
[ "import numpy as np\nimport csv\nimport random\nimport os\nfrom tqdm import tqdm\nimport torchvision.transforms as transforms\nfrom PIL import Image\nimport json\nimport sys\n\ndata_path = '/home/guanghaoyin/Desktop/Dataset/AMIGOS/'\nstart_time = 0 # ignoring start seconds has been done\neda_fps = 128\nNet_size = ...
[ [ "numpy.array", "numpy.vstack" ] ]
owena11/improver
[ "ca028e3a1c842e3ff00b188c8ea6eaedd0a07149", "ff658db31364c0bdf3af3940736c260e10544705", "ca028e3a1c842e3ff00b188c8ea6eaedd0a07149" ]
[ "improver_tests/synthetic_data/test_utilities.py", "improver_tests/synthetic_data/test_generate_metadata.py", "improver_tests/nowcasting/optical_flow/test_OpticalFlow.py" ]
[ "# -*- coding: utf-8 -*-\n# -----------------------------------------------------------------------------\n# (C) British Crown Copyright 2017-2021 Met Office.\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following c...
[ [ "numpy.testing.assert_array_equal" ], [ "numpy.count_nonzero" ], [ "numpy.full", "numpy.array", "numpy.zeros", "numpy.copy", "numpy.ones", "numpy.mean", "numpy.multiply", "numpy.where", "numpy.float32", "numpy.ma.MaskedArray", "numpy.arange" ] ]
rictjo/impetuous
[ "470deaa5e63046d8a259ec0957f1fb2ec3116df7" ]
[ "src/impetuous/fit.py" ]
[ "\"\"\"\nCopyright 2022 RICHARD TJÖRNHAMMAR\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed...
[ [ "numpy.dot", "numpy.random.rand", "numpy.min", "numpy.mean", "numpy.cos", "pandas.concat", "pandas.read_csv", "numpy.max", "numpy.sin", "pandas.DataFrame", "numpy.eye", "numpy.tanh", "numpy.sqrt", "numpy.vstack", "numpy.square", "numpy.array", "n...
sukibean163/RetinaFace_Paddle
[ "8910f4ac2e42058dffdfbaaab323457fe823d00c" ]
[ "utils/box_utils.py" ]
[ "import paddle\nimport numpy as np\n\n\ndef point_form(boxes):\n \"\"\" Convert prior_boxes to (xmin, ymin, xmax, ymax)\n representation for comparison to point form ground truth data.\n Args:\n boxes: (tensor) center-size default boxes from priorbox layers.\n Return:\n boxes: (tensor) Con...
[ [ "numpy.minimum", "numpy.prod", "numpy.maximum" ] ]
joe-antognini/tf-estimator-example
[ "21428af1777595a9432cb4d795f1ba9541b74c7b" ]
[ "convert_to_records.py" ]
[ "#! /usr/bin/env python\n\nimport argparse\nimport gzip\nimport os\nimport numpy as np\nimport urllib\nimport tensorflow as tf\n\nMNIST_URL = 'http://yann.lecun.com/exdb/mnist/'\nMNIST_FNAMES = ['train-images-idx3-ubyte.gz',\n 'train-labels-idx1-ubyte.gz',\n 't10k-images-idx3-ubyte.gz'...
[ [ "tensorflow.train.Int64List", "numpy.reshape", "tensorflow.train.Features", "tensorflow.python_io.TFRecordWriter", "numpy.fromstring" ] ]
dmitryvinn/ReAgent
[ "f98825b9d021ec353a1f9087840a05fea259bf42", "f98825b9d021ec353a1f9087840a05fea259bf42" ]
[ "reagent/gym/envs/functionality/possible_actions_mask_tester.py", "reagent/test/net_builder/test_synthetic_reward_net_builder.py" ]
[ "#!/usr/bin/env python3\n# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.\n\"\"\"\nSimple environment to test possible_actions_mask.\nState simply tells you which iteration it is, but doesn't tell anything about\nwhich action to take, so only source of info is possible_actions_mask.\nThe Q-va...
[ [ "numpy.random.randint", "numpy.zeros" ], [ "torch.cat", "torch.FloatTensor", "torch.no_grad", "torch.ones", "numpy.testing.assert_array_almost_equal", "torch.randint", "torch.LongTensor", "torch.tensor", "torch.randn", "torch.sum" ] ]
johnpjust/BNAF_tensorflow_eager
[ "693a82e8042ca362e728348ed7a3a288d2ab76f3" ]
[ "data/GQ_MS.py" ]
[ "import pandas as pd\nimport numpy as np\nfrom sklearn.utils import shuffle\n\nclass GQ_MS:\n\n class Data:\n\n def __init__(self, data):\n\n self.x = data.astype(np.float32)\n self.N = self.x.shape[0]\n\n def __init__(self, file):\n\n trn, val, tst = load_data_and_clean_an...
[ [ "pandas.read_excel", "sklearn.utils.shuffle" ] ]
siconos/siconos-deb
[ "2739a23f23d797dbfecec79d409e914e13c45c67" ]
[ "examples/Biology/StepSystem/StepSystem-explicit.py" ]
[ "import numpy \nimport scipy\n\nimport sys\n\nfrom ComputeOneStep import *\n\n#state\nn=2\nx=numpy.zeros(n, 'd')\n\n\n# initial condition\nx[0]=10\nx[1]=5\n\ngamma1=-1.5\ngamma2=-4.5\n\nkappa1=40\nkappa2=40\n\ntheta1=8.0\ntheta2=8.0\n\n\nA= numpy.array([[gamma1,0],[0, gamma2]])\n\na= numpy.array([kappa1,kappa2])\n\...
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "numpy.savetxt" ] ]
ifgovh/continual-learning
[ "21822801934ad68ca311c1c30ae49cdbd7ca53ed" ]
[ "compare_time.py" ]
[ "#!/usr/bin/env python3\nimport argparse\nimport os\nimport numpy as np\nfrom param_stamp import get_param_stamp_from_args\nimport visual_plt\nimport main\nfrom param_values import set_default_values\n\n\ndescription = 'Compare performance & training time of various continual learning methods.'\nparser = argparse.A...
[ [ "numpy.max", "numpy.var", "numpy.mean" ] ]
ikingye/keras
[ "1a3ee8441933fc007be6b2beb47af67998d50737" ]
[ "tests/keras/layers/wrappers_test.py" ]
[ "import pytest\nimport numpy as np\nimport copy\nfrom numpy.testing import assert_allclose\nfrom keras.utils import CustomObjectScope\nfrom keras.layers import wrappers, Input, Layer\nfrom keras.layers import RNN\nfrom keras import layers\nfrom keras.models import Sequential, Model, model_from_json\nfrom keras impo...
[ [ "numpy.concatenate", "numpy.testing.assert_allclose", "numpy.array", "numpy.random.normal", "numpy.array_equal", "numpy.random.rand", "numpy.zeros", "numpy.random.seed", "numpy.mean", "numpy.any", "numpy.random.randint", "numpy.random.random" ] ]
VladSkripniuk/optuna
[ "81d5b67a81ae14d606e6d6120ce50d02e90b0942" ]
[ "examples/pruning/xgboost_integration.py" ]
[ "\"\"\"\nOptuna example that demonstrates a pruner for XGBoost.\n\nIn this example, we optimize the validation accuracy of cancer detection using XGBoost.\nWe optimize both the choice of booster model and their hyperparameters. Throughout\ntraining of models, a pruner observes intermediate results and stop unpromis...
[ [ "sklearn.model_selection.train_test_split", "numpy.rint" ] ]
cindyxinyiwang/nematus
[ "30fa0bd4524e9f8b2811b04e1c541e9745131ebb" ]
[ "nematus/translate.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n'''\nTranslates a source file using a translation model.\n'''\nimport sys\nimport numpy\nimport json\nimport os\nimport logging\n\nfrom multiprocessing import Process, Queue\nfrom collections import defaultdict\nfrom Queue import Empty\n\nfrom util import load_dict, ...
[ [ "numpy.array", "numpy.load", "numpy.argsort", "numpy.argmin" ] ]
ryanxjhan/AI-Space-Invader
[ "256365ca5e55af93fdf6db45d604d08aa4fad905" ]
[ "deeprl_p2/utils.py" ]
[ "\"\"\"Common functions you may find useful in your implementation.\"\"\"\n\nimport semver\nimport tensorflow as tf\nfrom six.moves import cPickle\n\n\ndef get_uninitialized_variables(variables=None):\n \"\"\"Return a list of uninitialized tf variables.\n\n Parameters\n ----------\n variables: tf.Variab...
[ [ "tensorflow.get_default_session", "tensorflow.is_variable_initialized", "tensorflow.global_variables" ] ]
tgisaturday/Seq2CNN
[ "64cb24fba04c375f276621ed54cd67b7151c9797" ]
[ "experimental/train_deep_embedded.py" ]
[ "import os\nimport sys\nimport json\nimport time\nimport logging\nimport data_helper\nimport numpy as np\nimport tensorflow as tf\nfrom model_deep_embedded import seq2CNN\nfrom tensorflow.contrib import learn\nfrom sklearn.model_selection import train_test_split\n\nlogging.getLogger().setLevel(logging.INFO) \n\nde...
[ [ "numpy.array", "tensorflow.train.AdamOptimizer", "numpy.asarray", "numpy.zeros", "tensorflow.Graph", "tensorflow.Session", "tensorflow.Variable", "tensorflow.global_variables", "tensorflow.train.global_step", "tensorflow.ConfigProto", "numpy.random.uniform", "tensor...
richardmyu/PyDemo
[ "f18a3fab43aa53292409ce03bcf0195f2d066eb0" ]
[ "collect/loveheart/redheart.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n作者:李狗嗨\n链接:https://www.zhihu.com/question/466165757/answer/1954034386\n来源:知乎\n著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。\n\"\"\"\n\nimport numpy as np\nfrom skimage import measure\nimport matplotlib.pyplot as plt\n\n\ndef fun(x, y, z):\n return (x ** 2 + (9 / 4) * y ** 2 + z ** 2 - 1)...
[ [ "matplotlib.pyplot.show", "matplotlib.pyplot.figure" ] ]
AndrewOriani/Rodin-MASTER
[ "45a437b75671bbc9f143da28bd874a064ce12b64" ]
[ "Instruments/RGA100.py" ]
[ "\"\"\"\nAuthor: Andrew Oriani\nMay 2019\n\nThis is a driver for the Stanford Research Systems RGA100 residual gas analyzer\n\nUPDATE: 11/2020\n\nParallel and async functionality added using threading to allow background updating and operation. locks seperate function calls\nto the serial handler of the RGA. Would ...
[ [ "numpy.around" ] ]
MrBellamonte/MT-VAEs-TDA
[ "8881b5db607c673fb558f7b74ece27f244b16b77", "8881b5db607c673fb558f7b74ece27f244b16b77" ]
[ "scripts/ssc/pairings_visualization/wcpairings_comparison3.py", "src/models/WitnessComplexAE/train_util.py" ]
[ "import random\n\nimport torch\nimport numpy as np\n\nfrom scripts.ssc.persistence_pairings_visualization.utils_definitions import make_plot\nfrom src.datasets.datasets import SwissRoll\nfrom src.topology.witness_complex import WitnessComplex\n\nif __name__ == \"__main__\":\n dataset_sampler = SwissRoll()\n\n ...
[ [ "torch.zeros", "torch.from_numpy", "numpy.random.randint", "torch.tensor", "numpy.column_stack", "torch.sort" ], [ "torch.zeros", "torch.norm", "numpy.where", "torch.tensor", "numpy.column_stack", "torch.sort" ] ]
Dvermetten/DE_TIOBR
[ "b26d0624773d19e178c0eb33350d42356626e10c" ]
[ "pyade/ilshade.py" ]
[ "import pyade.commons\nimport numpy as np\nimport scipy.stats\nimport random\nfrom typing import Callable, Union, Dict, Any\n\nclass ilshade():\n def get_default_params(dim: int):\n \"\"\"\n Returns the default parameters of the iL-SHADE Differential Evolution Algorithm\n :param dim:...
[ [ "numpy.random.normal", "numpy.random.choice", "numpy.argmin", "numpy.random.seed", "numpy.sum", "numpy.ones", "numpy.abs", "numpy.clip", "numpy.argsort" ] ]
ka-chang/dssg2021-redistricting
[ "5b535b464b7a6e9dccdbf63b2c0fc01b9c3b25a2" ]
[ "Texas/run_functions.py" ]
[ "# -*- coding: utf-8 -*-\n\"\"\"\ncopied from MGGG VRA Analysis Code - https://github.com/mggg/VRA_ensembles/tree/master/TX\nCreated on Tue Jul 28 15:50:57 2020\n\n@author: darac\n\"\"\"\nimport random\nimport networkx as nx\nimport csv\nimport os\nimport shutil\nfrom functools import partial\nimport json\nimport m...
[ [ "numpy.array", "pandas.DataFrame", "numpy.sum", "numpy.tile", "numpy.exp", "numpy.stack", "numpy.argmax", "numpy.maximum" ] ]
Jintao-Huang/torch_study
[ "d3a1b25dad1f7906ab16863d387bc370d18be0b6", "d3a1b25dad1f7906ab16863d387bc370d18be0b6" ]
[ "_old/tf2/1 basic_tf2/course_3/4.2 fashion_class.py", "dev/torch/nn/functional/avg_pool2d.py" ]
[ "# Author: Jintao Huang\n# Email: hjt_study@qq.com\n# Date: \n\n\nimport tensorflow as tf\nfrom tensorflow.keras.layers import Dense, Flatten\nfrom tensorflow.keras import Model\n\n# 控制显存自动增长\ngpus = tf.config.list_physical_devices('GPU') # 必须大写\nfor gpu in gpus:\n tf.config.experimental.set_memory_growth(gpu, ...
[ [ "tensorflow.keras.layers.Flatten", "tensorflow.config.experimental.set_memory_growth", "tensorflow.keras.layers.Dense", "tensorflow.keras.losses.SparseCategoricalCrossentropy", "tensorflow.config.list_physical_devices" ], [ "torch.nn.functional.pad", "torch.empty", "torch.mean"...
karaage-pp/karaage_db
[ "f818cfbc6cea3e4efaca42ed50b3b8d56ee055b9" ]
[ "scripts/plane_from_db.py" ]
[ "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport os\nimport numpy as np\nimport pandas as pd\nfrom db_interface import DataBase\nfrom tf_utils import Tf as TF\nimport rosparam\nimport rospy\nDIS = 0.05\n\n# visualization\nimport roslib; roslib.load_manifest('visualization_marker_tutorials')\nfrom visualiza...
[ [ "numpy.array", "pandas.concat" ] ]
nmfisher/espnet
[ "529a69b6a7d8627caf12372e3b8b206289f714bb" ]
[ "espnet2/train/reporter.py" ]
[ "\"\"\"Reporter module.\"\"\"\nfrom collections import defaultdict\nfrom contextlib import contextmanager\nimport dataclasses\nimport datetime\nfrom distutils.version import LooseVersion\nimport logging\nfrom pathlib import Path\nimport time\nfrom typing import ContextManager\nfrom typing import Dict\nfrom typing i...
[ [ "matplotlib.use", "torch.cuda.max_memory_cached", "matplotlib.ticker.MaxNLocator", "torch.cuda.max_memory_reserved", "numpy.nanmean", "numpy.prod", "torch.cuda.is_available", "numpy.isfinite", "torch.cuda.is_initialized" ] ]
amanmalali/reinforment-learning-competition-and-cooperation
[ "2d3ed7a57f6c2882999489f8f5f54fceb8701b50" ]
[ "multiagent/scenarios/simple_tag_guided_2v1.py" ]
[ "import numpy as np\nfrom multiagent.core import World, Agent, Landmark\nfrom multiagent.scenario import BaseScenario\n\n\nclass Scenario(BaseScenario):\n def make_world(self):\n world = World()\n # set any world properties first\n world.dim_c = 2\n num_good_agents = 2\n num_ad...
[ [ "numpy.concatenate", "numpy.square", "numpy.array", "numpy.zeros", "numpy.exp", "numpy.random.uniform" ] ]
gorchard/facenet
[ "a138b8c08ecd763e067b244b37cec62766658af3" ]
[ "packages/preprocess.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport os\n\nimport numpy as np\nimport tensorflow as tf\nfrom scipy import misc\n\nfrom packages import facenet, detect_face\n\n\nclass preprocesses:\n def __init__(self, input_datadir, output_data...
[ [ "numpy.asarray", "numpy.zeros", "tensorflow.Graph", "scipy.misc.imresize", "scipy.misc.imread", "tensorflow.ConfigProto", "numpy.random.randint", "numpy.argmax", "numpy.power", "scipy.misc.imsave", "numpy.squeeze", "tensorflow.GPUOptions", "numpy.vstack" ] ]
joshuawallace/M4_pm_membership
[ "0a0ce546304ded33dfbfef3a38818a97de3e15b3" ]
[ "pm_membership.py" ]
[ "#!/usr/bin/env python\n\n\"\"\"\npm_membership.py, code to fit and use a model fit to proper motions to \ndetermine cluster membership for M4.\n\nAuthor: Joshua Wallace, advised by Joel Hartman and Gaspar Bakos\n\nIf you use this code, please cite (fill in information after publication)\n\nWhile this code is focus...
[ [ "matplotlib.pyplot.colorbar", "numpy.isnan", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.savefig", "matplotlib.pyplot.close", "sklearn.mixture.GaussianMixture", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.ylabe...
JamesRitchie/nsf
[ "5628a6f8190c9e3840208da8baf5cf403ca9b892" ]
[ "nsflow/nde/transforms/svd.py" ]
[ "import numpy as np\nimport torch\n\nfrom torch import nn\nfrom torch.nn import init\n\nfrom nsflow.nde import transforms\nfrom nsflow.nde.transforms.linear import Linear\n\n\nclass SVDLinear(Linear):\n \"\"\"A linear module using the SVD decomposition for the weight matrix.\"\"\"\n\n def __init__(self, featu...
[ [ "torch.zeros", "torch.nn.init.constant_", "torch.ones", "numpy.sqrt", "torch.nn.init.uniform_", "torch.exp", "torch.sum" ] ]
ManifoldFR/point-process-nets
[ "d2fb419f2d5fe2adbb0714fa27d98672df07db68" ]
[ "train_functions.py" ]
[ "\"\"\"\nTraining loops for the various models.\n\"\"\"\nimport torch\nfrom torch import Tensor\nfrom torch import nn\nimport tqdm\nimport numpy as np\nimport sys\nfrom torch.optim import Optimizer\nfrom models.ctlstm import HawkesLSTM\nfrom models.decayrnn import HawkesDecayRNN\nfrom utils.load_synth_data import o...
[ [ "torch.nn.utils.rnn.pack_padded_sequence", "torch.device", "numpy.mean", "matplotlib.pyplot.subplots" ] ]
JIC-CSB/jicbioimage.core
[ "8a836b3af7c51926b2d18948babec593cf35ce55" ]
[ "jicbioimage/core/image.py" ]
[ "\"\"\"Module for managing and accessing images.\"\"\"\n\nimport os\nimport json\nimport base64\nimport tempfile\nimport math\nimport re\nimport shutil\n\nimport numpy as np\nimport scipy.ndimage\nimport skimage.io\n\nfrom jicbioimage.core.util.array import normalise\n\n\ndef _sorted_listdir(directory):\n \"\"\"...
[ [ "numpy.dstack", "numpy.ndarray.__new__" ] ]
zsvizi/corona-virus-2020
[ "71673bdb8e2b1dc55af1a7b5dce3adf92472972b" ]
[ "source/data_handling.py" ]
[ "import csv\nimport numpy as np\n\nfrom source.main_SEIR import solve_model\nfrom source.model import number_of_E_compartments, number_of_I_compartments, EpidemicModel\n\n\ndef get_data(path):\n # Load data\n t, data = load_data(path)\n test = False\n if test:\n # generate data\n t, data =...
[ [ "numpy.random.normal", "numpy.array", "numpy.linspace" ] ]
soumide1102/nubhlight
[ "85046add8b7e2c1419538864eb54205d33078772" ]
[ "script/analysis/zoh.py" ]
[ "################################################################################\n# #\n# Profiles Integrated over disk #\n# ...
[ [ "scipy.integrate.simps", "scipy.interpolate.interp1d", "numpy.ones_like", "numpy.tan", "numpy.where", "numpy.sqrt", "numpy.linspace" ] ]
archielee/Pointnet2_PyTorch
[ "17790fe7c337e47ccf92390d979cd637fa552062" ]
[ "pointnet2/data/ActiveVisionDataset.py" ]
[ "from __future__ import (\n division,\n absolute_import,\n with_statement,\n print_function,\n unicode_literals,\n)\nimport torch\nimport torch.utils.data as torch_data\nimport numpy as np\nimport os\n\nBASE_DIR = os.path.dirname(os.path.abspath(__file__))\n\n\nclass ActiveVisionDataset(torch_data.Da...
[ [ "numpy.concatenate", "numpy.max", "numpy.load", "numpy.min", "numpy.random.shuffle" ] ]
ratnania/caid
[ "5bc5428007c8642412762f80c36e8531e56cd15e" ]
[ "caid-gui/geometryActions.py" ]
[ "# -*- coding: UTF-8 -*-\nimport wx\nimport os\nfrom geometry import geometry\nfrom caid.cad_geometry import cad_geometry\nfrom viewer import Viewer\nfrom numpy import pi, linspace\nimport numpy as np\nfrom classActions import *\nfrom objectActions import *\n\nclass GeometryActions(ClassActions):\n def __init__(...
[ [ "numpy.max", "matplotlib.pyplot.colorbar", "numpy.zeros", "numpy.ones", "matplotlib.pyplot.show", "numpy.linspace" ] ]
m-schleier/ARC-Alkali-Rydberg-Calculator
[ "eabba3bc9ac2e37ba3a8dbba18d39771dcbbb9fd" ]
[ "arc/calculations_atom_pairstate.py" ]
[ "# -*- coding: utf-8 -*-\n\n\"\"\"\n Pair-state basis level diagram calculations\n\n Calculates Rydberg spaghetti of level diagrams, as well as pertubative C6\n and similar properties. It also allows calculation of Foster resonances\n tuned by DC electric fields.\n\n Example:\n Calculation of ...
[ [ "numpy.rint", "numpy.copy", "numpy.load", "numpy.min", "numpy.exp", "numpy.multiply", "numpy.sort", "matplotlib.colors.LinearSegmentedColormap.from_list", "numpy.max", "numpy.log", "numpy.linalg.eigh", "matplotlib.pyplot.subplots", "numpy.save", "numpy.sqrt"...
Eric-Hao/DAIN
[ "5c9bcfdae05119ba0ed0f4608d1bf002874f77b9" ]
[ "datasets/listdatasets.py" ]
[ "import torch.utils.data as data\nimport os\nimport os.path\nfrom scipy.ndimage import imread\nimport numpy as np\nimport random\n\ndef Vimeo_90K_loader(root, im_path, input_frame_size = (3, 256, 448), output_frame_size = (3, 256, 448), data_aug = True):\n\n\n root = os.path.join(root,'sequences',im_path)\n\n ...
[ [ "numpy.flipud", "scipy.ndimage.imread", "numpy.transpose", "numpy.fliplr" ] ]
ocloarec/pyPLS
[ "2b00c8f90c9a0dd4dc70a594dc8300a38aa9a22f" ]
[ "pyPLS/normalisation.py" ]
[ "import numpy as np\nimport pandas as pd\n\nfrom pyPLS.pca import prcomp\n\n\ndef unit(X):\n \"\"\"\n :param X: Matrix to be normalised\n :return: a normalised matrix, factor used for normalisation, reference vector\n \"\"\"\n\n p = X.shape[1]\n factors = np.sum(X, axis=1)\n X = X / np.tile(fac...
[ [ "numpy.asarray", "numpy.median", "numpy.sum", "pandas.DataFrame", "numpy.random.randn", "numpy.tile" ] ]
sisilmehta2000/mmf
[ "ac1bb736f281ffbde367cfe9cf6f4f78fc890fc4" ]
[ "mmf/models/uniter.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n\n# Initial version was taken from https://github.com/ChenRocks/UNITER/\n# and adapted for MMF.\n\nimport copy\nimport logging\nimport random\nfrom collections import MutableMapping, namedtuple\nfrom dataclasses import asdict, dataclass, field\nfrom typing import...
[ [ "torch.nn.Linear", "torch.zeros", "torch.cat", "torch.nn.Dropout", "torch.nn.LayerNorm", "numpy.random.binomial", "torch.nn.ModuleDict", "torch.full", "torch.tensor", "torch.clone", "torch.nn.Embedding" ] ]
Prevalenter/sciwx
[ "dfa81e39eac6582a9248cc57e96d4418f1a1f245" ]
[ "sciwx/plugins/histogram.py" ]
[ "from ..widgets import HistPanel, CMapPanel, FloatSlider, CMapSelCtrl\nimport wx, numpy as np\n\nclass Histogram( wx.Panel ):\n\ttitle = 'Histogram'\n\n\tdef __init__( self, parent, app):\n\t\twx.Panel.__init__ ( self, parent, id = wx.ID_ANY, pos = wx.DefaultPosition, size = wx.Size( 255,0 ), style = wx.TAB_TRAVERS...
[ [ "matplotlib.pyplot.get_cmap", "matplotlib.pyplot.colormaps", "numpy.linspace" ] ]
Selozhd/python_utils
[ "de58d5656ba5c0c21f58c47437c469048e2396c8" ]
[ "python_utils/plot_utils.py" ]
[ "import functools\n\nfrom matplotlib import pyplot as plt\n\n\ndef save_or_show(filepath=None):\n if filepath is not None:\n plt.savefig(filepath)\n plt.clf()\n else:\n plt.show()\n\n\ndef plotting_style(matplotlib_style):\n \"\"\"Decorater to wrap a plotting function with a style.\"\"...
[ [ "matplotlib.pyplot.style.context", "matplotlib.pyplot.xlim", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.ylim", "matplotlib.pyplot.title", "matplotlib.pyplot.legend", "matplotlib.pyplot.plot", "matplotlib.pyplot.savefig", "matplotlib.pyplot.show", "matplotlib.pyplot.ylab...
isse-augsburg/rtm-predictions
[ "cf7336f10a27fadb479b9ef5d341d17200fbf041" ]
[ "ModelTrainerScripts/model_trainer_ff_sensor_1140_to_dryspot.py" ]
[ "from pathlib import Path\n\nimport torch\n\nimport Resources.training as r\nfrom Models.erfh5_fullyConnected import S1140DryspotModelFCWide\nfrom Pipeline.data_gather import get_filelist_within_folder_blacklisted\nfrom Pipeline.data_loader_flowfront_sensor import DataloaderFlowfrontSensor\nfrom Trainer.ModelTraine...
[ [ "torch.optim.AdamW", "torch.nn.BCELoss" ] ]
davenza/KDE-AMD
[ "536e1009daf3671be4356d0b5ad8e9d7780711b7" ]
[ "global_kde.py" ]
[ "\"\"\"\nThis file implements an anomaly detector using global KernelDensityEstimation models.\n\"\"\"\nimport numpy as np\nimport scipy.stats as stats\n\nimport observations_set\nimport os\n\nclass GlobalKDE(object):\n \"\"\"\n GlobalKDE implements a global Kernel Density Model for each temporal window.\n ...
[ [ "numpy.empty", "numpy.asarray", "scipy.stats.entropy", "scipy.stats.gaussian_kde", "numpy.average", "numpy.linspace", "numpy.meshgrid" ] ]
UCRoboticsLab/BaxterTictactoe
[ "967ab0ea8496ca4ce54db41b20c05de68cfe1bb9" ]
[ "src/ros_speech2text/s2t/speech_detection.py" ]
[ "import numpy as np\n\nfrom collections import deque\n\nimport rospy\n\n\nNORMAL_MAXIMUM = 16384\nBUFFER_NP_TYPE = '<i2' # little endian, signed short\n\n\ndef normalize(snd_data):\n \"\"\"Average the volume out\n \"\"\"\n r = snd_data * (NORMAL_MAXIMUM * 1. / max(1, np.abs(snd_data).max()))\n return r...
[ [ "numpy.hstack", "numpy.abs" ] ]
nikitacs16/fairseq
[ "4db7d93e03bae242bb845dd4b6a193e999a9af99" ]
[ "fairseq/utils.py" ]
[ "# Copyright (c) Facebook, Inc. and its affiliates.\n#\n# This source code is licensed under the MIT license found in the\n# LICENSE file in the root directory of this source tree.\n\nimport contextlib\nimport copy\nimport importlib.util\nimport logging\nimport math\nimport os\nimport sys\nimport warnings\nfrom col...
[ [ "torch.cuda.manual_seed", "torch.arange", "torch.nn.utils.clip_grad_norm_", "torch.is_tensor", "torch.norm", "torch.nn.functional.log_softmax", "torch.manual_seed", "torch.LongTensor", "numpy.power", "torch.nn.functional.softmax", "torch.remainder", "torch.cumsum" ...
ArabelaTso/DeepFD
[ "ce2d2ab9d78ec7a0dbd98ced72fe57631c21c937" ]
[ "Benchmark/Subjects/59282996/epoch_30/repair1.py" ]
[ "import pandas as pd\nfrom pandas import *\nfrom keras.models import Sequential\nfrom keras.layers import LSTM, Dense, TimeDistributed, Bidirectional, Dropout, Masking\nfrom keras import optimizers\nimport numpy as np\n\nX_batches_train = [np.array([[-1.00612917, 1.47313952, 2.68021318, 1.54875809, 0.98385996,\n ...
[ [ "numpy.array" ] ]
XuMuK1/JokeGeneration
[ "c13a3cd1db54e5088faf821f4375f5fec7ddd5db" ]
[ "wordLSTM/main.py" ]
[ "# coding: utf-8\nimport argparse\nimport time\nimport pickle\nimport math\nimport torch\nimport torch.nn as nn\nfrom torch.autograd import Variable\n\nimport data\nimport model\n\nparser = argparse.ArgumentParser(description='PyTorch Wikitext-2 RNN/LSTM Language Model')\nparser.add_argument('--data', type=str, def...
[ [ "torch.cuda.manual_seed", "torch.autograd.Variable", "torch.save", "torch.manual_seed", "torch.cuda.is_available", "torch.load", "torch.nn.CrossEntropyLoss" ] ]
andresperezlopez/masp
[ "c6385b6635b5e86233152ccfea2df15caee6acc7", "c6385b6635b5e86233152ccfea2df15caee6acc7" ]
[ "masp/shoebox_room_sim/quantise.py", "masp/shoebox_room_sim/image_source_method.py" ]
[ "# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n#\n# Copyright (c) 2019, Eurecat / UPF\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without\n# modification, are permitted provided that the following conditions are met:\n# * Redist...
[ [ "numpy.size", "numpy.empty", "numpy.power", "numpy.shape" ], [ "numpy.ceil", "numpy.empty", "numpy.zeros", "numpy.stack", "numpy.arange", "numpy.power", "numpy.argsort", "numpy.abs", "numpy.meshgrid" ] ]
opentiva/opentiva
[ "ba969d7fb651cf5961620dea571911ccd7dbe365" ]
[ "opentiva/pump.py" ]
[ "\n\"\"\"\nopentiva.pump\n=============\n\nThis module contains the class for simulating the pump.\n\"\"\"\n\nimport warnings\nimport numpy as np\nimport scipy.optimize as optimize\n\nimport opentiva.pkpd as pkpd\n\n\nclass Pump:\n \"\"\"Pump class simulates a target controlled infusion pump for a drug's\n ph...
[ [ "numpy.array", "numpy.empty", "numpy.zeros", "scipy.optimize.newton", "numpy.diff", "numpy.hstack", "numpy.vstack" ] ]
PokhodenkoSA/dpbench
[ "b22970237a7d550f7b0514481797247edcb4f190" ]
[ "numba/pairwise_distance/GPU/pairwise_distance_kernel.py" ]
[ "# Copyright (C) 2017-2018 Intel Corporation\n#\n# SPDX-License-Identifier: MIT\n\nimport dpctl\nimport base_pair_wise\nimport numpy as np\nimport numba_dppy\n\n@numba_dppy.kernel\ndef pairwise_python(X1, X2, D):\n i = numba_dppy.get_global_id(0)\n \n N = X2.shape[0]\n O = X1.shape[1]\n for j in rang...
[ [ "numpy.sqrt" ] ]
remanevy/Package
[ "b8c394c5b886b2a85063f8da3957ea3ca4bbec3f" ]
[ "SalishSeaTools/salishsea_tools/timeseries_tools.py" ]
[ "# Copyright 2013-2017 The Salish Sea MEOPAR contributors\n# and The University of British Columbia\n\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n\n# http://www.apache.org/lice...
[ [ "numpy.concatenate", "numpy.meshgrid", "numpy.empty", "numpy.zeros" ] ]
taodav/GANs
[ "402a6b4d38c202969b6494161e9a038890c14a5d" ]
[ "train.py" ]
[ "import torch\nimport datetime\n\nfrom torch import nn, optim\nfrom torch.utils.data import DataLoader\nfrom torchvision.utils import save_image\nfrom tqdm import tqdm\nfrom tensorboard_logger import configure, log_value\n\nfrom utils.helpers import save_checkpoint\nfrom constants import ROOT_DIR\n\nclass MNISTTrai...
[ [ "torch.zeros", "torch.ones", "torch.utils.data.DataLoader", "torch.nn.BCELoss", "torch.randn" ] ]
fakegit/zvt
[ "d7d7d592ba870944e9cb967a8d1e46d12c24d02a" ]
[ "zvt/factors/factor.py" ]
[ "# -*- coding: utf-8 -*-\nimport enum\nimport logging\nimport time\nfrom typing import List, Union\n\nimport pandas as pd\n\nfrom zvdata import IntervalLevel\nfrom zvdata.api import get_data, df_to_db\nfrom zvdata.normal_data import NormalData\nfrom zvdata.reader import DataReader, DataListener\nfrom zvdata.utils.p...
[ [ "pandas.date_range", "pandas.MultiIndex.from_product", "pandas.concat" ] ]
dayangxiaosong/MTProject
[ "0943758731dc6969e58644412dba2c8af2130555" ]
[ "fairseq/models/skip_transformer.py" ]
[ "# Copyright (c) 2017-present, Facebook, Inc.\n# All rights reserved.\n#\n# This source code is licensed under the license found in the LICENSE file in\n# the root directory of this source tree. An additional grant of patent rights\n# can be found in the PATENTS file in the same directory.\n\nimport math\n\nimport ...
[ [ "torch.nn.Linear", "torch.rand", "torch.nn.ModuleList", "torch.nn.init.constant_", "torch.nn.functional.dropout", "torch.FloatTensor", "torch.nn.init.xavier_uniform_", "torch.nn.init.normal_", "torch.nn.functional.linear", "torch.Tensor", "torch.nn.Embedding" ] ]
robOcity/wakeful
[ "e3a50649e6208da28feea2fe402f119b0223293d" ]
[ "wakeful/preprocessing.py" ]
[ "\"\"\"\nGet set of normal and attack Bro logs and create a balanced dataset.\n\"\"\"\n#TODO fix doc strings\nimport os\nfrom sklearn.utils import resample\nfrom sklearn.model_selection import train_test_split\nfrom . import log_munger, metrics\n\nCONN_LOG_DROP_COLS = cols_to_drop = ['conn_state', 'history', 'id.or...
[ [ "sklearn.model_selection.train_test_split", "sklearn.utils.resample" ] ]
DAVIDDAIJUNCHEN/PIP-experiments
[ "e5787f7dc09c5138e830fc5f8d9b515e7d7a457e" ]
[ "optimal_dimensionality/glove/noise_est_log_count.py" ]
[ "from __future__ import absolute_import\nfrom __future__ import division\nfrom __future__ import print_function\n\nimport collections\nimport math\nimport os\nimport random\nimport zipfile\nimport cPickle as pickle\nimport numpy as np\nfrom six.moves import urllib\nfrom six.moves import xrange # pylint: disable\nf...
[ [ "matplotlib.use", "numpy.log", "numpy.zeros", "numpy.random.permutation", "numpy.mean", "numpy.std" ] ]
KareemErgawy-TomTom/iree
[ "1a88333d43ab1d564cc9412c04815f7eaa20f6ee" ]
[ "bindings/python/iree/runtime/system_api_test.py" ]
[ "# Lint as: python3\n# Copyright 2019 The IREE Authors\n#\n# Licensed under the Apache License v2.0 with LLVM Exceptions.\n# See https://llvm.org/LICENSE.txt for license information.\n# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception\n\n# pylint: disable=unused-variable\n\nimport re\n\nfrom absl import logg...
[ [ "numpy.testing.assert_allclose", "numpy.array" ] ]
AndersBarth/MEMtoolbox
[ "27d3c3c489f0744d052435841622e5f0eafa074a" ]
[ "memfunctions/mem.py" ]
[ "from numpy import log, log10, linalg, gradient, logspace, zeros, array, \\\n identity, arange, linspace, asarray, diag, sqrt, ndarray, sum\nfrom cvxopt import matrix, solvers\nfrom numba import jit\n\nsolvers.options['show_progress'] = False\nsolvers.options['maxiters'] = 200\n\n\n# convert amplitude to probabi...
[ [ "numpy.array", "numpy.linalg.norm", "numpy.asarray", "numpy.zeros", "numpy.log", "numpy.sum", "numpy.identity", "numpy.arange", "numpy.diag", "numpy.sqrt", "numpy.log10", "numpy.gradient" ] ]
noboevbo/nobos_commons
[ "471e52e10fd2228c106777c72d8439e58b047003" ]
[ "nobos_commons/feature_preparations/feature_vec_producers/from_skeleton_joints/potion/heatmap_colorizer.py" ]
[ "from typing import List\n\nimport numpy as np\n\n\ndef colorize_heatmaps(heatmaps: np.ndarray, color: List[int], channels: int = 3):\n color_array = np.array([[[color]]])\n clipped = np.clip(heatmaps, 0, 1)\n clipped = np.squeeze(clipped, axis=0)\n clipped = clipped[:, :, :, None] * np.ones(channels, d...
[ [ "numpy.array", "numpy.matmul", "numpy.ones", "numpy.clip", "numpy.squeeze" ] ]
VolodyaCO/jax
[ "62c7744e68c66fae9faf9d8d00fea8aad4418cf3" ]
[ "tests/generated_fun_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.random.seed", "numpy.random.randint", "numpy.random.randn", "numpy.random.rand" ] ]
jmonsalverodilla/Stock-Portfolio-Tracker
[ "320beb97e09fb1073ac7c264a0d8e1a65db7013d" ]
[ "stock_portfolio_analyzer.py" ]
[ "#Libraries\nimport base64\nimport datetime\nfrom io import BytesIO, StringIO\nimport os\nimport pandas as pd\nimport streamlit as st\nimport plotly\nimport yfinance as yf\n\nfrom technical_analysis import download_data, portfolio_return, benchmark_return, wealth_plot,accumulated_return_plot, drawdawn_plot, allocat...
[ [ "pandas.read_csv", "pandas.concat" ] ]
8BookIt8/Genetic-Algorithm
[ "6293e075fe2b76755cda3bb98e5c670f5d36f812" ]
[ "BIgame.py" ]
[ "from os import name\n\nimport matplotlib\nimport BIbear\nimport BIfood\nimport BIgeneration\n\nimport pygame\nimport matplotlib.pyplot as plt\nimport matplotlib.font_manager as fm\nimport yaml\n\nfrom random import uniform, randrange\nimport math\nimport keyboard\nimport time\n\nclass BIGame(): \n # 기본 설정\n ...
[ [ "matplotlib.pyplot.show", "matplotlib.font_manager.FontProperties", "matplotlib.pyplot.figure" ] ]
xxchenxx/GAN-LTH
[ "71a25098656c4c990835288e6f763f863d227c10", "f76dfde41c246c8d885612fae58dd1e19c4e76ea" ]
[ "src/SNGAN/evaluation.py", "src/CycleGAN/utils.py" ]
[ "import os\nimport torch\nimport torch.nn as nn \n\nimport numpy as np\nfrom imageio import imsave\nfrom torchvision.utils import make_grid\nimport torch.nn.utils.prune as prune\n\nimport argparse\nfrom tqdm import tqdm\nfrom copy import deepcopy\n\nfrom utils.utils import set_seed\nfrom utils.inception_score impor...
[ [ "torch.nn.Linear", "numpy.random.normal", "torch.nn.utils.prune.custom_from_mask", "torch.nn.Tanh", "torch.nn.BatchNorm2d", "torch.nn.ReLU", "torch.nn.Conv2d", "torch.load", "torch.nn.UpsamplingNearest2d", "torch.sum" ], [ "torch.cat", "torch.nn.init.constant", ...
jlema/Udacity-Self-Driving-Car-Engineer-Nanodegree
[ "55ea131feded258015af418a087fbb7a88659fc3" ]
[ "Term 1- Computer Vision and Deep Learning/Project 3 - Behavioral Cloning/model.py" ]
[ "import argparse\nimport json\nimport pandas as pd\nimport numpy as np\n\nfrom image_preproc import load_image, reduce_image, flip_image, trans_image, crop_image, scale_brightness_image\nfrom keras.models import Sequential\nfrom keras.layers import Dense, Flatten, Lambda, ELU\nfrom keras.layers import Convolution2D...
[ [ "numpy.array", "numpy.random.choice", "numpy.random.randint", "sklearn.model_selection.train_test_split", "pandas.read_csv" ] ]
huangjunxiong11/FaceMap
[ "f320ce517edcaa4d9963ad0571e686cbe07fdfbb" ]
[ "faceswap/scripts/train.py" ]
[ "#!/usr/bin python3\n\"\"\" Main entry point to the training process of FaceSwap \"\"\"\n\nimport logging\nimport os\nimport sys\n\nfrom threading import Lock\nfrom time import sleep\n\nimport cv2\nimport tensorflow as tf\nfrom keras.backend.tensorflow_backend import set_session\n\nfrom lib.image import read_image\...
[ [ "tensorflow.ConfigProto", "tensorflow.Session" ] ]
hee9joon/Super-Resolution-GANs
[ "197ff7ec5939be5e5c823e6354a86d26b8cadeee" ]
[ "losses.py" ]
[ "import torch\nimport torch.nn as nn\nfrom torchvision.models import vgg19\n\n\nclass TVLoss(nn.Module):\n \"\"\"Total Variation Loss for SRGAN\"\"\"\n def __init__(self, tv_loss_weight=1):\n super(TVLoss, self).__init__()\n self.tv_loss_weight = tv_loss_weight\n\n def forward(self, x):\n ...
[ [ "torch.nn.MSELoss", "torch.pow", "torch.nn.L1Loss" ] ]
dataiku-research/performance_prediction_under_shift
[ "6ca75afc5d0925a7c463370c5603a0b85fa5d0fc" ]
[ "drift_dac/tests/test.py" ]
[ "from drift_dac.tests.perturbations_tests_utils import *\nfrom drift_dac.perturbation_shared_utils import PerturbationConstants\nfrom drift_dac.drift_metrics import compute_drift_metrics\nfrom drift_dac.domain_classifier import DomainClassifier, MultiDomainClassifier, DomainClassifierModel\n\nfrom sklearn.model_sel...
[ [ "scipy.sparse.issparse", "sklearn.metrics.confusion_matrix", "sklearn.impute.SimpleImputer", "sklearn.preprocessing.StandardScaler", "sklearn.ensemble.RandomForestClassifier", "sklearn.model_selection.train_test_split", "sklearn.preprocessing.OneHotEncoder" ] ]
hyosubkim/pymc3
[ "4bba0e223af299b3e766bf7f579e3085b72124da" ]
[ "pymc3/math.py" ]
[ "# Copyright 2020 The PyMC 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# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by appli...
[ [ "numpy.triu_indices", "numpy.asarray", "numpy.zeros", "scipy.sparse.block_diag", "scipy.linalg.block_diag", "numpy.arange", "numpy.tril_indices", "numpy.linalg.svd", "numpy.abs", "numpy.meshgrid" ] ]
ml-postech/LISA
[ "4f3c1cd7e56d6d7b107a587152cd703663cfa4c4" ]
[ "tools/save_waveform_diff.py" ]
[ "import argparse\nimport os\n\nimport torch\nimport torchaudio\nimport torchaudio.functional as F\nimport torchaudio.transforms as T\n\nimport librosa\nimport matplotlib.pyplot as plt\n\n\ndef plot_waveform_diff(original,pred, sample_rate, filename, title=\"Waveform\", xlim=None, ylim=None):\n original = original....
[ [ "torch.arange", "matplotlib.pyplot.savefig", "matplotlib.pyplot.subplots", "matplotlib.pyplot.show", "matplotlib.pyplot.axis" ] ]
leelasd/ChemMORT
[ "9ade488d2da9207b88f2ebdf2ffc9a5cf20bae4c", "9ade488d2da9207b88f2ebdf2ffc9a5cf20bae4c" ]
[ "cddd/model_helper.py", "mso/optimizer.py" ]
[ "\"\"\"Helper functions that build the translation model with a corroponding graph and session.\"\"\"\nfrom collections import namedtuple\nimport tensorflow as tf\nfrom cddd import models\nfrom cddd import input_pipeline\n\n\ndef build_models(hparams, modes=[\"TRAIN\", \"EVAL\", \"ENCODE\"]):\n \"\"\"Helper func...
[ [ "tensorflow.Session", "tensorflow.Graph", "tensorflow.reset_default_graph", "tensorflow.GPUOptions" ], [ "numpy.concatenate", "pandas.DataFrame" ] ]