code
stringlengths
31
1.05M
apis
list
extract_api
stringlengths
97
1.91M
""" This script is to generate the label and comparison result based on training both diagnostic label data (RSD or 13 experts absoluete labels) and pairwise comparison data Parameters : ------------- dataType: 'auto' or 'manual' 'auto' would load the automatic segmentation data. 'manual' would load the manual seg...
[ "scipy.io.loadmat", "cvxOpt.SVM_Log", "numpy.zeros", "sklearn.metrics.roc_auc_score", "numpy.append", "numpy.array", "numpy.reshape", "numpy.tile", "numpy.dot" ]
[((5949, 6020), 'scipy.io.loadmat', 'loadmat', (['"""../../../Data/ProbalisticModel/iROP_6DD_1st100_Partition.mat"""'], {}), "('../../../Data/ProbalisticModel/iROP_6DD_1st100_Partition.mat')\n", (5956, 6020), False, 'from scipy.io import loadmat\n'), ((6036, 6091), 'scipy.io.loadmat', 'loadmat', (['"""../../../Data/Pro...
# -*- coding: utf-8 -*- from numpy import array, arange from pyNastran.gui.qt_version import qt_version from qtpy import QtCore, QtGui from qtpy.QtWidgets import ( QDialog, QPushButton, QApplication, QHBoxLayout, QVBoxLayout, QTableWidget, QTableWidgetItem, ) if qt_version == 4: QString = QtCore.QString e...
[ "qtpy.QtGui.QFont", "qtpy.QtWidgets.QHBoxLayout", "pyNastran.gui.menus.groups_modify.Group", "qtpy.QtWidgets.QTableWidget", "qtpy.QtWidgets.QVBoxLayout", "qtpy.QtGui.QColor", "numpy.array", "qtpy.QtWidgets.QPushButton", "qtpy.QtWidgets.QTableWidgetItem", "signal.signal", "qtpy.QtWidgets.QApplica...
[((11589, 11633), 'signal.signal', 'signal.signal', (['signal.SIGINT', 'signal.SIG_DFL'], {}), '(signal.SIGINT, signal.SIG_DFL)\n', (11602, 11633), False, 'import signal\n'), ((11731, 11753), 'qtpy.QtWidgets.QApplication', 'QApplication', (['sys.argv'], {}), '(sys.argv)\n', (11743, 11753), False, 'from qtpy.QtWidgets i...
#!/usr/bin/env python VERSION_STR = 'TGSA v0.99 18-Apr-2013' import os from math import sin,cos,atan,pi,log import numpy as np from scipy.ndimage.interpolation import rotate from scipy.signal import medfilt import pyfits import ConfigParser import wx import wx.html as html import wx.grid as grid import wx.aui as aui...
[ "wx.Menu", "numpy.sum", "numpy.argmax", "numpy.clip", "matplotlib.backends.backend_wxagg.FigureCanvasWxAgg", "numpy.exp", "ConfigParser.ConfigParser", "wx.Size", "os.path.join", "wx.PyEventBinder", "wx.EmptyBitmap", "numpy.copy", "wx.html.HtmlWindow", "numpy.std", "wx.AboutBox", "wx.Fl...
[((340, 363), 'matplotlib.use', 'matplotlib.use', (['"""WXAgg"""'], {}), "('WXAgg')\n", (354, 363), False, 'import matplotlib\n'), ((2091, 2108), 'wx.NewEventType', 'wx.NewEventType', ([], {}), '()\n', (2106, 2108), False, 'import wx\n'), ((2125, 2161), 'wx.PyEventBinder', 'wx.PyEventBinder', (['myEVT_BROADCAST', '(1)'...
import jug.compound import jug.mapreduce import numpy as np from jug.backends.dict_store import dict_store from jug.tests.utils import simple_execute from jug.compound import CompoundTask from jug.tests.test_mapreduce import mapper, reducer, dfs_run from jug.tests.task_reset import task_reset @task_reset def test_comp...
[ "jug.compound.CompoundTask", "collections.defaultdict", "numpy.random.rand", "jug.tests.test_mapreduce.dfs_run", "jug.options.default_options.copy", "jug.tests.utils.simple_execute", "jug.backends.dict_store.dict_store" ]
[((354, 366), 'jug.backends.dict_store.dict_store', 'dict_store', ([], {}), '()\n', (364, 366), False, 'from jug.backends.dict_store import dict_store\n'), ((375, 396), 'numpy.random.rand', 'np.random.rand', (['(10000)'], {}), '(10000)\n', (389, 396), True, 'import numpy as np\n'), ((405, 462), 'jug.compound.CompoundTa...
# -*- coding: utf-8 -*- import scipy.linalg, numpy, pandas, functools # import pdb def dummy(DF, cols=None): """Dummy code select columns of a DataFrame.""" return pandas.concat((pandas.get_dummies(DF[col]) for col in (DF.columns if cols is None else cols)), axis=1, keys = DF.columns) def _mul(*args): """...
[ "numpy.outer", "numpy.argmax", "pandas.get_dummies", "numpy.apply_along_axis", "numpy.cumsum", "numpy.array", "numpy.linalg.norm", "functools.reduce", "numpy.sqrt" ]
[((372, 405), 'functools.reduce', 'functools.reduce', (['numpy.dot', 'args'], {}), '(numpy.dot, args)\n', (388, 405), False, 'import scipy.linalg, numpy, pandas, functools\n'), ((2165, 2222), 'numpy.argmax', 'numpy.argmax', (['((self.E if benzecri else self.s ** 2) < TOL)'], {}), '((self.E if benzecri else self.s ** 2)...
import os import time import argparse import hashlib import numpy as np import pickle import torch from utils.loss import get_loss from model.factory import build_model from utils.config import load_config, load_and_update_eval_config from utils.checkpoint import load_state_dict, set_seed_and_random_states from utils...
[ "pickle.dump", "argparse.ArgumentParser", "numpy.empty", "pickle.load", "utils.checkpoint.load_state_dict", "train.batch_loop", "utils.config.load_config", "os.path.join", "model.factory.build_model", "os.path.exists", "utils.loss.get_loss", "utils.scores.find_best_threshold", "utils.checkpo...
[((641, 712), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""Test one or an ensemble of CNN\'s"""'}), '(description="Test one or an ensemble of CNN\'s")\n', (664, 712), False, 'import argparse\n'), ((5134, 5176), 'os.path.join', 'os.path.join', (['experiment_folder', '"""cfg.yml"""'], {}...
from __future__ import (absolute_import, division, print_function, unicode_literals) from nose.plugins.attrib import attr from nose.tools import assert_raises, raises import numpy as np import pandas as pd from ..match import Match, whichMatched from ..data import gerber_green_imai def creat...
[ "pandas.DataFrame", "numpy.random.seed", "numpy.ones", "numpy.array", "numpy.testing.assert_equal", "nose.tools.raises" ]
[((499, 521), 'nose.tools.raises', 'raises', (['AssertionError'], {}), '(AssertionError)\n', (505, 521), False, 'from nose.tools import assert_raises, raises\n'), ((628, 650), 'nose.tools.raises', 'raises', (['AssertionError'], {}), '(AssertionError)\n', (634, 650), False, 'from nose.tools import assert_raises, raises\...
##################### ##### UNIT TEST ##### ##################### import unittest import numpy as np import pandas as pd #from ranky import * import ranky as rk def test_distance_matrix(): print('Distance matrix...') m_template = pd.read_csv('data/matrix.csv') m_template.index = m_template['index'] m_...
[ "pandas.read_csv", "ranky.concordance", "unittest.main", "ranky.borda", "ranky.corr", "ranky.combined_metric", "ranky.center", "ranky.distance_matrix", "ranky.kendall_w", "ranky.read_codalab_csv", "numpy.testing.assert_array_equal", "ranky.score", "ranky.Generator", "ranky.rank", "ranky....
[((240, 270), 'pandas.read_csv', 'pd.read_csv', (['"""data/matrix.csv"""'], {}), "('data/matrix.csv')\n", (251, 270), True, 'import pandas as pd\n'), ((431, 461), 'ranky.distance_matrix', 'rk.distance_matrix', (['m_template'], {}), '(m_template)\n', (449, 461), True, 'import ranky as rk\n'), ((528, 580), 'ranky.distanc...
"""Сontains ECG processing tools.""" import os import struct import datetime from xml.etree import ElementTree import numpy as np from numba import njit from scipy.io import wavfile import pyedflib import wfdb try: import pydicom as dicom except ImportError: import dicom # Constants # This is the predefine...
[ "numpy.fft.rfft", "numpy.argmax", "wfdb.rdsamp", "numpy.empty", "numba.njit", "numpy.ones", "scipy.io.wavfile.read", "numpy.random.randint", "numpy.convolve", "numpy.pad", "numpy.fft.irfft", "wfdb.rdann", "numpy.apply_along_axis", "numpy.int", "numpy.linspace", "xml.etree.ElementTree.p...
[((599, 631), 'numpy.array', 'np.array', (['[14, 15, 16]', 'np.int64'], {}), '([14, 15, 16], np.int64)\n', (607, 631), True, 'import numpy as np\n'), ((643, 682), 'numpy.array', 'np.array', (['[5, 6, 7, 8, 9, 10]', 'np.int64'], {}), '([5, 6, 7, 8, 9, 10], np.int64)\n', (651, 682), True, 'import numpy as np\n'), ((696, ...
# ----------------------------------------------------------- # Stacked Cross Attention Network implementation based on # https://arxiv.org/abs/1803.08024. # "Stacked Cross Attention for Image-Text Matching" # <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # # Writen by <NAME>, 2018 # ------------------------------------------...
[ "numpy.load", "torch.stack", "torch.utils.data.DataLoader", "torch.Tensor", "os.path.join" ]
[((3458, 3480), 'torch.stack', 'torch.stack', (['images', '(0)'], {}), '(images, 0)\n', (3469, 3480), False, 'import torch\n'), ((4234, 4360), 'torch.utils.data.DataLoader', 'torch.utils.data.DataLoader', ([], {'dataset': 'dset', 'batch_size': 'batch_size', 'shuffle': 'shuffle', 'pin_memory': '(True)', 'collate_fn': 'c...
import time from datetime import timedelta import cv2 import numpy as np class PoseAnalyser: #def _print(*args, **kwargs): # print(args, kwargs) last_inference_time = 0 average_inference = 0.0 remaining_time = 0.00 def viewKeypointsOnSample(self, sample_dir, sample_type="mixed", dra...
[ "numpy.load", "numpy.save", "cv2.waitKey", "cv2.imshow", "time.sleep", "cv2.VideoCapture", "time.time", "numpy.array", "datetime.timedelta", "cv2.destroyAllWindows" ]
[((603, 625), 'numpy.load', 'np.load', (['keypoint_file'], {}), '(keypoint_file)\n', (610, 625), True, 'import numpy as np\n'), ((640, 668), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video_file'], {}), '(video_file)\n', (656, 668), False, 'import cv2\n'), ((1651, 1679), 'cv2.VideoCapture', 'cv2.VideoCapture', (['video...
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import tensorflow as tf import pandas as pd import numpy as np from sklearn.utils import shuffle from sklearn.preprocessing import OneHotEncoder ''' 客户流失预测模型 owNumber:行号 × CustomerID:用户编号 × Surname:用户姓名 × CreditScore:信用分数 Geography:用户所在国家/地区 × Gender:用户性别 Age:年龄 Tenur...
[ "pandas.read_csv", "tensorflow.matmul", "tensorflow.sigmoid", "tensorflow.truncated_normal", "tensorflow.nn.softmax", "tensorflow.nn.softmax_cross_entropy_with_logits_v2", "tensorflow.placeholder", "tensorflow.summary.FileWriter", "tensorflow.summary.merge_all", "tensorflow.summary.scalar", "ten...
[((466, 503), 'pandas.read_csv', 'pd.read_csv', (['"""./data/select-data.csv"""'], {}), "('./data/select-data.csv')\n", (477, 503), True, 'import pandas as pd\n'), ((514, 551), 'pandas.read_csv', 'pd.read_csv', (['"""./data/scalar-test.csv"""'], {}), "('./data/scalar-test.csv')\n", (525, 551), True, 'import pandas as p...
""" Performance check of DGL model + trainer + dataset """ import numpy as np from tqdm import tqdm import pickle import torch import torch.nn.functional as F from dgl.data import CoraGraphDataset, PubmedGraphDataset, CiteseerGraphDataset from dgl.nn.pytorch import GraphConv, GATConv, SAGEConv import logging logging...
[ "torch.nn.Dropout", "pickle.loads", "dgl.data.CoraGraphDataset", "numpy.random.seed", "argparse.ArgumentParser", "logging.basicConfig", "dgl.nn.pytorch.GATConv", "torch.nn.ModuleList", "torch.manual_seed", "dgl.nn.pytorch.GraphConv", "numpy.std", "torch.nn.functional.dropout", "dgl.data.Cite...
[((313, 353), 'logging.basicConfig', 'logging.basicConfig', ([], {'level': 'logging.ERROR'}), '(level=logging.ERROR)\n', (332, 353), False, 'import logging\n'), ((3157, 3187), 'argparse.ArgumentParser', 'argparse.ArgumentParser', (['"""dgl"""'], {}), "('dgl')\n", (3180, 3187), False, 'import argparse\n'), ((491, 518), ...
# ---------------------------------------------------------------------------- # Copyright 2015-2016 Nervana Systems Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apa...
[ "numpy.minimum", "numpy.maximum", "neon.backends.nervanacpu.NervanaCPU", "past.utils.old_div", "numpy.zeros", "numpy.where", "numpy.random.random", "neon.backends.nervanagpu.NervanaGPU", "itertools.product" ]
[((2466, 2508), 'numpy.zeros', 'np.zeros', (['(box_count, 5)'], {'dtype': 'np.float32'}), '((box_count, 5), dtype=np.float32)\n', (2474, 2508), True, 'import numpy as np\n'), ((4030, 4042), 'neon.backends.nervanagpu.NervanaGPU', 'NervanaGPU', ([], {}), '()\n', (4040, 4042), False, 'from neon.backends.nervanagpu import ...
# -*- coding: utf-8 -*- # # This file is part of MIEZE simulation. # Copyright (C) 2019, 2020 TUM FRM2 E21 Research Group. # # This is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Utilities and helper functions.""" import csv impor...
[ "numpy.asarray", "csv.reader", "csv.writer" ]
[((2064, 2099), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (2074, 2099), False, 'import csv\n'), ((3165, 3200), 'csv.reader', 'csv.reader', (['csv_file'], {'delimiter': '""","""'}), "(csv_file, delimiter=',')\n", (3175, 3200), False, 'import csv\n'), ((4281, 431...
import sys sys.path.insert(1,"../../") import h2o from tests import pyunit_utils import numpy as np def col_names_check(): iris_wheader = h2o.import_file(pyunit_utils.locate("smalldata/iris/iris_wheader.csv")) assert iris_wheader.col_names == ["sepal_len","sepal_wid","petal_len","petal_wid","class"], \ "Exp...
[ "h2o.H2OFrame.from_python", "numpy.random.randn", "tests.pyunit_utils.standalone_test", "sys.path.insert", "h2o.H2OFrame", "tests.pyunit_utils.locate" ]
[((11, 39), 'sys.path.insert', 'sys.path.insert', (['(1)', '"""../../"""'], {}), "(1, '../../')\n", (26, 39), False, 'import sys\n'), ((1583, 1631), 'h2o.H2OFrame', 'h2o.H2OFrame', (["{'B': ['a', 'a', 'b', 'NA', 'NA']}"], {}), "({'B': ['a', 'a', 'b', 'NA', 'NA']})\n", (1595, 1631), False, 'import h2o\n'), ((1754, 1839)...
import os from curses import wrapper import csv import numpy as np from settings import settings from utils import data from action_utils import parse_action_args from args import get_args from comm import CommNetMLP from evaluator import Evaluator from nns.models import * from utils.util_fns import * from utils.game_...
[ "utils.game_tracker.GameTracker.from_file", "csv.writer", "utils.data.init", "numpy.std", "curses.wrapper", "args.get_args", "numpy.random.randint", "numpy.mean", "nns.probe.Probe", "action_utils.parse_action_args", "comm.CommNetMLP", "os.path.join", "os.listdir" ]
[((734, 769), 'utils.game_tracker.GameTracker.from_file', 'GameTracker.from_file', (['tracker_path'], {}), '(tracker_path)\n', (755, 769), False, 'from utils.game_tracker import GameTracker\n'), ((3091, 3128), 'utils.data.init', 'data.init', (['args.env_name', 'args', '(False)'], {}), '(args.env_name, args, False)\n', ...
""" Dqn agent that records RGB screenshots and RAM during training. """ from rl.agents.dqn import DQNAgent import warnings from copy import deepcopy import numpy as np from keras.callbacks import History from rl.callbacks import ( CallbackList, TestLogger, TrainEpisodeLogger, TrainIntervalLogger, ...
[ "rl.callbacks.TrainEpisodeLogger", "rl.callbacks.TrainIntervalLogger", "copy.deepcopy", "keras.callbacks.History", "numpy.isreal", "numpy.zeros_like", "numpy.float32", "numpy.random.randint", "rl.callbacks.Visualizer", "numpy.int16", "rl.callbacks.CallbackList" ]
[((3633, 3642), 'keras.callbacks.History', 'History', ([], {}), '()\n', (3640, 3642), False, 'from keras.callbacks import History\n'), ((3694, 3717), 'rl.callbacks.CallbackList', 'CallbackList', (['callbacks'], {}), '(callbacks)\n', (3706, 3717), False, 'from rl.callbacks import CallbackList, TestLogger, TrainEpisodeLo...
## MY FIRST NEURAL NETWORK !!! WITH ACCURACY 93% ## This NN can tell whether an image is a triangle or not # increase the shapes' sizes => increase accuracy (easier to recognize) # introducing noise (50,20,20) => decrease accuracy by ~3% # using tanh as activation function instead of sigmoid => the result converg...
[ "numpy.tanh", "random.randint", "numpy.random.randn", "random.getrandbits", "numpy.zeros", "time.time", "numpy.array", "numpy.exp", "numpy.random.choice", "numpy.cosh" ]
[((1125, 1156), 'random.randint', 'random.randint', (['(size // 3)', 'size'], {}), '(size // 3, size)\n', (1139, 1156), False, 'import random\n'), ((1181, 1203), 'numpy.zeros', 'np.zeros', (['(size, size)'], {}), '((size, size))\n', (1189, 1203), True, 'import numpy as np\n'), ((1391, 1431), 'random.randint', 'random.r...
import copy import logging import os from collections import defaultdict, deque, namedtuple import numpy as np from ray.tune.schedulers import FIFOScheduler, TrialScheduler from ray.tune.suggest.variant_generator import format_vars from ray.tune.trial import Checkpoint, Trial from tune_tf2.defaults import EXPLOIT_CSV,...
[ "copy.deepcopy", "ray.tune.schedulers.FIFOScheduler.__init__", "numpy.abs", "os.stat", "collections.deque", "ray.tune.suggest.variant_generator.format_vars", "collections.defaultdict", "numpy.max", "collections.namedtuple", "os.path.join", "logging.getLogger" ]
[((456, 500), 'logging.getLogger', 'logging.getLogger', (['"""ray.tune.schedulers.pbt"""'], {}), "('ray.tune.schedulers.pbt')\n", (473, 500), False, 'import logging\n'), ((516, 615), 'collections.namedtuple', 'namedtuple', (['"""TrialState"""', "['orig_tag', 'score', 'ckpt', 'generation', 'last_perturbation_time']"], {...
from neuromp.preprocessing.tree import AST from enum import IntEnum from itertools import product import subprocess import time import numpy as np from copy import deepcopy class VarStates(IntEnum): SHARED = 1 PRIVATE = 2 REDUCTION = 3 class Code(object): def __init__(self, code): self.ast = A...
[ "copy.deepcopy", "subprocess.Popen", "subprocess.check_output", "neuromp.preprocessing.tree.AST", "time.time", "numpy.array" ]
[((319, 324), 'neuromp.preprocessing.tree.AST', 'AST', ([], {}), '()\n', (322, 324), False, 'from neuromp.preprocessing.tree import AST\n'), ((2330, 2344), 'numpy.array', 'np.array', (['resp'], {}), '(resp)\n', (2338, 2344), True, 'import numpy as np\n'), ((2393, 2413), 'copy.deepcopy', 'deepcopy', (['self.lines'], {})...
from abess.linear import abessLogistic from abess.datasets import make_glm_data import numpy as np from time import time from sklearn.metrics import roc_auc_score import matplotlib.pyplot as plt np.random.seed(0) n = 500 p = 2000 k = 20 rho = 0.1 M = 50 search_path = [32, 64, 128, 256, 512, 1024, 2048] met_save = Tr...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.subplot", "numpy.load", "numpy.save", "abess.datasets.make_glm_data", "numpy.random.seed", "matplotlib.pyplot.savefig", "matplotlib.pyplot.ylim", "numpy.hstack", "time.time", "matplotlib.pyplot.figure", "matplotlib.pyplot.ylabel", "matplotlib.pyp...
[((196, 213), 'numpy.random.seed', 'np.random.seed', (['(0)'], {}), '(0)\n', (210, 213), True, 'import numpy as np\n'), ((469, 516), 'abess.datasets.make_glm_data', 'make_glm_data', ([], {'n': 'n', 'p': 'p', 'k': 'k', 'family': '"""binomial"""'}), "(n=n, p=p, k=k, family='binomial')\n", (482, 516), False, 'from abess.d...
import os.path as osp from collections import defaultdict import itertools as it import logging from wepy.resampling.decisions.clone_merge import MultiCloneMergeDecision from wepy.reporter.dashboard import ResamplerDashboardSection import numpy as np import pandas as pd class REVODashboardSection(ResamplerDashboardS...
[ "numpy.average", "numpy.triu", "numpy.max", "numpy.min", "numpy.where" ]
[((3886, 3910), 'numpy.triu', 'np.triu', (['distance_matrix'], {}), '(distance_matrix)\n', (3893, 3910), True, 'import numpy as np\n'), ((4009, 4036), 'numpy.average', 'np.average', (['distance_values'], {}), '(distance_values)\n', (4019, 4036), True, 'import numpy as np\n'), ((4065, 4088), 'numpy.min', 'np.min', (['di...
import powerlaw import pandas as pd import numpy as np from collections import defaultdict import datetime import math from tqdm import tqdm from ..utils import constants, utils from scipy.sparse import lil_matrix import random import logging import inspect from ..core.trajectorydataframe import TrajDataFrame from ..mo...
[ "numpy.sum", "numpy.random.seed", "powerlaw.Truncated_Power_Law", "numpy.ones", "collections.defaultdict", "inspect.getargvalues", "scipy.sparse.lil_matrix", "geopy.distance.distance", "pandas.DataFrame", "math.pow", "datetime.timedelta", "random.seed", "numpy.random.choice", "pandas.Serie...
[((421, 437), 'geopy.distance.distance', 'distance', (['p0', 'p1'], {}), '(p0, p1)\n', (429, 437), False, 'from geopy.distance import distance\n'), ((3136, 3152), 'collections.defaultdict', 'defaultdict', (['int'], {}), '(int)\n', (3147, 3152), False, 'from collections import defaultdict\n'), ((4647, 4680), 'numpy.dele...
""" Naive well mixed model without delays. Saves result in .json format, [({parameter:value}, {species:[[time series]]})]. Output file name should be provided as the first argument when executing the script. """ import sys import os.path import numpy as np import gillespy2 import json def generate_partiti...
[ "gillespy2.Species", "gillespy2.Parameter", "gillespy2.Model.__init__", "numpy.linspace", "gillespy2.Model.run", "gillespy2.Reaction" ]
[((524, 574), 'gillespy2.Model.__init__', 'gillespy2.Model.__init__', (['self', '"""Well Mixed Model"""'], {}), "(self, 'Well Mixed Model')\n", (548, 574), False, 'import gillespy2\n'), ((1739, 1908), 'gillespy2.Reaction', 'gillespy2.Reaction', ([], {'name': '"""tcp"""', 'reactants': "{self.dict_species['Gf']: 1}", 'pr...
"""Classes of fundamental atomistic concepts Representations of fundamental atomistic concepts, such as energy levels, Atoms,... Uses ASE's Atoms objects. """ import numpy as np import copy as cp from ase.atoms import Atom, Atoms class EnergyLevel(object): """An energy level""" def __init__(self, energy, ...
[ "copy.copy", "scipy.special.erfinv", "numpy.mean", "numpy.array", "numpy.exp", "numpy.tan", "numpy.convolve", "numpy.unique", "numpy.sqrt" ]
[((2482, 2523), 'numpy.array', 'np.array', (['[l.energy for l in self.levels]'], {}), '([l.energy for l in self.levels])\n', (2490, 2523), True, 'import numpy as np\n'), ((2581, 2626), 'numpy.array', 'np.array', (['[l.occupation for l in self.levels]'], {}), '([l.occupation for l in self.levels])\n', (2589, 2626), True...
import argparse from datetime import datetime import tensorflow as tf import cv2 import pandas as pd import numpy as np from PIL import Image import os import sys from tensorflow.keras import layers, models, optimizers NCLASSES = 2 NUM_CHANNELS = 3 lr = 0.001 ne = 250 HEIGHT = 224 WIDTH = 224 image_feature_descripti...
[ "argparse.ArgumentParser", "tensorflow.keras.layers.Dense", "tensorflow.keras.callbacks.ModelCheckpoint", "tensorflow.keras.applications.Xception", "tensorflow.image.decode_png", "tensorflow.keras.Sequential", "tensorflow.keras.optimizers.RMSprop", "pandas.DataFrame", "os.path.dirname", "tensorflo...
[((342, 378), 'tensorflow.io.FixedLenFeature', 'tf.io.FixedLenFeature', (['[]', 'tf.string'], {}), '([], tf.string)\n', (363, 378), True, 'import tensorflow as tf\n'), ((393, 428), 'tensorflow.io.FixedLenFeature', 'tf.io.FixedLenFeature', (['[]', 'tf.int64'], {}), '([], tf.int64)\n', (414, 428), True, 'import tensorflo...
#!/usr/bin/env python # coding: utf-8 # In[1]: from utils.glove import GloVe from utils.word_sample import WordSample import numpy as np from sklearn.mixture import GaussianMixture # In[2]: n_samples = 10000 glove = GloVe("glove/glove.6B.300d.txt") words = WordSample("./words_alpha.txt", incl_words=glove.wordse...
[ "sklearn.manifold.TSNE", "utils.word_sample.WordSample", "sklearn.mixture.GaussianMixture", "time.time", "utils.glove.GloVe", "matplotlib.pyplot.figure", "numpy.array", "sklearn.decomposition.PCA", "seaborn.color_palette" ]
[((224, 256), 'utils.glove.GloVe', 'GloVe', (['"""glove/glove.6B.300d.txt"""'], {}), "('glove/glove.6B.300d.txt')\n", (229, 256), False, 'from utils.glove import GloVe\n'), ((454, 492), 'numpy.array', 'np.array', (['[emb_vecs[w] for w in words]'], {}), '([emb_vecs[w] for w in words])\n', (462, 492), True, 'import numpy...
import numpy as np import pandas as pd import pdb from sklearn import metrics from .classifiers.lightgbm import Lgbm from .classifiers.base import AbstractLearner from .data import CadeData from . import models from .base import AbstractDensity def auc(df): fpr, tpr, _ = metrics.roc_curve(df.truth.values, df.pred...
[ "sklearn.metrics.roc_curve", "numpy.zeros", "numpy.ones", "sklearn.metrics.auc", "numpy.sqrt" ]
[((278, 341), 'sklearn.metrics.roc_curve', 'metrics.roc_curve', (['df.truth.values', 'df.pred.values'], {'pos_label': '(1)'}), '(df.truth.values, df.pred.values, pos_label=1)\n', (295, 341), False, 'from sklearn import metrics\n'), ((353, 374), 'sklearn.metrics.auc', 'metrics.auc', (['fpr', 'tpr'], {}), '(fpr, tpr)\n',...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ image_proc.py Particle image velocimetry for simple shear flows Handles the primary functions """ import sys import argparse import numpy as np from PIL import Image import os import matplotlib.pyplot as plt SUCCESS = 0 INVALID_DATA = 1 IO_ERROR = 2 NUMBER_OF_IMAGE...
[ "matplotlib.pyplot.title", "argparse.ArgumentParser", "os.path.isfile", "numpy.mean", "numpy.arange", "numpy.savetxt", "numpy.append", "os.path.basename", "scipy.signal.correlate", "numpy.asarray", "matplotlib.pyplot.ylabel", "sys.exit", "numpy.vstack", "matplotlib.pyplot.plot", "warning...
[((787, 839), 'matplotlib.pyplot.plot', 'plt.plot', (['piv_results[:, 0]', 'piv_results[:, 1]', '"""bs"""'], {}), "(piv_results[:, 0], piv_results[:, 1], 'bs')\n", (795, 839), True, 'import matplotlib.pyplot as plt\n'), ((842, 866), 'matplotlib.pyplot.title', 'plt.title', (['"""PIV results"""'], {}), "('PIV results')\n...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_gp_signals ---------------------------------- Tests for GP signal modules. """ import unittest import numpy as np import scipy.linalg as sl from enterprise.pulsar import Pulsar from enterprise.signals import gp_signals, white_signals, parameter, selections, s...
[ "enterprise.signals.utils.create_quantization_matrix", "numpy.abs", "enterprise.signals.selections.Selection", "numpy.sum", "numpy.ones", "numpy.exp", "enterprise.signals.parameter.Uniform", "enterprise.signals.utils.powerlaw", "numpy.diag", "numpy.unique", "enterprise.signals.gp_signals.TimingM...
[((509, 562), 'enterprise.signals.utils.create_quantization_matrix', 'utils.create_quantization_matrix', (['toas'], {'dt': 'dt', 'nmin': '(1)'}), '(toas, dt=dt, nmin=1)\n', (541, 562), False, 'from enterprise.signals import gp_signals, white_signals, parameter, selections, signal_base, utils\n'), ((812, 832), 'numpy.lo...
import cv2 import os import numpy as np from tqdm import tqdm def check_dir(directory): ''' 检查路径 :param directory: :return: ''' if not os.path.exists(directory): os.makedirs(directory) print('Creating directory -', directory) else: print('Directory exists -', direct...
[ "os.makedirs", "cv2.cvtColor", "cv2.imwrite", "cv2.waitKey", "os.walk", "os.path.exists", "cv2.imread", "numpy.rot90", "cv2.imshow", "os.path.join", "cv2.resize" ]
[((538, 551), 'os.walk', 'os.walk', (['path'], {}), '(path)\n', (545, 551), False, 'import os\n'), ((161, 186), 'os.path.exists', 'os.path.exists', (['directory'], {}), '(directory)\n', (175, 186), False, 'import os\n'), ((196, 218), 'os.makedirs', 'os.makedirs', (['directory'], {}), '(directory)\n', (207, 218), False,...
""" Tools for n-dimensional linear algebra Vectors are just numpy arrays, as are dense matrices. Sparse matrices are CSR matrices. Parallel vector and matrix are built on top of those representations using PETSc. .. inheritance-diagram:: proteus.LinearAlgebraTools :parts: 1 """ from __future__ import print_functio...
[ "numpy.absolute", "numpy.sum", "numpy.abs", "past.utils.old_div", "numpy.ones", "petsc4py.PETSc.NullSpace", "numpy.arange", "numpy.linalg.norm", "builtins.range", "doctest.testmod", "petsc4py.PETSc.Viewer", "petsc4py.PETSc.Vec", "petsc4py.PETSc.Mat.__init__", "petsc4py.PETSc.Vec.__init__",...
[((3925, 3967), 'numpy.zeros', 'numpy.zeros', ([], {'shape': '(nr, nc)', 'dtype': '"""float"""'}), "(shape=(nr, nc), dtype='float')\n", (3936, 3967), False, 'import numpy\n'), ((4729, 4756), 'numpy.linalg.matrix_rank', 'numpy.linalg.matrix_rank', (['A'], {}), '(A)\n', (4753, 4756), False, 'import numpy\n'), ((5188, 521...
r""" Dataloader builder for few-shot semantic segmentation dataset """ from torchvision import transforms from torch.utils.data import DataLoader import albumentations as A import albumentations.pytorch from PIL import Image import numpy as np import cv2 from data.pascal import DatasetPASCAL from data.coco import Dat...
[ "albumentations.PadIfNeeded", "torch.utils.data.DataLoader", "albumentations.Solarize", "albumentations.RandomScale", "albumentations.Resize", "albumentations.RandomBrightnessContrast", "albumentations.Posterize", "albumentations.Rotate", "albumentations.Normalize", "albumentations.ToGray", "alb...
[((3163, 3236), 'torch.utils.data.DataLoader', 'DataLoader', (['dataset'], {'batch_size': 'bsz', 'shuffle': 'shuffle', 'num_workers': 'nworker'}), '(dataset, batch_size=bsz, shuffle=shuffle, num_workers=nworker)\n', (3173, 3236), False, 'from torch.utils.data import DataLoader\n'), ((1346, 1361), 'albumentations.ToGray...
# coding: utf-8 ''' # Author: <NAME> # Date: 2021/08/11 # Email: <EMAIL> # Description: 数据pipline ''' import tensorflow as tf from tensorflow.data import Dataset as tfd import numpy as np import cv2 import os from imgaug import augmenters as iaa aug = iaa.SomeOf((0, 6), [ iaa.Affine(scale=[0.9, 1.0], cval...
[ "numpy.full", "imgaug.augmenters.JpegCompression", "tensorflow.TensorShape", "numpy.expand_dims", "imgaug.augmenters.Affine", "cv2.imread", "numpy.rot90", "imgaug.augmenters.AdditiveGaussianNoise", "tensorflow.numpy_function", "imgaug.augmenters.PiecewiseAffine", "imgaug.augmenters.GaussianBlur"...
[((872, 902), 'numpy.expand_dims', 'np.expand_dims', (['image'], {'axis': '(-1)'}), '(image, axis=-1)\n', (886, 902), True, 'import numpy as np\n'), ((971, 1025), 'tensorflow.numpy_function', 'tf.numpy_function', (['augment_func', '[image]', '[tf.float32]'], {}), '(augment_func, [image], [tf.float32])\n', (988, 1025), ...
"""Utility functions and constants for signal class unit tests.""" from numbers import Number import os.path import random import numpy as np def test_init(args, defaults, cls, check): for i in range(len(args)): some_args = args[:i] a = cls(*some_args) expected = args[:i] + default...
[ "random.choice", "numpy.arange", "random.randrange", "numpy.array", "numpy.alltrue" ]
[((1429, 1472), 'random.choice', 'random.choice', (["('number', 'range', 'colon')"], {}), "(('number', 'range', 'colon'))\n", (1442, 1472), False, 'import random\n'), ((2398, 2416), 'numpy.alltrue', 'np.alltrue', (['(x == y)'], {}), '(x == y)\n', (2408, 2416), True, 'import numpy as np\n'), ((1524, 1543), 'random.randr...
from sklearn import datasets import numpy as np import matplotlib.pyplot as plt iris=datasets.load_iris() X=iris.data[:,[0,3]] y=iris.target from sklearn.model_selection import train_test_split X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.3,random_state=0) #將樣本特徵進行標準化 from sklearn.preprocessing imp...
[ "matplotlib.pyplot.title", "sklearn.datasets.load_iris", "sklearn.preprocessing.StandardScaler", "matplotlib.pyplot.show", "sklearn.model_selection.train_test_split", "sklearn.metrics.accuracy_score", "matplotlib.pyplot.yticks", "sklearn.neighbors.KNeighborsClassifier", "matplotlib.pyplot.ylabel", ...
[((86, 106), 'sklearn.datasets.load_iris', 'datasets.load_iris', ([], {}), '()\n', (104, 106), False, 'from sklearn import datasets\n'), ((226, 279), 'sklearn.model_selection.train_test_split', 'train_test_split', (['X', 'y'], {'test_size': '(0.3)', 'random_state': '(0)'}), '(X, y, test_size=0.3, random_state=0)\n', (2...
from __future__ import division import numpy as np import scipy.sparse as sp from openmdao.api import ExplicitComponent import warnings def bdf3_cache_matrix(n,all_bdf=False): """ This implements the base block Jacobian of the BDF3 method. BDF3 is third order accurate and suitable for stiff systems. T...
[ "scipy.sparse.diags", "numpy.zeros", "numpy.ones", "scipy.sparse.bmat", "scipy.sparse.csc_matrix", "scipy.sparse.csr_matrix", "scipy.sparse.linalg.inv", "numpy.arange", "numpy.array", "numpy.tile", "warnings.warn" ]
[((4649, 4672), 'scipy.sparse.diags', 'sp.diags', (['[b_diag]', '[0]'], {}), '([b_diag], [0])\n', (4657, 4672), True, 'import scipy.sparse as sp\n'), ((5121, 5178), 'scipy.sparse.csc_matrix', 'sp.csc_matrix', (['(C.data, (indices[0] + 1, indices[1] + 1))'], {}), '((C.data, (indices[0] + 1, indices[1] + 1)))\n', (5134, ...
"""This module contains simple helper functions """ from __future__ import print_function import torch import numpy as np from PIL import Image import os import argparse import cv2 import pickle import random import torch.nn as nn COLORS = np.array([ [255,255,255], [66,135,245], [245,90,66], [245,206,66], [209...
[ "numpy.stack", "pickle.dump", "random.randint", "os.makedirs", "os.path.exists", "torch.cat", "numpy.transpose", "PIL.Image.fromarray", "pickle.load", "numpy.array", "numpy.tile", "torch.Tensor", "torch.zeros", "torch.abs", "cv2.resize" ]
[((241, 384), 'numpy.array', 'np.array', (['[[255, 255, 255], [66, 135, 245], [245, 90, 66], [245, 206, 66], [209, 245,\n 66], [105, 245, 66], [129, 66, 245], [245, 66, 203]]'], {}), '([[255, 255, 255], [66, 135, 245], [245, 90, 66], [245, 206, 66], [\n 209, 245, 66], [105, 245, 66], [129, 66, 245], [245, 66, 203...
''' fasta Module for reading and writing PHYLIP files. ''' import os import re from typing import Tuple, Union import numpy import pyckmeans.distance WHITESPACE_RE = re.compile(r'\s+') class InvalidPhylipAlignmentError(Exception): '''InvalidPhylipAlignmentError ''' def read_phylip_alignment( phyl...
[ "numpy.zeros", "os.path.exists", "os.path.isfile", "numpy.array", "re.sub", "re.compile" ]
[((175, 193), 're.compile', 're.compile', (['"""\\\\s+"""'], {}), "('\\\\s+')\n", (185, 193), False, 'import re\n'), ((2290, 2320), 'numpy.array', 'numpy.array', (['seqs'], {'dtype': 'dtype'}), '(seqs, dtype=dtype)\n', (2301, 2320), False, 'import numpy\n'), ((2333, 2351), 'numpy.array', 'numpy.array', (['names'], {}),...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicabl...
[ "torch.eye", "torch.mm", "torch.cat", "collections.defaultdict", "torch.ceil", "torch.arange", "torch.FloatTensor", "kaolin.rep.TriangleMesh.from_obj", "torch.clamp", "torch.floor", "torch.sum", "numpy.concatenate", "torchvision.transforms.Resize", "torch.LongTensor", "kaolin.metrics.mes...
[((3718, 3751), 'kaolin.metrics.point.SidedDistance', 'kal.metrics.point.SidedDistance', ([], {}), '()\n', (3749, 3751), True, 'import kaolin as kal\n'), ((1426, 1443), 'collections.defaultdict', 'defaultdict', (['list'], {}), '(list)\n', (1437, 1443), False, 'from collections import defaultdict\n'), ((5120, 5182), 'ka...
"""core module for preprocessing This module wraps the pyintorg interfaces into xr.apply_ufunc. """ import xarray as xr import numpy as np import warnings xr.set_options(keep_attrs=True) try: from pyintorg import interface as intf except: warnings.warn( "could not find pyintorg, you need this for p...
[ "xarray.decode_cf", "numpy.flip", "xesmf.Regridder", "numpy.zeros", "numpy.ones", "xarray.merge", "xarray.zeros_like", "numpy.rad2deg", "xarray.set_options", "pyintorg.interface.geo_coords", "xarray.open_mfdataset", "numpy.arange", "xarray.apply_ufunc", "xarray.DataArray", "warnings.warn...
[((159, 190), 'xarray.set_options', 'xr.set_options', ([], {'keep_attrs': '(True)'}), '(keep_attrs=True)\n', (173, 190), True, 'import xarray as xr\n'), ((622, 648), 'pyintorg.interface.pbl_index', 'intf.pbl_index', (['akgm', 'bkgm'], {}), '(akgm, bkgm)\n', (636, 648), True, 'from pyintorg import interface as intf\n'),...
import networkx as nx import numpy as np from networkx.algorithms import tree_all_pairs_lowest_common_ancestor def obtain_ranks(fitting_scores: np.ndarray, labels: np.ndarray): """ fitting_scores : ndarray of size (batch_size, seed_size), calculated fitting scores labels : ndarray of size (batch_size, se...
[ "numpy.sum", "numpy.ceil", "numpy.mean", "numpy.array", "networkx.algorithms.tree_all_pairs_lowest_common_ancestor" ]
[((797, 832), 'numpy.array', 'np.array', (['[fitting_scores.shape[1]]'], {}), '([fitting_scores.shape[1]])\n', (805, 832), True, 'import numpy as np\n'), ((1038, 1056), 'numpy.mean', 'np.mean', (['all_ranks'], {}), '(all_ranks)\n', (1045, 1056), True, 'import numpy as np\n'), ((1372, 1396), 'numpy.mean', 'np.mean', (['...
import numpy as np from scipy.integrate import odeint import matplotlib import matplotlib.pyplot as plt matplotlib.rcParams['font.sans-serif'] = "Arial" matplotlib.rcParams['font.family'] = "sans-serif" # Solve the ODE of Lorenz system def ode(s, t): sigma = 10 beta = 2.667 rho = 28 x, y, z = s re...
[ "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "scipy.integrate.odeint", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "numpy.array", "numpy.arange", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig" ]
[((385, 406), 'numpy.arange', 'np.arange', (['(0)', '(20)', '(0.1)'], {}), '(0, 20, 0.1)\n', (394, 406), True, 'import numpy as np\n'), ((412, 434), 'numpy.array', 'np.array', (['[0, 1, 1.05]'], {}), '([0, 1, 1.05])\n', (420, 434), True, 'import numpy as np\n'), ((439, 457), 'scipy.integrate.odeint', 'odeint', (['ode',...
""" Basic actor critic algorithm based on Pytorch tutorial in https://github.com/pytorch/examples/blob/master/reinforcement_learning/actor_critic.py. """ import argparse import gym import numpy as np from itertools import count from ac import Policy, select_action import torch import torch.nn.functional as F import ...
[ "ac.select_action", "ac.Policy", "gym.make", "argparse.ArgumentParser", "torch.stack", "torch.manual_seed", "itertools.count", "numpy.finfo", "torch.tensor" ]
[((352, 419), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'description': '"""PyTorch actor-critic example"""'}), "(description='PyTorch actor-critic example')\n", (375, 419), False, 'import argparse\n'), ((997, 1020), 'gym.make', 'gym.make', (['"""CartPole-v0"""'], {}), "('CartPole-v0')\n", (1005, 1020)...
# !usr/bin/env python2 # -*- coding: utf-8 -*- # # Licensed under a 3-clause BSD license. # # @Author: <NAME> # @Date: 2017-04-28 11:34:06 # @Last modified by: <NAME> # @Last Modified time: 2017-07-30 19:46:40 from __future__ import print_function, division, absolute_import import pytest from marvin.web import cre...
[ "flask.template_rendered.disconnect", "pytest.fixture", "marvin.web.create_app", "flask.template_rendered.send", "numpy.isclose", "urlparse.urlparse", "marvin.config.forceDbOn", "flask.template_rendered.connect", "pytest.mark.usefixtures" ]
[((1003, 1034), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""session"""'}), "(scope='session')\n", (1017, 1034), False, 'import pytest\n'), ((1869, 1901), 'pytest.fixture', 'pytest.fixture', ([], {'scope': '"""function"""'}), "(scope='function')\n", (1883, 1901), False, 'import pytest\n'), ((2217, 2263), 'pyt...
# Use python 3.0 syntax from __future__ import division, print_function import numpy from math import sqrt, pow from scipy.special import kv as kv import itertools import logging import const besselValues = {} def besselFunction(chromosomeA, chromosomeB): if numpy.array_equal(chromosomeA,chromosomeB): ...
[ "numpy.array_equal", "scipy.special.kv", "math.sqrt" ]
[((269, 312), 'numpy.array_equal', 'numpy.array_equal', (['chromosomeA', 'chromosomeB'], {}), '(chromosomeA, chromosomeB)\n', (286, 312), False, 'import numpy\n'), ((717, 792), 'math.sqrt', 'sqrt', (['((chromosome[0] - anclaje[0]) ** 2 + (chromosome[1] - anclaje[1]) ** 2)'], {}), '((chromosome[0] - anclaje[0]) ** 2 + (...
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
[ "h5py.File", "numpy.array_equal", "os.makedirs", "h5py.special_dtype", "numpy.asarray", "tensorflow.data.Dataset.from_tensor_slices", "tensorflow_io.IODataset.from_hdf5", "tensorflow_io.IOTensor.from_hdf5", "pytest.raises", "tempfile.mkdtemp", "numpy.random.randint", "tensorflow.data.Dataset.z...
[((1365, 1383), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (1381, 1383), False, 'import tempfile\n'), ((1994, 2016), 'shutil.rmtree', 'shutil.rmtree', (['runpath'], {}), '(runpath)\n', (2007, 2016), False, 'import shutil\n'), ((2620, 2638), 'tempfile.mkdtemp', 'tempfile.mkdtemp', ([], {}), '()\n', (2636,...
from collections import defaultdict import noise import numpy as np from scipy import spatial from typing import Optional, List from tales.worldmap.dataclasses import Adjacency, MapParameters, ndarr, IntListDict class Mesh: def __init__(self, map_params: MapParameters): self.map_params = map_params ...
[ "numpy.asarray", "numpy.zeros", "scipy.spatial.Voronoi", "collections.defaultdict", "numpy.random.randint", "numpy.random.random", "numpy.mean", "noise.pnoise2" ]
[((1219, 1254), 'scipy.spatial.Voronoi', 'spatial.Voronoi', (['self.center_points'], {}), '(self.center_points)\n', (1234, 1254), False, 'from scipy import spatial\n'), ((1978, 2019), 'numpy.random.random', 'np.random.random', (['(self.number_points, 2)'], {}), '((self.number_points, 2))\n', (1994, 2019), True, 'import...
import numpy as np import pylab as pl from ourgui import openFile def plotline(maxx, minx=0, value=0, style="k-", plotfunc=pl.plot): plotfunc([minx, maxx], [value, value], style) def quickplot(filename): data = np.loadtxt(filename, comments="#") maxdata, mindata, stddata, meandata = np.max(data),...
[ "pylab.hist", "pylab.title", "pylab.show", "ourgui.openFile", "numpy.std", "pylab.ylabel", "pylab.subplot", "numpy.max", "numpy.min", "numpy.mean", "numpy.loadtxt", "pylab.xlabel", "pylab.plot" ]
[((989, 1004), 'ourgui.openFile', 'openFile', (['"""log"""'], {}), "('log')\n", (997, 1004), False, 'from ourgui import openFile\n'), ((229, 263), 'numpy.loadtxt', 'np.loadtxt', (['filename'], {'comments': '"""#"""'}), "(filename, comments='#')\n", (239, 263), True, 'import numpy as np\n'), ((389, 404), 'pylab.subplot'...
# This code is heavily based on Phil Tabor Q learning: # https://github.com/philtabor/Deep-Q-Learning-Paper-To-Code/blob/master/q_learning/q_learning_agent.py # Here it were added a DeepQ network also based on <NAME>abor's code: # https://github.com/philtabor/Deep-Q-Learning-Paper-To-Code/blob/master/DQN/deep_q_networ...
[ "numpy.random.choice", "torch.nn.MSELoss", "random.sample", "torch.argmax", "numpy.zeros", "numpy.random.random", "torch.cuda.is_available", "torch.max", "torch.nn.Linear", "torch.tensor", "collections.deque" ]
[((877, 898), 'torch.nn.Linear', 'nn.Linear', (['input', '(128)'], {}), '(input, 128)\n', (886, 898), True, 'import torch.nn as nn\n'), ((918, 943), 'torch.nn.Linear', 'nn.Linear', (['(128)', 'n_actions'], {}), '(128, n_actions)\n', (927, 943), True, 'import torch.nn as nn\n'), ((1091, 1103), 'torch.nn.MSELoss', 'nn.MS...
import scipy.linalg as linalg import numpy as np from math import cos, sin class LinearDynamic: # TODO: change the API def jacobi_wrt_state(self, state, controls): return np.array([ [1, 0], [0, 1.], ]) def jacobi_wrt_controls(self, state, controls): return ...
[ "numpy.array", "numpy.identity", "math.sin", "math.cos" ]
[((189, 217), 'numpy.array', 'np.array', (['[[1, 0], [0, 1.0]]'], {}), '([[1, 0], [0, 1.0]])\n', (197, 217), True, 'import numpy as np\n'), ((320, 348), 'numpy.array', 'np.array', (['[[2, 0], [0, 1.0]]'], {}), '([[2, 0], [0, 1.0]])\n', (328, 348), True, 'import numpy as np\n'), ((490, 520), 'numpy.array', 'np.array', (...
import numpy as np alg_colors = { "unconstrained": "#AA5D1F", "LR": "#BA2DC1", "RSPO": "#6C2896", "SQRL": "#D43827", "RP": "#4899C5", "RCPO": "#34539C", "RRL_MF": "#60CC38", "RRL_MB": "#349C26" } alg_names = { "unconstrained": "Unconstrained", "LR": "LR", "RSPO": "RSPO", ...
[ "numpy.random.rand" ]
[((680, 697), 'numpy.random.rand', 'np.random.rand', (['(3)'], {}), '(3)\n', (694, 697), True, 'import numpy as np\n')]
import numpy as np from .simulator import Simulator def get_final_score(simulator): num_tiles = simulator.shape[0] * simulator.shape[1] contamination = np.sum(simulator.contamination) fuel = simulator.fuel_expended deployed = len(simulator.robots) stranded = 0 for rob in simulator.robots.val...
[ "numpy.sum" ]
[((163, 194), 'numpy.sum', 'np.sum', (['simulator.contamination'], {}), '(simulator.contamination)\n', (169, 194), True, 'import numpy as np\n')]
""" SCRIPT FOR TRAINING 2DCNN MODELS Run with two arguments - arg1=region, arg2=model type """ import os, sys import torch import numpy as np import time from CNN import * from Training import * from Data_maker_loader import * from random import randint, uniform, choice if sys.argv[2] == "2D": from CNN import * el...
[ "numpy.load", "numpy.save", "os.makedirs", "random.randint", "random.uniform", "os.path.dirname", "os.path.exists", "random.choice", "time.time", "os.path.isfile", "torch.nn.DataParallel", "torch.tensor" ]
[((579, 590), 'time.time', 'time.time', ([], {}), '()\n', (588, 590), False, 'import time\n'), ((940, 964), 'os.path.exists', 'os.path.exists', (['savepath'], {}), '(savepath)\n', (954, 964), False, 'import os, sys\n'), ((970, 991), 'os.makedirs', 'os.makedirs', (['savepath'], {}), '(savepath)\n', (981, 991), False, 'i...
# -*- coding: utf-8 -*- import numpy as np from collections import Iterable def line(x, m, b): return m * x + b def scale(x, y, xsc=1.0, ysc=1.0, **kwargs): """Scale data. For use with Transformer.""" return x * xsc, y * ysc def translate(x, y, xtrans=1.0, ytrans=1.0, **kwargs): """Translate data. ...
[ "numpy.abs", "scipy.interpolate.UnivariateSpline", "numpy.float", "scipy.signal.medfilt", "scipy.optimize.curve_fit", "numpy.cos", "numpy.concatenate" ]
[((1888, 1924), 'numpy.concatenate', 'np.concatenate', (['(x[-ks:], x, x[:ks])'], {}), '((x[-ks:], x, x[:ks]))\n', (1902, 1924), True, 'import numpy as np\n'), ((1933, 1969), 'numpy.concatenate', 'np.concatenate', (['(y[-ks:], y, y[:ks])'], {}), '((y[-ks:], y, y[:ks]))\n', (1947, 1969), True, 'import numpy as np\n'), (...
#!/usr/bin/env python # -*- coding: utf-8 -*- """D2 of the Rössler oscillator. The estimates here match the "accepted" value of 1.991 quite closely. """ import numpy as np import matplotlib.pyplot as plt from nolitsa import d2, data, utils x0 = [-3.2916983, -1.42162302, 0.02197593] x = utils.rescale(data.roessler(l...
[ "matplotlib.pyplot.title", "nolitsa.d2.d2", "matplotlib.pyplot.show", "nolitsa.utils.gprange", "numpy.ones", "numpy.arange", "nolitsa.data.roessler", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel" ]
[((356, 376), 'numpy.arange', 'np.arange', (['(1)', '(10 + 1)'], {}), '(1, 10 + 1)\n', (365, 376), True, 'import numpy as np\n'), ((387, 442), 'matplotlib.pyplot.title', 'plt.title', (['u"""Local $D_2$ vs $r$ for Rössler oscillator"""'], {}), "(u'Local $D_2$ vs $r$ for Rössler oscillator')\n", (396, 442), True, 'import...
import os import time import sys import queue import pandas as pd import numpy as np from multiprocessing import Process, Queue from collections import defaultdict from sklearn.model_selection import KFold from sklearn.metrics import f1_score, accuracy_score from .data import categoric_to_numeric class Dataset: ...
[ "pandas.DataFrame", "os.path.exists", "sklearn.model_selection.KFold", "time.sleep", "os.cpu_count", "sklearn.metrics.f1_score", "numpy.mean", "multiprocessing.Queue", "multiprocessing.Process", "os.path.join", "os.listdir" ]
[((2201, 2222), 'os.path.exists', 'os.path.exists', (['dpath'], {}), '(dpath)\n', (2215, 2222), False, 'import os\n'), ((3759, 3773), 'pandas.DataFrame', 'pd.DataFrame', ([], {}), '()\n', (3771, 3773), True, 'import pandas as pd\n'), ((3790, 3811), 'sklearn.model_selection.KFold', 'KFold', ([], {'n_splits': 'folds'}), ...
import unittest import pandas as pd import category_encoders as ce import numpy as np __author__ = 'willmcginnis' class TestDist(unittest.TestCase): """ """ def test_dist(self): data = np.array([ ['apple', None], ['peach', 'lemon'] ]) encoder = ce.OrdinalE...
[ "numpy.isnan", "numpy.array", "category_encoders.OrdinalEncoder" ]
[((209, 256), 'numpy.array', 'np.array', (["[['apple', None], ['peach', 'lemon']]"], {}), "([['apple', None], ['peach', 'lemon']])\n", (217, 256), True, 'import numpy as np\n'), ((309, 347), 'category_encoders.OrdinalEncoder', 'ce.OrdinalEncoder', ([], {'impute_missing': '(True)'}), '(impute_missing=True)\n', (326, 347...
import matplotlib.pyplot as plt import argparse import numpy as np from matplotlib.widgets import CheckButtons import file_reader from angle_calc import * def get_body_part_name(i): bodyparts = ["nose", ""] return bodyparts[i] if __name__ == '__main__': # 导入包 # 创建解析器 parser = argparse.ArgumentPa...
[ "matplotlib.pyplot.title", "matplotlib.widgets.CheckButtons", "numpy.subtract", "argparse.ArgumentParser", "matplotlib.pyplot.show", "matplotlib.pyplot.axes", "matplotlib.pyplot.legend", "file_reader.read_x_y_score_list", "matplotlib.pyplot.draw", "numpy.array", "numpy.arange", "matplotlib.pyp...
[((301, 326), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {}), '()\n', (324, 326), False, 'import argparse\n'), ((511, 553), 'file_reader.read_x_y_score_list', 'file_reader.read_x_y_score_list', (['args.file'], {}), '(args.file)\n', (542, 553), False, 'import file_reader\n'), ((596, 612), 'numpy.array', ...
import os import pandas as pd ; import numpy as np import datetime as dt ########################################################################################################### ### USED FUNCTIONS ########################################################################################################### ##########...
[ "pandas.read_csv", "numpy.datetime64", "pandas.merge", "numpy.zeros", "pandas.to_datetime", "numpy.array", "pandas.Series", "datetime.timedelta", "os.chdir" ]
[((620, 667), 'os.chdir', 'os.chdir', (['"""/home/hubert/data/Data Cleaned/best"""'], {}), "('/home/hubert/data/Data Cleaned/best')\n", (628, 667), False, 'import os\n'), ((682, 717), 'pandas.read_csv', 'pd.read_csv', (['"""BCH_ob_best"""'], {'sep': '""","""'}), "('BCH_ob_best', sep=',')\n", (693, 717), True, 'import p...
#!/usr/bin/env python import argparse import numpy as np import matplotlib as mpl mpl.use('Agg') import matplotlib.pyplot as plt import h5py import qusp def main(): # parse command-line arguments parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.a...
[ "argparse.ArgumentParser", "qusp.wavelength.Wavelength", "matplotlib.pyplot.figure", "qusp.Paths.from_args", "qusp.target.add_args", "qusp.Target.from_plate_mjd_fiber", "h5py.File", "matplotlib.pyplot.ylim", "qusp.paths.Paths.add_args", "qusp.target.get_combined_spectrum", "qusp.target.load_targ...
[((84, 98), 'matplotlib.use', 'mpl.use', (['"""Agg"""'], {}), "('Agg')\n", (91, 98), True, 'import matplotlib as mpl\n'), ((219, 298), 'argparse.ArgumentParser', 'argparse.ArgumentParser', ([], {'formatter_class': 'argparse.ArgumentDefaultsHelpFormatter'}), '(formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n', ...
#!/usr/bin/env python import pytest from pytest import approx import xarray import numpy as np from pathlib import Path from datetime import datetime import georinex as gr # R = Path(__file__).parent / 'data' def test_blank(tmp_path): fn = R/'blank3.10o' obs = gr.load(fn) assert obs is None outdir = ...
[ "pytest.importorskip", "georinex.rinexobs", "xarray.open_dataset", "numpy.isnan", "pytest.main", "georinex.load", "georinex.gettime", "pathlib.Path", "pytest.raises", "datetime.datetime", "georinex.rinexheader", "pytest.approx" ]
[((271, 282), 'georinex.load', 'gr.load', (['fn'], {}), '(fn)\n', (278, 282), True, 'import georinex as gr\n'), ((333, 352), 'georinex.load', 'gr.load', (['fn', 'outdir'], {}), '(fn, outdir)\n', (340, 352), True, 'import georinex as gr\n'), ((366, 380), 'georinex.gettime', 'gr.gettime', (['fn'], {}), '(fn)\n', (376, 38...
import scipy.signal as sig import pywt import numpy as np from scipy.io import loadmat, savemat import os def ecg_preprocessing(data, wfun='db6', levels=9, type=2): # data is the row data # 第一步:去除基线漂移---此噪声一般小于0.5HZ, 去除一般噪声,经验值50HZ(注意这两个值可以调整) filter_sig = bandpass_filter( data,...
[ "pywt.Wavelet", "pywt.threshold", "os.makedirs", "numpy.log", "scipy.signal.lfilter", "pywt.wavedec", "numpy.median", "os.path.exists", "pywt.waverec", "os.path.join", "os.listdir", "scipy.signal.butter" ]
[((2190, 2211), 'os.listdir', 'os.listdir', (['data_path'], {}), '(data_path)\n', (2200, 2211), False, 'import os\n'), ((1946, 1997), 'scipy.signal.butter', 'sig.butter', (['filter_order', '[low, high]'], {'btype': '"""band"""'}), "(filter_order, [low, high], btype='band')\n", (1956, 1997), True, 'import scipy.signal a...
#!/usr/bin/env python import numpy as np from subs import create_object,ask_for_steps from AnalysisFunctions import fcorr rc=create_object() rc.vars2load(['bx','by']) ofile=open('intscale.'+rc.dirname+'.dat','w') ie=1/np.e bs,fs,step=ask_for_steps(rc.numslices) for i in range(bs,fs,step): print(i) rc.loadslice(i...
[ "subs.create_object", "numpy.sum", "subs.ask_for_steps", "AnalysisFunctions.fcorr" ]
[((126, 141), 'subs.create_object', 'create_object', ([], {}), '()\n', (139, 141), False, 'from subs import create_object, ask_for_steps\n'), ((235, 262), 'subs.ask_for_steps', 'ask_for_steps', (['rc.numslices'], {}), '(rc.numslices)\n', (248, 262), False, 'from subs import create_object, ask_for_steps\n'), ((334, 369)...
''' data/read.py 2018. 11. 22 데이터셋 이름을 입력받아 데이터를 불러오는 기능 ''' import os import sys import csv import importlib import numpy as np from scipy.io import arff import pickle_loader as pkl_loader from ds import Pair, Data from sampling import smote_dataset # util - absolute directory of current file dir_path = os.path.d...
[ "scipy.io.arff.loadarff", "csv.reader", "os.path.realpath", "numpy.asarray", "sampling.smote_dataset", "pickle_loader.pkl2np", "ds.Data", "os.path.join", "os.listdir" ]
[((327, 353), 'os.path.realpath', 'os.path.realpath', (['__file__'], {}), '(__file__)\n', (343, 353), False, 'import os\n'), ((374, 402), 'os.path.join', 'os.path.join', (['dir_path', '""".."""'], {}), "(dir_path, '..')\n", (386, 402), False, 'import os\n'), ((500, 531), 'os.path.join', 'os.path.join', (['basedir', 'fi...
import time import collections import functools import random import numpy as np import pygame from cycle_growth import HamCycle import settings class Snake: def __init__(self, R, C, graph, start_length, centered = True, shortcuts = True): self.R = R self.C = C # Once he snake is...
[ "collections.defaultdict", "pygame.draw.lines", "collections.deque", "random.randint", "pygame.display.set_mode", "pygame.display.set_caption", "pygame.event.poll", "pygame.quit", "pygame.init", "time.sleep", "pygame.image.load", "pygame.display.set_icon", "random.choice", "pygame.display....
[((3345, 3370), 'functools.lru_cache', 'functools.lru_cache', (['None'], {}), '(None)\n', (3364, 3370), False, 'import functools\n'), ((11524, 11546), 'random.choice', 'random.choice', (['choices'], {}), '(choices)\n', (11537, 11546), False, 'import random\n'), ((655, 680), 'collections.deque', 'collections.deque', (['...
import numpy as np def SCH(x): f1 = x[0] ** 2 f2 = (x[0] - 2) ** 2 return np.array([f1, f2])
[ "numpy.array" ]
[((87, 105), 'numpy.array', 'np.array', (['[f1, f2]'], {}), '([f1, f2])\n', (95, 105), True, 'import numpy as np\n')]
import numpy as np import pandas as pd class Strategy(): """ Parent strategy class """ def __init__(self, name='Strategy', params = {} ): self.name = name self.indicators = ['MA20'] self.params = params ...
[ "numpy.floor" ]
[((3236, 3269), 'numpy.floor', 'np.floor', (['(cash_avail / curr_close)'], {}), '(cash_avail / curr_close)\n', (3244, 3269), True, 'import numpy as np\n'), ((2049, 2082), 'numpy.floor', 'np.floor', (['(cash_avail / curr_close)'], {}), '(cash_avail / curr_close)\n', (2057, 2082), True, 'import numpy as np\n'), ((4954, 4...
# Copyright 2018 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
[ "os.makedirs", "os.path.realpath", "tensorflow.device", "tensorflow.contrib.learn.SVM", "tensorflow.constant", "tensorflow.logging.set_verbosity", "numpy.array", "os.sep.join", "pandas.Series", "tensorflow.contrib.layers.real_valued_column" ]
[((650, 691), 'tensorflow.logging.set_verbosity', 'tf.logging.set_verbosity', (['tf.logging.INFO'], {}), '(tf.logging.INFO)\n', (674, 691), True, 'import tensorflow as tf\n'), ((1075, 1096), 'numpy.array', 'np.array', (['example_ids'], {}), '(example_ids)\n', (1083, 1096), True, 'import numpy as np\n'), ((1545, 1590), ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' GOAL Fig. 4: Map of ocean heat flux in each grid cell Ocean heat flux computed via average_ohf.py, which follows compute_oht.py PROGRAMMER <NAME> LAST UPDATE 17/11/2020 ''' # Standard libraries from netCDF4 import Dataset import numpy as np import mat...
[ "netCDF4.Dataset", "numpy.load", "matplotlib.pyplot.cm.seismic._resample", "numpy.arange", "matplotlib.pyplot.cm.cubehelix_r._resample", "matplotlib.pyplot.subplots", "mpl_toolkits.basemap.Basemap", "numpy.sqrt" ]
[((759, 776), 'numpy.load', 'np.load', (['filename'], {}), '(filename)\n', (766, 776), True, 'import numpy as np\n'), ((788, 834), 'numpy.sqrt', 'np.sqrt', (['(oht_u_D000 ** 2.0 + oht_v_D000 ** 2.0)'], {}), '(oht_u_D000 ** 2.0 + oht_v_D000 ** 2.0)\n', (795, 834), True, 'import numpy as np\n'), ((961, 978), 'numpy.load'...
import numpy as np def load_spontaneous(): return np.load("Data/stringer_spontaneous.npy", allow_pickle=True).item() def load_orientations(): return np.load("Data/stringer_orientations.npy", allow_pickle=True).item() import matplotlib.pyplot as plt import matplotlib as mpl import scipy import scipy.signal f...
[ "numpy.load", "numpy.zeros_like", "matplotlib.pyplot.show", "matplotlib.pyplot.plot", "scipy.signal.find_peaks" ]
[((512, 667), 'scipy.signal.find_peaks', 'scipy.signal.find_peaks', (['pupil1d'], {'height': 'None', 'threshold': '(1000)', 'distance': 'None', 'prominence': 'None', 'width': 'None', 'wlen': 'None', 'rel_height': '(0.5)', 'plateau_size': 'None'}), '(pupil1d, height=None, threshold=1000, distance=None,\n prominence=N...
import mmcv import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from mmcv.cnn import ConvModule, bias_init_with_prob, normal_init from scipy import ndimage from mmdet.core import matrix_nms, multi_apply from ..builder import HEADS, build_loss from .base_dense_seg_head import BaseDense...
[ "torch.sqrt", "torch.cat", "torch.arange", "mmdet.core.matrix_nms", "mmcv.cnn.ConvModule", "mmcv.cnn.normal_init", "torch.Tensor", "torch.nn.functional.max_pool2d", "torch.zeros", "mmcv.imrescale", "mmdet.core.multi_apply", "torch.nn.ModuleList", "torch.nn.Conv2d", "torch.argsort", "torc...
[((409, 472), 'torch.arange', 'torch.arange', (['(0)', 'h'], {'dtype': 'torch.float32', 'device': 'bitmasks.device'}), '(0, h, dtype=torch.float32, device=bitmasks.device)\n', (421, 472), False, 'import torch\n'), ((482, 545), 'torch.arange', 'torch.arange', (['(0)', 'w'], {'dtype': 'torch.float32', 'device': 'bitmasks...
# coding=utf-8 # Copyright 2020 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "pybullet.loadSoftBody", "numpy.isin", "os.remove", "pybullet.getMeshData", "numpy.sum", "pybullet.createVisualShape", "pybullet.applyExternalForce", "numpy.ones", "numpy.random.randint", "numpy.random.normal", "cv2.erode", "os.path.join", "pybullet.createCollisionShape", "numpy.round", ...
[((3505, 3525), 'os.remove', 'os.remove', (['zone_urdf'], {}), '(zone_urdf)\n', (3514, 3525), False, 'import os\n'), ((3770, 3942), 'pybullet.loadURDF', 'p.loadURDF', ([], {'fileName': '"""assets/block/block_for_anchors.urdf"""', 'basePosition': 'pose[0]', 'baseOrientation': 'pose[1]', 'globalScaling': 'global_scaling'...
""" Created on Wed Mar 27 16:48:26 2019 @author: bhargav """ from keras.models import load_model from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img import cv2 import os import sys import numpy as np class Classifier: def __init__(self): self.model=None s...
[ "keras.models.load_model", "cv2.countNonZero", "numpy.std", "cv2.imread", "keras.preprocessing.image.load_img", "keras.preprocessing.image.img_to_array", "sys.exit", "cv2.resize" ]
[((624, 648), 'keras.models.load_model', 'load_model', (['weights_file'], {}), '(weights_file)\n', (634, 648), False, 'from keras.models import load_model\n'), ((1041, 1061), 'cv2.imread', 'cv2.imread', (['image', '(0)'], {}), '(image, 0)\n', (1051, 1061), False, 'import cv2\n'), ((2023, 2064), 'sys.exit', 'sys.exit', ...
__author__ = "<NAME>" """ Contains fuzzy values and functions to calculate fuzzy variables """ import numpy as np size = {"1U": 0., "1.5U": 0.167, "2U": 0.33, "3U": 0.5, "4U": 0.667, "5U": 0.834, "6U": 1.} mass_imp = {"Very Unimportant": 0., "Unimportant": ...
[ "numpy.array" ]
[((3939, 4066), 'numpy.array', 'np.array', (['[[size_val, size_imp_val, mass_imp_val, down_val, up_val, alt_val, att_val,\n remote_val, rs_wave_val, rs_acc_val]]'], {}), '([[size_val, size_imp_val, mass_imp_val, down_val, up_val, alt_val,\n att_val, remote_val, rs_wave_val, rs_acc_val]])\n', (3947, 4066), True, '...
import json import numpy as np import os import cv2 def bbox_overlaps(bboxes1, bboxes2, mode='iou', is_aligned=False): """Calculate overlap between two set of bboxes. If ``is_aligned`` is ``False``, then calculate the ious between each bbox of bboxes1 and bboxes2, otherwise the ious between each aligned ...
[ "numpy.full", "numpy.minimum", "numpy.maximum", "json.load", "numpy.zeros", "os.path.exists", "cv2.imread", "numpy.max", "numpy.min", "numpy.array", "os.path.join", "os.listdir" ]
[((2496, 2507), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (2504, 2507), True, 'import numpy as np\n'), ((2517, 2528), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (2525, 2528), True, 'import numpy as np\n'), ((2538, 2549), 'numpy.zeros', 'np.zeros', (['(3)'], {}), '(3)\n', (2546, 2549), True, 'import num...
#!/usr/bin/env python3 """ Refer to the work of OpenAI and DeepMind. Algorithm: OpenAI's Proximal Policy Optimization (PPO). [https://arxiv.org/abs/1707.06347] Emergence of Locomotion Behaviours in Rich Environments (Google Deepmind): [https://arxiv.org/abs/1707.02286] Dependencies: tensorflow gym gym_OptClang Thank...
[ "tensorflow.reduce_sum", "tensorflow.clip_by_value", "tensorflow.get_collection", "tensorflow.reset_default_graph", "random.shuffle", "tensorflow.train.AdamOptimizer", "tensorflow.multiply", "tensorflow.matmul", "tensorflow.train.latest_checkpoint", "numpy.arange", "tensorflow.get_default_graph"...
[((580, 601), 'matplotlib.use', 'matplotlib.use', (['"""Agg"""'], {}), "('Agg')\n", (594, 601), False, 'import matplotlib\n'), ((1226, 1250), 'tensorflow.reset_default_graph', 'tf.reset_default_graph', ([], {}), '()\n', (1248, 1250), True, 'import tensorflow as tf\n'), ((1913, 1968), 'tensorflow.placeholder', 'tf.place...
from tkinter import * from tkinter import messagebox import numpy as np import pandas as pd l1=['itching','skin_rash','nodal_skin_eruptions','continuous_sneezing','shivering','chills','joint_pain', 'stomach_pain','acidity','ulcers_on_tongue','muscle_wasting','vomiting','burning_micturition','spotting_ urination','...
[ "sklearn.naive_bayes.MultinomialNB", "numpy.ravel", "pandas.read_csv", "sklearn.metrics.accuracy_score", "tkinter.messagebox.showinfo" ]
[((3262, 3288), 'pandas.read_csv', 'pd.read_csv', (['"""Testing.csv"""'], {}), "('Testing.csv')\n", (3273, 3288), True, 'import pandas as pd\n'), ((4155, 4171), 'numpy.ravel', 'np.ravel', (['y_test'], {}), '(y_test)\n', (4163, 4171), True, 'import numpy as np\n'), ((4192, 4219), 'pandas.read_csv', 'pd.read_csv', (['"""...
import numpy as np def doubleQ(initial_Q1,initial_Q2,initial_state,transition, num_episodes,gamma, alpha, epsilon=0.1): #This function implements double Q-learning. It returns Q1, Q2 and their sum Q Q1 = np.copy(initial_Q1) Q2 = np.copy(initial_Q2) num_states, num_actions = Q1.shape ...
[ "numpy.copy", "numpy.argmax", "numpy.ones", "numpy.random.random", "numpy.random.choice" ]
[((229, 248), 'numpy.copy', 'np.copy', (['initial_Q1'], {}), '(initial_Q1)\n', (236, 248), True, 'import numpy as np\n'), ((258, 277), 'numpy.copy', 'np.copy', (['initial_Q2'], {}), '(initial_Q2)\n', (265, 277), True, 'import numpy as np\n'), ((751, 793), 'numpy.random.choice', 'np.random.choice', (['num_actions'], {'p...
import numpy as np import os #from learning_to_adapt.utils.serializable import Serializable #from gym.envs.mujoco.mujoco_env import MujocoEnv from ad_envs.online_adaptation_suite.mj_env import MujocoEnv # class MujocoEnv(gym.Env): # # def __init__(self, model_path, frame_skip): # if model_path.startswith("...
[ "numpy.random.uniform", "os.path.dirname", "numpy.square", "numpy.zeros", "numpy.cumsum", "numpy.min", "numpy.max", "numpy.array", "numpy.arange", "numpy.random.choice" ]
[((2085, 2125), 'numpy.array', 'np.array', (['[250, 260, 261, 270, 280, 285]'], {}), '([250, 260, 261, 270, 280, 285])\n', (2093, 2125), True, 'import numpy as np\n'), ((2154, 2194), 'numpy.array', 'np.array', (['[0.2, 0.2, 0.2, 0.2, 0.2, 0.2]'], {}), '([0.2, 0.2, 0.2, 0.2, 0.2, 0.2])\n', (2162, 2194), True, 'import nu...
# Copyright 2020 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # less required by applicable law or agr...
[ "numpy.random.seed", "mindspore.train.callback.ModelCheckpoint", "mindspore.train.serialization.load_checkpoint", "mindspore.communication.management.get_group_size", "src.dataset.create_dataset", "mindspore.train.serialization.load_param_into_net", "src.loss.MultiBoxLoss", "mindspore.context.set_cont...
[((1455, 1472), 'random.seed', 'random.seed', (['seed'], {}), '(seed)\n', (1466, 1472), False, 'import random\n'), ((1478, 1498), 'numpy.random.seed', 'np.random.seed', (['seed'], {}), '(seed)\n', (1492, 1498), True, 'import numpy as np\n'), ((1504, 1528), 'mindspore.dataset.config.set_seed', 'de.config.set_seed', (['s...
from __future__ import print_function """ Test systems for perses automated design. Examples -------- Alanine dipeptide in various environments (vacuum, implicit, explicit): >>> from perses.tests.testsystems import AlaninDipeptideSAMS >>> testsystem = AlanineDipeptideTestSystem() >>> system_generator = testsystem.sy...
[ "perses.utils.smallmolecules.sanitizeSMILES", "csv.reader", "perses.dispersed.utils.minimize", "openforcefield.topology.Molecule.from_openeye", "perses.utils.openeye.has_undefined_stereocenters", "pkg_resources.resource_filename", "openeye.oechem.OESmilesToMol", "openmmtools.states.SamplerState", "o...
[((2155, 2193), 'os.environ.get', 'os.environ.get', (['"""GITHUB_ACTIONS"""', 'None'], {}), "('GITHUB_ACTIONS', None)\n", (2169, 2193), False, 'import os\n'), ((19723, 19763), 'pdbfixer.PDBFixer', 'PDBFixer', ([], {'filename': 'filename', 'pdbid': 'pdbid'}), '(filename=filename, pdbid=pdbid)\n', (19731, 19763), False, ...
# Required libraries import pandas as pd import logging as log import time import numpy as np from scipy import signal from sklearn.feature_extraction.text import CountVectorizer # Given an iterable (list or Series), turns it into a bag of words matrix (DataFrame) def get_bow(iterable, vocabulary=None, prefix=''): ...
[ "sklearn.feature_extraction.text.CountVectorizer", "pandas.merge", "time.time", "numpy.array", "numpy.arange", "numpy.dot", "scipy.signal.gaussian", "pandas.concat" ]
[((518, 556), 'sklearn.feature_extraction.text.CountVectorizer', 'CountVectorizer', ([], {'vocabulary': 'vocabulary'}), '(vocabulary=vocabulary)\n', (533, 556), False, 'from sklearn.feature_extraction.text import CountVectorizer\n'), ((1702, 1730), 'pandas.concat', 'pd.concat', (['[df, bow]'], {'axis': '(1)'}), '([df, ...
import numpy as np import pandas as pd from .batch_transformer import BatchTransformer class BaseRandomCellTransform(BatchTransformer): """ This is a base class used for all sorts of random cell transforms: feature dropout, noise, etc The transform is working by masked replacement of cells in a batch with s...
[ "numpy.random.uniform", "numpy.power", "numpy.zeros", "numpy.ones", "numpy.expand_dims", "pandas.MultiIndex.from_product", "numpy.linalg.svd", "numpy.array", "numpy.arange", "numpy.eye" ]
[((5537, 5551), 'numpy.array', 'np.array', (['cols'], {}), '(cols)\n', (5545, 5551), True, 'import numpy as np\n'), ((8533, 8594), 'numpy.random.uniform', 'np.random.uniform', ([], {'size': '(batch.shape[0], self._cols.shape[0])'}), '(size=(batch.shape[0], self._cols.shape[0]))\n', (8550, 8594), True, 'import numpy as ...
from pgfutils import save, setup_figure setup_figure( width=0.5, height=0.4, preamble_substitute=True, preamble=r""" \usepackage{fontspec} \setmainfont{CothamSans}[Path=${basedir}/../Cotham/,Extension=.otf]""", ) from matplotlib import pyplot as plt import numpy as np t = np.linspac...
[ "pgfutils.setup_figure", "numpy.sin", "pgfutils.save", "numpy.linspace" ]
[((42, 238), 'pgfutils.setup_figure', 'setup_figure', ([], {'width': '(0.5)', 'height': '(0.4)', 'preamble_substitute': '(True)', 'preamble': '"""\n \\\\usepackage{fontspec}\n \\\\setmainfont{CothamSans}[Path=${basedir}/../Cotham/,Extension=.otf]"""'}), '(width=0.5, height=0.4, preamble_substitute=True, p...
# This is the line list. import re import logging import numpy as np from . import utilsLists as lists logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) # Drawn from Splatalogue at http://www.cv.nrao.edu/php/splat/ # Lists that combine multiple transitions for a single line line_families = { ...
[ "logging.error", "numpy.isscalar", "numpy.max", "numpy.min", "logging.getLogger" ]
[((116, 143), 'logging.getLogger', 'logging.getLogger', (['__name__'], {}), '(__name__)\n', (133, 143), False, 'import logging\n'), ((11640, 11661), 'numpy.max', 'np.max', (['line_edge_ghz'], {}), '(line_edge_ghz)\n', (11646, 11661), True, 'import numpy as np\n'), ((11681, 11702), 'numpy.min', 'np.min', (['line_edge_gh...
""" Visualizer classes for GOES-R series. Authors: <NAME>, <NAME> (2021) """ import argparse import cartopy.crs as ccrs import cartopy.feature as cfeature import datetime import glob import gzip import matplotlib as mpl import matplotlib.pyplot as plt import metpy from netCDF4 import Dataset import numpy as np ...
[ "matplotlib.pyplot.title", "pandas.read_csv", "matplotlib.pyplot.figure", "os.path.join", "netCDF4.Dataset", "pandas.DataFrame", "matplotlib.pyplot.close", "matplotlib.pyplot.cm.ScalarMappable", "matplotlib.pyplot.colorbar", "datetime.timedelta", "cartopy.crs.Geostationary", "matplotlib.pyplot...
[((3341, 3379), 'numpy.array', 'np.array', (["measure_df['ACTIVITY_DATE1']"], {}), "(measure_df['ACTIVITY_DATE1'])\n", (3349, 3379), True, 'import numpy as np\n'), ((3404, 3443), 'numpy.array', 'np.array', (["measure_df['ACTIVITY_TIME_1']"], {}), "(measure_df['ACTIVITY_TIME_1'])\n", (3412, 3443), True, 'import numpy as...
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
[ "itertools.chain.from_iterable", "simpdom.constants.VERTICAL_WEBSITES.keys", "tensorflow.compat.v1.gfile.Open", "numpy.zeros", "absl.flags.DEFINE_string", "tempfile.TemporaryFile", "tensorflow.compat.v1.gfile.ListDirectory", "absl.app.run", "absl.flags.DEFINE_integer", "collections.Counter", "nu...
[((1031, 1124), 'absl.flags.DEFINE_integer', 'flags.DEFINE_integer', (['"""dim_word_glove"""', '(100)', '"""The dimensionality of the word embeddings."""'], {}), "('dim_word_glove', 100,\n 'The dimensionality of the word embeddings.')\n", (1051, 1124), False, 'from absl import flags\n'), ((1142, 1245), 'absl.flags.D...
#Calculate formulas for reward , q_value , R(state , action): from config import * from csv_handling import * import numpy as np def calc_reward(df , r, D): rew = (np.absolute(r) - df)/D return rew def calc_q(action,r,total_record_input,reward,D,candidate_set,df): index = candidate_set.index(action) ...
[ "numpy.absolute" ]
[((170, 184), 'numpy.absolute', 'np.absolute', (['r'], {}), '(r)\n', (181, 184), True, 'import numpy as np\n')]
from __future__ import print_function import numpy import irlib import scipy.integrate as integrate import matplotlib.pyplot as plt from mpmath import * plt.rc('text', usetex=True) N = 1000 xvec = numpy.linspace(-1, -1+0.01, N) ## Construct basis idx = 0 markers = ['o', 's', 'x', '+', 'v'] ls = ['-', '--', ':'] co...
[ "matplotlib.pyplot.xscale", "matplotlib.pyplot.yscale", "matplotlib.pyplot.legend", "matplotlib.pyplot.figure", "matplotlib.pyplot.rc", "numpy.linspace", "matplotlib.pyplot.ylabel", "matplotlib.pyplot.xlabel", "matplotlib.pyplot.tight_layout", "matplotlib.pyplot.savefig" ]
[((156, 183), 'matplotlib.pyplot.rc', 'plt.rc', (['"""text"""'], {'usetex': '(True)'}), "('text', usetex=True)\n", (162, 183), True, 'import matplotlib.pyplot as plt\n'), ((201, 233), 'numpy.linspace', 'numpy.linspace', (['(-1)', '(-1 + 0.01)', 'N'], {}), '(-1, -1 + 0.01, N)\n', (215, 233), False, 'import numpy\n'), ((...
#!/usr/bin/env python # ------------------------------------------------------------------------- # This file is part of BayesOpt, an efficient C++ library for # Bayesian optimization. # # Copyright (C) 2011-2015 <NAME> <<EMAIL>> # # BayesOpt is free software: you can redistribute it and/or modify it # u...
[ "bayesopt.optimize_discrete", "bayesopt.optimize", "numpy.zeros", "numpy.ones", "time.clock", "numpy.random.rand" ]
[((1805, 1819), 'numpy.zeros', 'np.zeros', (['(n,)'], {}), '((n,))\n', (1813, 1819), True, 'import numpy as np\n'), ((1825, 1838), 'numpy.ones', 'np.ones', (['(n,)'], {}), '((n,))\n', (1832, 1838), True, 'import numpy as np\n'), ((1848, 1855), 'time.clock', 'clock', ([], {}), '()\n', (1853, 1855), False, 'from time imp...
from copy import deepcopy from typing import List import matplotlib.pyplot as plt import numpy as np import pandas as pd import sklearn.datasets from sklearn import datasets from sklearn import tree from sklearn.base import BaseEstimator, ClassifierMixin, RegressorMixin from sklearn.model_selection import train_test_s...
[ "sklearn.model_selection.cross_val_score", "numpy.ones", "numpy.clip", "numpy.mean", "sklearn.utils.validation._check_sample_weight", "sklearn.datasets.make_friedman1", "sklearn.tree.DecisionTreeRegressor", "sklearn.utils.check_array", "sklearn.utils.check_X_y", "numpy.max", "imodels.tree.viz_ut...
[((20125, 20169), 'sklearn.datasets.load_breast_cancer', 'datasets.load_breast_cancer', ([], {'return_X_y': '(True)'}), '(return_X_y=True)\n', (20152, 20169), False, 'from sklearn import datasets\n'), ((20189, 20217), 'sklearn.datasets.make_friedman1', 'datasets.make_friedman1', (['(100)'], {}), '(100)\n', (20212, 2021...
# gui.py # # This file is part of scqubits. # # Copyright (c) 2019 and later, <NAME> and <NAME> # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. #########################################################...
[ "ipywidgets.widgets.ToggleButtons", "ipywidgets.widgets.Checkbox", "ipywidgets.widgets.HBox", "ipywidgets.widgets.interactive_output", "pathlib.Path.cwd", "ipywidgets.widgets.FloatSlider", "IPython.display.display", "scqubits.utils.misc.Required", "scqubits.Grid1d", "ipywidgets.widgets.Dropdown", ...
[((1052, 1116), 'scqubits.utils.misc.Required', 'utils.Required', ([], {'ipywidgets': '_HAS_IPYWIDGETS', 'IPython': '_HAS_IPYTHON'}), '(ipywidgets=_HAS_IPYWIDGETS, IPython=_HAS_IPYTHON)\n', (1066, 1116), True, 'import scqubits.utils.misc as utils\n'), ((6504, 6556), 'IPython.display.display', 'display', (['qubit_and_pl...
import tensorflow as tf import tensorflow_datasets as tfds from cvnn import layers import numpy as np import timeit import datetime from pdb import set_trace import os import plotly.graph_objects as go import plotly os.environ['CUDA_VISIBLE_DEVICES'] = '-1' try: PLOTLY = True except ModuleNotFoundError: PLOT...
[ "tensorflow.random.set_seed", "cvnn.layers.ComplexDense", "tensorflow_datasets.load", "tensorflow.keras.layers.Dense", "timeit.default_timer", "numpy.allclose", "tensorflow.cast", "tensorflow.keras.layers.Activation", "tensorflow.keras.optimizers.Adam", "cvnn.layers.ComplexFlatten", "tensorflow....
[((675, 779), 'tensorflow_datasets.load', 'tfds.load', (['"""mnist"""'], {'split': "['train', 'test']", 'shuffle_files': '(False)', 'as_supervised': '(True)', 'with_info': '(True)'}), "('mnist', split=['train', 'test'], shuffle_files=False,\n as_supervised=True, with_info=True)\n", (684, 779), True, 'import tensorfl...
# %% from nltk.lm import MLE from nltk.util import ngrams from nltk.lm.preprocessing import pad_both_ends, padded_everygram_pipeline from sklearn.model_selection import KFold from sklearn import metrics import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import LogNorm import ...
[ "pandas.DataFrame", "matplotlib.pyplot.show", "math.pow", "pandas.read_csv", "nltk.lm.preprocessing.padded_everygram_pipeline", "nltk.lm.MLE", "matplotlib.pyplot.subplots", "sklearn.model_selection.KFold", "simplejson.load", "sklearn.metrics.classification_report", "numpy.arange", "numpy.array...
[((375, 384), 'seaborn.set', 'sns.set', ([], {}), '()\n', (382, 384), True, 'import seaborn as sns\n'), ((5692, 5951), 'pandas.DataFrame', 'pd.DataFrame', (['ngram_results'], {'columns': "['task_number', 'n', 'confidence_threshold', 'total_accuracy',\n 'total_precision', 'total_recall', 'total_f1-score',\n 'total...
# -*- coding: utf-8 -*- from numpy import array def comp_height(self): """Compute the height of the Magnet. Caution, the bottom of the Magnet is an Arc Parameters ---------- self : Magnet A Magnet object Returns ------- Htot: float Height of the Magnet [m] """ ...
[ "numpy.array" ]
[((440, 457), 'numpy.array', 'array', (['point_list'], {}), '(point_list)\n', (445, 457), False, 'from numpy import array\n')]
""" 製作者:TODA 学習時に逐次行うテストクラスの定義 """ import wave import chainer import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl from vrc_project.world_and_wave import wave2world, world2wave from world_and_wave import fft class TestModel(chainer.training.Extension): """ テストを行うExtention """ def...
[ "matplotlib.pyplot.title", "matplotlib.pyplot.clf", "vrc_project.world_and_wave.world2wave", "matplotlib.pyplot.margins", "matplotlib.pyplot.figure", "numpy.mean", "matplotlib.pyplot.tick_params", "numpy.pad", "numpy.std", "matplotlib.pyplot.imshow", "numpy.transpose", "world_and_wave.fft", ...
[((1334, 1346), 'world_and_wave.fft', 'fft', (['data[1]'], {}), '(data[1])\n', (1337, 1346), False, 'from world_and_wave import fft\n'), ((1875, 1938), 'numpy.pad', 'np.pad', (['source_sp', '((0, r), (0, 0), (0, 0), (0, 0))', '"""constant"""'], {}), "(source_sp, ((0, r), (0, 0), (0, 0), (0, 0)), 'constant')\n", (1881, ...
import numpy as np import cv2 class moving_detector: def __init__(self): a = 1 def draw_flow(slef,img, flow, step=16): h, w = img.shape[:2] y, x = np.mgrid[step / 2:h:step, step / 2:w:step].reshape(2, -1) fx, fy = flow[y, x].T lines = np.vstack([x, y, x + fx, y + fy]).T...
[ "numpy.minimum", "cv2.circle", "cv2.polylines", "numpy.arctan2", "cv2.dilate", "cv2.cvtColor", "cv2.threshold", "numpy.zeros", "cv2.remap", "cv2.rectangle", "numpy.arange", "numpy.int32", "cv2.calcOpticalFlowFarneback", "cv2.boundingRect", "numpy.vstack", "numpy.sqrt" ]
[((355, 376), 'numpy.int32', 'np.int32', (['(lines + 0.5)'], {}), '(lines + 0.5)\n', (363, 376), True, 'import numpy as np\n'), ((391, 428), 'cv2.cvtColor', 'cv2.cvtColor', (['img', 'cv2.COLOR_GRAY2BGR'], {}), '(img, cv2.COLOR_GRAY2BGR)\n', (403, 428), False, 'import cv2\n'), ((437, 478), 'cv2.polylines', 'cv2.polyline...
from abc import ABC, abstractmethod,ABCMeta import sys import os import math import pandas as pd from sklearn.preprocessing import MinMaxScaler from data_fetcher import downloader from datetime import datetime from collections import OrderedDict,Set import numpy as np import matplotlib.pyplot as plt def co...
[ "pandas.read_csv", "sklearn.preprocessing.MinMaxScaler", "numpy.arange", "sys.exc_info", "os.path.join", "pandas.DataFrame", "numpy.zeros_like", "data_fetcher.downloader.load_yahoo_quote", "numpy.append", "math.log", "matplotlib.pyplot.show", "math.sqrt", "matplotlib.pyplot.legend", "numpy...
[((11430, 11459), 'matplotlib.pyplot.plot', 'plt.plot', (['original'], {'color': '"""k"""'}), "(original, color='k')\n", (11438, 11459), True, 'import matplotlib.pyplot as plt\n'), ((11537, 11572), 'numpy.arange', 'np.arange', (['window_size', 'split_pt', '(1)'], {}), '(window_size, split_pt, 1)\n', (11546, 11572), Tru...