text
stringlengths
6.04k
39.5k
"""General functions and utilities to write reStructured documents. """ from argparse import RawDescriptionHelpFormatter from os import name import re import json from dataclasses import dataclass from typing import Dict, List, Any import logging from .config import LOG_LEVELS, LOGGER api_ref = {} with open("godot_ap...
import glob import matplotlib.pyplot as plt import numpy as np import os, itertools from cfod import chime_intensity import corrfns, fitburst from tqdm import tqdm import pandas as pd def findCenter(burstwindow): freqspectrum = burstwindow.sum(axis=1)[:, None] freqi = np.indices(freqspectrum.shape)[0] return np.nan...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ will train a new network on a dataset and save the model as a checkpoint python train.py data_directory Prints out training loss, validation loss, and validation accuracy as the network trains python train.py data_dir --save_dir save_directory python train.py data_dir ...
""" Copyright 2016 University of Freiburg <NAME> <<EMAIL>> This module contains the functionality associated with building a sql database (aka. soundbase) from given audiofiles containing information on path and audiofeatures of each of the audiofiles per row. The audiofeatures will be extracted with the default setti...
import datetime as dt from functools import cached_property from itertools import product from typing import Dict, List, Sequence, Union import pandas as pd from dateutil.relativedelta import relativedelta from singleton_decorator import singleton from . import date_utils from .config import get_db_interface from .da...
#!/usr/bin/env python # -*- coding: utf-8 -*- import torch import torch.nn as nn import numpy as np import time import os import matplotlib.pyplot as plt import sys import csv import creator_result_files as crf ''' Main function to create labeled images ''' from models.autoencoder_none import Autoencoder as Aut...
from datetime import datetime import numpy as np import pandas as pd import pygsheets import json with open('./config.json') as config: creds = json.load(config)['google'] def convert_int(value): value = str(value).lower() value = value.replace('fewer than five', '0') value = value.replace('fewer than...
__author__ = "<NAME>, Albuquerque" """ This module: Utilities in service of other mp2021 modules. """ # Python core: import os from datetime import datetime, timezone, timedelta from math import floor # External packages: import pandas as pd # Author's packages: import mp2021.ini as ini THIS_PACKAGE_ROOT_DIRECTOR...
import os, sys, re, shlex from collections import namedtuple TEXT = 0 CALL = 1 VARIABLE = 2 PREPROC = 3 Preproc = namedtuple('Preproc', ['pos', 'kw', 'value']) Call = namedtuple('Call', ['pos', 'name', 'value']) Variable = namedtuple('Variable', ['pos', 'name', 'value']) Text = namedtuple('Text', ['pos', 'text']) cl...
import pytest from .sim_qdac2_fixtures import qdac # noqa import numpy as np def test_arrangement_default_correction(qdac): # noqa # ----------------------------------------------------------------------- arrangement = qdac.arrange(gates={'plunger1': 1, 'plunger2': 2, 'plunger3': 3}) # -----------------...
#Yes. I'm aware this is a mess right now. Look it's my first project don't hate. :L #Imports import random import datetime from re import I from time import sleep import sys # Graphics load_text1 = """ /$$ /$$ /$$ | $$ /$ | $$ | $$ ...
import sys import os import csv import pandas as pd import numpy as np sys.path.insert(1, os.path.join(sys.path[0], '../tools')) import CMUTweetTagger from polyglot.detect import Detector from polyglot.text import Text import aspell import Levenshtein as ls import language_check import techniques import re import glob ...
# -*- coding: utf-8 -*- # @Author: yancz1989 # @Date: 2016-06-07 17:03:03 # @Last Modified by: yancz1989 # @Last Modified time: 2016-12-06 21:41:33 from __future__ import print_function from __future__ import absolute_import import numpy as np import scipy as sp from collections import OrderedDict import itertool...
# # Copyright (c) 2014-2015 The developers of Aqualid project # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, mo...
# -*- coding:utf-8 -*- from os import path, rename, remove import re from functools import reduce import pickle import fileinput import pathlib import math #RENMIN_1998_CORPUS = path.join(path.abspath('./res'), '1998_corpus.txt') #RENMIN_2014_CORPUS = path.join(path.abspath('./res'), '2014_corpus.txt') #CIY...
import more_itertools as mit import peakutils import warnings import traceback import numpy as np import pandas as pd import pickle import logging import os import glob import sys from tqdm.auto import tqdm from ceciestunepipe.util.sound import spectral as sp from ceciestunepipe.util.sound import temporal as st log...
################################################## # This script is used to test the deployed service # It takes one arguments: # The configuration file which contains the Azure # storage account name, key and data source location. # By default, it is "./Config/webserivce.json" ##########################...
import csv import json import logging import math import requests from pymodbus.client.sync import ModbusSerialClient from pymodbus.client.sync import ModbusTcpClient from pymodbus.constants import Endian from pymodbus.exceptions import ModbusException from pymodbus.payload import BinaryPayloadDecoder from prettytable...
######################################################################## # hashlib_additional Python library # Copyright (c) 2019 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software with...
import json import logging import operator import os import random import urllib2 import dataset import image_getter import utils logger = logging.getLogger(__name__) def _parse_url_file(file_data, separator=" ", get_utf=False): """ ImageNet generally uses a specific format to store the URLs of images. This fu...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, 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 cop...
import torch import numpy as np import copy import random #from ..replay_buffers import EXP #from ..networks import LeakyReLU, DQN, DuelingDQN #from ..networks import PreprocessFunction #from ..DQN import DeepQNetworkAlgorithm, DoubleDeepQNetworkAlgorithm from ..algorithms.DQN import DQNAlgorithm, dqn_loss, ddqn_loss...
import json from datetime import datetime from flask import Flask, render_template, request, session, flash, redirect, url_for from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy from sqlalchemy import or_,func from sqlalchemy.sql import label from config import Config app = Flask(__name__) app.c...
#------------------------------------------------------------------------------- # Name: Spatial Parser # Purpose: Parser for spatial premises, based on LISP code developed by # PN Johnson-Laird and R.Byrne as part of their 1991 book # 'Deduction' and their 1989 paper 'Spatial Reaso...
import os import PIL from PIL import Image import torch from torch.utils.data import Dataset import numpy as np class Label(object): def __init__(self, name, id, trainid, category, catid, hasinstances, ignoreineval, color): self.name = name self.id = id self.trainid = trai...
import argparse import datetime import json import functools import glob import os import re import shutil import subprocess import sys from typing import List, Tuple import docker print = functools.partial(print, file=sys.stderr, flush=True) DOCKER_USERNAME = "raytravisbot" DOCKER_CLIENT = None PYTHON_WHL_VERSION = ...
""" Original Author: <NAME> """ import numpy as np import ctypes as ct import cv2 import sys import os from pprint import pprint import argparse from datetime import datetime BASE_DIR = os.path.dirname(os.path.abspath(__file__)) showsz=800 mousex,mousey=0.5,0.5 zoom=1.0 changed=True def onmouse(*args): global mous...
# Lint as: python3 # 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 ...
# -*- coding: utf-8 -*- """ Base classes for writing management commands (named commands which can be executed through ``django-admin`` or ``manage.py``). """ from __future__ import unicode_literals import os import sys import warnings from argparse import ArgumentParser from optparse import OptionParser import djang...
""" Copyright 2020 MPI-SWS 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, software distri...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 <NAME> # 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...
# Copyright (c) 2017 NVIDIA Corporation from __future__ import absolute_import, division, print_function from __future__ import unicode_literals import numpy as np import tensorflow as tf import os from enum import Enum from open_seq2seq.data.data_layer import DataLayer from open_seq2seq.data.utils import load_pre_exi...
# Copyright 2019-2022 The <NAME> at the California Institute of # Technology (Caltech), with support from the Paul Allen Family Foundation, # Google, & National Institutes of Health (NIH) under Grant U24CA224309-01. # All rights reserved. # # Licensed under a modified Apache License, Version 2.0 (the "License"); # you ...
import numpy as np nax = np.newaxis import pylab import predictive_distributions from utils import distributions import variational SIGMOID_SCHEDULE = True def p_s_given_z(S, Z, t, sigma_sq_approx): return (1. - t) * distributions.gauss_loglik(S, 0., sigma_sq_approx[nax, :]) + \ t * distributions.gaus...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import time import json import uuid import datetime from boto3 import Session from moto.core import BaseBackend, BaseModel from .exceptions import ( SecretNotFoundException, SecretHasNoValueException, InvalidParameterException, ResourceE...
# -*- coding: utf-8 -*- """ Notifications models """ from __future__ import unicode_literals import json from django.db import models from django.utils import timezone from django.utils.translation import gettext_lazy as _ from django.contrib.auth import get_user_model from django.conf import settings from . import ta...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """ The R Learner is an approach for estimating flexible non-parametric models of conditional average treatment effects in the setting with no unobserved confounders. The method is based on the idea of Neyman orthogon...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.mail.tests.common import TestMail from odoo.tools import mute_logger class TestMailFeatures(TestMail): # TDE TODO: tests on the redirection controller def test_alias_setup(self): alias...
#!/usr/bin/env python3 """ This is a python script to detect bibs & text using Keras. Usage: python detect.py -i /path/to/input/files \ -o /path/to/output \ -c /path/to/pickle.config Provide a pickle config trained on Bibs for bib detection or on text for text de...
""" A simple Psi 4 input script to compute EP3 using spin-orbitals From Szabo and Ostlund page 390 """ __authors__ = "<NAME>" __credits__ = ["<NAME>"] __copyright__ = "(c) 2014-2017, The Psi4NumPy Developers" __license__ = "BSD-3-Clause" __date__ = "2017-9-30" import time import numpy as np np.set_printoptions(preci...
import numpy as np import pandas as pd from numpy import array, atleast_2d, linspace, zeros from scipy.optimize import root from dolo.numeric.optimize.ncpsolve import ncpsolve def _shocks_to_epsilons(model, shocks, T): """ Helper function to support input argument `shocks` being one of many different dat...
import os def make_completion_code(op_name, attribute_list=[], shape_inference_code=''' assert(node.input_name_list.size() > 0); assert(node.output_name_list.size() > 0); add_variable_to_table(output(0), dtype_of(input(0)), dims_of(input(0))); ''', ...
# -*- Coding: utf-8 -*- import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder import re from sklearn.feature_extraction import DictVectorizer from sklearn.model_selection import train_test_split import pandas as pd from pandas.tseries.holiday import US...
import platform import re from colorsys import rgb_to_hls from enum import IntEnum from functools import lru_cache from typing import TYPE_CHECKING, NamedTuple, Optional, Tuple from ._palettes import EIGHT_BIT_PALETTE, STANDARD_PALETTE, WINDOWS_PALETTE from .color_triplet import ColorTriplet from .terminal_theme impor...
#!/usr/bin/env python3 # # Copyright 2021 Xiaomi Corporation (Author: <NAME>) # # See ../../../../LICENSE for clarification regarding multiple 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 Lic...
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines 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 ap...
#!/usr/bin/env python3 import re from enum import Enum from collections import namedtuple, deque ## Utilities ## ========= class StringView: def __init__(self, s, beg=0, end=None): end = end if end is not None else len(s) self.s, self.beg, self.end = s, beg, end assert self.beg <= len(s) ...
#!/usr/bin/env python # -*- Mode: python; encoding: utf-8 -*- # """This is the interface for managing cron jobs.""" import itertools import time from grr.gui import renderers from grr.gui.plugins import fileview from grr.gui.plugins import flow_management from grr.gui.plugins import forms from grr.gui.plugins impor...
import os from collections import OrderedDict import torch import torch.nn as nn import torch.nn.functional as F from mask_rcnn.core.config import cfg import mask_rcnn.nn as mynn import mask_rcnn.utils.net as net_utils # from mask_rcnn.utils.resnet_weights_helper import convert_state_dict # -------------------------...
#!/usr/bin/python3 """ @Author: <NAME> @Site: https://github.com/liushaoweihua """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import tensorflow as tf import numpy as np import collections from pyclue.tf1.tokenizers.utils imp...
# -*- coding: utf-8 -*- """ Created on Mon Aug 31 05:47:12 2020 @author: <NAME> """ import json import pandas as pd import numpy as np import re import random import sqlite3 import datetime import calendar from dateutil.relativedelta import * with open('lookup1.json') as json_file: data = json.load(json_file)...
import json import os import time import uuid from copy import deepcopy import csv import sys import pathlib import boto3 import dash import dash_core_components as dcc import dash_html_components as html import requests from dash.dependencies import Input, Output, State from flask_caching import Cache import dash_re...
from ZeroScenarioScript import * from Instruction.ScenaOpTableEDZero import * from GameData.ItemNameMap import * import importlib.machinery import os def plog(*value, sep = ' ', end = '\n', file = sys.stdout, flush = False): pass #plog = print def VerifyTupleOrList(param): if not IsTupleOrList(param): ...
# coding: utf-8 from __future__ import print_function # In[1]: # difference from cnn_context: # in this code, context info are represented by conv net before concat with the current utterance representation # In[2]: import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = "0" ...
# Copyright The OpenTelemetry 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 applicable law or agreed to in ...
# Copyright (c) 2020 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute,...
import torch import torch.nn as nn from torch.nn import init import functools, itertools import numpy as np def weights_init(m): classname = m.__class__.__name__ if classname.find('Conv') != -1: m.weight.data.normal_(0.0, 0.02) if hasattr(m.bias, 'data'): m.bias.data.fill_(0) ...
import logging import toolbox as toolbox import utility as utility IDs = utility.IDs air_like = [IDs["air"], IDs["water"], IDs["log"], IDs["leaves"], IDs["web"], IDs["tallgrass"], IDs["deadbush"], IDs["yellow_flower"], IDs["flower"], IDs["brown_mushroom"], IDs["red_mushroom"], IDs["wheat"], IDs["cactus"], IDs["reeds"...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: <NAME> (<EMAIL>) # @Date: 2019-05-13 # @Filename: commands.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) from __future__ import annotations import asyncio import json import pathlib from time import time from typing import TYP...
from __future__ import print_function import sys import os import csv import copy import re import numpy as np from psims.transform.mzml import MzMLTransformer from .simsalabim import __version__, __copyright__ from . import helpers def main(argv): print('add-quant-info version %s\n%s' % (__version__, __copyright...
""" Blizzard Mipmap Format (.blp) <NAME> <<EMAIL>> The contents of this file are hereby released in the public domain (CC0) Full text of the CC0 license: https://creativecommons.org/publicdomain/zero/1.0/ BLP1 files, used mostly in Warcraft III, are not fully supported. All types of BLP2 files used in World of Warc...
# coding=utf-8 # Copyright 2022 Meta Platforms, Inc. and The HuggingFace Inc. team. 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...
import os import struct import time import numpy as np from CSIKit.csi import CSIData from CSIKit.csi.frames import NEXCSIFrame from CSIKit.reader import Reader from CSIKit.util import byteops from CSIKit.util import csitools, stringops start = time.time() class PcapFrame: FRAME_HEADER_DTYPE = np.dtype([ ...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. from collections import OrderedDict import logging import torch import torch.nn.functional as F from torch import nn import torch.utils.checkpoint as checkpoint import numpy as np from timm.models.layers import trunc_normal_, DropPath class Bot...
import sys from rdkit import Chem from rdkit.Chem import AllChem from rdkit.Chem import rdFMCS from rdkit.Chem import rdMolAlign from rdkit.Chem import rdMolTransforms from rdkit.Geometry.rdGeometry import Point3D from rdkit.Chem.rdchem import Atom import utils import numpy as np import math import glob import random i...
# Copyright (c) 2010-2020 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Float, Integer, Bool, MinMax, Set, NoneSet, String, Alias, ) from openpyxl.descriptors.excel import Coordinate, Percentage from openpyxl.descripto...
"""RefineNet-LightWeight RefineNet-LigthWeight PyTorch for non-commercial purposes Copyright (c) 2018, <NAME> (<EMAIL>) All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code...
import copy import functools import ipaddress import itertools import os import sys import urllib.parse from logging import error, warning from typing import Iterable, List, Optional, Text, TextIO, Tuple import act.api from . import DEFAULT_FACT_VALIDATOR, DEFAULT_METAFACT_VALIDATOR from .base import ActBase, Config,...
# -*- coding: utf-8 -*- from collections import OrderedDict, defaultdict from typing import ( Dict, List, Optional, Type, Callable, Union, Container, get_type_hints, Tuple, MutableMapping, Any, Mapping) from andi.typeutils import ( get_union_args, is_union, get_globalns, get_unannotated_params,...
import numpy as np import argparse import os, sys, datetime import tensorflow as tf import struct from tensorpack import * from tensorpack.tfutils.symbolic_functions import * from tensorpack.tfutils.summary import * from tensorpack import * from tensorpack.utils import logger, utils, fs, stats from anytime_models.e...
#!/usr/bin/env python from canari.maltego.entities import EntityField, Entity class BinaryEntity(Entity): _namespace_ = u'binary' @EntityField(name=u'properties.pehash', propname=u'propertiespehash', displayname=u'PE: peHash') class peHash(BinaryEntity): pass @EntityField(name=u'sha1', propname=u'sha1', d...
""" Common code for all runtimes. Desktop runtimes provide a way to load a page as desktop application. To do so, we may cache or link to an existing runtime (like Firefox) or even keep a local copy of a runtime (like NW.js). Some runtimes (e.g. Firefox) needs a whole directory structure as its app definition. Others ...
from __future__ import print_function import subprocess import numpy as np try: import pyfits except: import astropy.io.fits as pyfits __author__ = '<NAME>' __version__= '2.23' __date__ = '2020-08-14' class DS9: """ Pipes data and commands to ds9. Examples: --------- >>> from ds9 import * ...
# Copyright 2017 <NAME>. 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 applicable law or agree...
# Copyright (C) 2016 <NAME> at Chongqing University # of Posts and Telecommunications, Chongqing, China. # # 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/LIC...
# RevKit: A Toolkit for Reversible Circuit Design (www.revkit.org) # Copyright (C) 2009-2011 The RevKit Developers <<EMAIL>> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 o...
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines 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 ap...
#!/usr/bin/python # Copyright (c) 2017, 2021 Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Apache License v2.0 # See LICENSE.TXT for d...
""" @Fire https://github.com/fire717 """ import sys import torch import math import numpy as np import torch.nn.functional as F import cv2 _img_size = 192 _feature_map_size = _img_size // 4 _center_weight_path = 'lib/data/center_weight_origin.npy' class JointBoneLoss(torch.nn.Module): def __init__(self, joint...
# Copyright The PyTorch Lightning team. # # 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 i...
# # Copyright 2014-2016 <NAME>, <NAME>, <NAME>, # and others from Multicore Computing Lab, Department of Computer Science # and Automation, Indian Institute of Science # # 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 collection of routines that build matrices used in the 3D joint annihilation """ from __future__ import division import numpy as np from scipy import linalg from utils_2d import periodic_sinc, nd_distance from convolution3d import convmtx3_valid from build_linear_mapping_joint2d import compute_effective_num_eq_2d...
from collections import namedtuple, OrderedDict import base64 import threading from decimal import Decimal from . import bitcoin from . import ecc from .blockchain import hash_header from .masternode import MasternodeAnnounce, NetworkAddress from .masternode_budget import BudgetProposal, BudgetVote from .util import A...
''' Copyright 2017, Fujitsu Network Communications, 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.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
import numpy as np import pandas as pd import sklearn.metrics import ubelt as ub from sklearn.preprocessing import LabelEncoder def classification_report(y_true, y_pred, target_names=None, sample_weight=None, verbose=False): """ Computes a classification report which is a collection ...
from __future__ import print_function, division import os import util import scipy as sp import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from datetime import datetime LEARNING_RATE = 0.0002 BETA1 = 0.5 BATCH_SIZE = 64 EPOCHS = 2 SAVE_SAMPLE_PERIOD = 50 if not os.path.exists('samples'): ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Credits: <NAME>, <NAME> import numpy as np from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord import ray import os import pathlib import math import random from sklearn.utils import shuffle import h5py def reverse_complement(fragment): ...
__all__ = [ 'pods', ] from pathlib import Path import json import logging from garage import apps from garage import scripts from garage.assertions import ASSERT from ops import models from . import deps from . import repos LOG = logging.getLogger(__name__) # Note that # deploy_copy # deploy_create_pod_m...
#!/usr/bin/env python3 from flask import Flask, request, make_response, render_template from flask.ext.github import GitHub, GitHubError from collections import OrderedDict import configparser from datetime import datetime import atexit import hashlib import hmac import json import os import queue import re import sig...
import math import numpy as np import time def factorial(n): total = n for i in range(1, n): total *= i if (n==0): return 1 return total def choose(n,k): """Standard Choose function. :param n: The total sample size. :type n: int :param k: The number of elemen...
# Copyright 2019 TerraPower, LLC # # 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 writi...
import math import numpy from data_settings import data_settings_internal # ignoring leap years (i.e. week 53)! # Calculations will be off by one day after Feb 28.! DAYS_PER_WEEK = 7 HOURS_PER_WEEK = 168 #24 * DAYS_PER_WEEK HALF_HOURS_IN_WEEK = 84 #HOURS_PER_WEEK/2 WEEKS_PER_YEAR = 52 HOURS_PER_YEAR = WEEKS_PER_YEAR ...
# Copyright 2016 Google Inc. 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 applicable law or a...
import torch import torch.nn as nn import numpy as np import time import argparse import random from torch.multiprocessing import Pool from loss import CustomLoss from datagen import get_data_loader from model import PIXOR from utils import get_model_name, load_config, get_logger, plot_bev, plot_label_map, plot_pr_cur...
# Copyright (c) 2020 ING Wholesale Banking Advanced Analytics # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including without limitation the rights to # use, copy, mo...
# !/usr/bin/env python # -*- coding: utf-8 -*- # # <NAME> # 9 Jun 2018 # # Last update: 12 Jul 2018 # # CAP # CCD analysis pipeline # from astropy.io import fits from scipy.optimize import curve_fit import argparse import ccdproc import glob import math import matplotlib.pyplot as plt import numpy as np import os # C...
from copy import deepcopy as dp import pygame,sys,time from pygame.locals import * import random as rd import itertools as it import functools import time import os import pickle time1=time.time() graph={'0*********0**0':{'1a********1h1a','1*a*******2h2a','1**a******3h3a', '1***a*****4h4a','1****...
import torch import torch.nn as nn from torch.optim import LBFGS import hamiltorch import numpy as np import matplotlib.pyplot as plt import pickle from tqdm.auto import tqdm, trange # from multiprocessing import Pool from core import Inference def init_random_inputs_w_bounds(np_lb, np_ub, N=1, torch_tensor=True, s...
"""Network architectures for MuZero Author: <NAME> This script defines the network architectures for MuZero, which consists of 3 components: Representation, Dynamic, and Prediction. The main MuZero network can perform recurrent rollouts as described in the orginal paper. https://arxiv.org/pdf/1911.08265.pdf Thi...
import multiprocessing as mp import sys import time import os import cv2 import numpy as np from PyQt5 import QtWidgets, QtGui, QtCore from PyQt5 import uic import pygame """ 전역 설정란 라벨 크기 : 800(w 너비) 600(h 높이) """ idleTime = 10 # second threshold = 1.6 label_w = 800 label_h = 600 # def resource_path(relative_pat...