text stringlengths 8.04k 46.5k |
|---|
import torch
import torch.nn.functional as F
import time
class Sampler():
def __init__(self, n_coarse_samples, n_fine_samples, device):
self.n_coarse_samples = n_coarse_samples
self.n_fine_samples = n_fine_samples
self.coarse_interval_dists = torch.linspace(
0, 1, steps=n_coarse... |
import datetime
from copy import copy
from multiprocessing import Value
from selenium.webdriver.common.keys import Keys
import flask
import pytest
from bs4 import BeautifulSoup
import dash_dangerously_set_inner_html
import dash_flow_example
import dash_html_components as html
import dash_core_components as dcc
fr... |
"""
Store all utility and reusable functions.
"""
import hashlib
import json
import os
import pandas as pd
import pdb
import requests
import time
from azure.common import AzureMissingResourceHttpError
from azure.storage.blob import BlockBlobService
from dataproducts.resources.common import common_config
from dataproduc... |
import os, sys
import numpy as np
import torch
import torchvision
import json
import random
from PIL import Image
from glob import glob
from scipy.stats import norm
# from torchvision import transforms
from imageio import imread
from tqdm import tqdm
from scipy.io import loadmat
from termcolor import colored
import ti... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2019 <NAME> (Nagoya University)
# based on PyTorch implementation for WaveNet vocoder by <NAME> (Nagoya University)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
from __future__ import division
from __future__ import print_function
import argpar... |
"""Adapted from https://github.com/JiaRenChang/PSMNet"""
from __future__ import print_function
import argparse
import csv
import os
import time
import cv2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
from torch.autograd import Variab... |
#!/usr/bin/env python
# encoding: utf-8
# This file is part of CycloneDX Python module.
#
# 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
#
#... |
#!/usr/bin/env python
# coding: utf-8
# systems tools
import os
import shutil
import sys
import time
import sys
import signal
import random
# multiprocess
import threading
import psutil
#format
import string
import json
#sqlite
import sqlite3
#args
import argparse
#maths
import numpy as np
#strings
import re #... |
from typing import Union, List, Dict
import rdflib
import requests
import ontquery as oq
import ontquery.exceptions as exc
from ontquery.utils import cullNone, log, QueryResult
from ontquery.services import OntService
from .interlex_client import InterLexClient
from .rdflib import rdflibLocal
from . import deco
cla... |
import sys
import bpy
import numpy as np
from bpy.types import Operator
import traceback
import mathutils
import time
def clamp(value, minVal, maxVal):
return min(maxVal, max(minVal, value))
def squashAttributes(context):
def print(data):
for window in bpy.context.window_manager.windows:
s... |
#!/usr/local/bin/python
##################
# import modules #
##################
from math import sqrt,exp
from random import random,randint,seed
####################
# define constants #
####################
nAtoms = 40 # nb of atoms
Radius = 25.0 # beware that Radius must be in a good range (accordin... |
"""
MIT License
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 without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distri... |
from datetime import datetime
import numpy as np
from six import string_types
from .array import DataArray
from .exceptions import (
SharedKeyError, InvalidStateError, InvalidPropertyDictError)
try:
from numba import jit
except ImportError:
# define a function with the same call signature as jit that doe... |
"""
Run a cpymad MAD-X simulation for the LHC optics (2018),
assign measured errors from a WISE realization and correct
the nonlinear errors in the IR.
At the end output for SixTrack input is written.
The ``main()`` function set's up the beams and is responsible to assign the
IRNL corrections to the right optics. Thes... |
#!/usr/bin/env python
#
# Copyright 2019 Autodesk
#
# 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 ... |
import logging
import re
import time as ttime
from collections import OrderedDict
from databroker.assets.handlers import Xspress3HDF5Handler
from ophyd import Component as Cpt
from ophyd import DynamicDeviceComponent as DynamicDeviceCpt
from ophyd import EpicsSignal, EpicsSignalRO, Signal
from ophyd.areadetector impo... |
import argparse
import imp
import locale
import os
import select
import sys
from contextlib import contextmanager
from copy import deepcopy
from datetime import datetime
from json import dumps, loads
from signal import signal
from signal import SIGUSR1
from subprocess import Popen
from subprocess import PIPE
from subp... |
from . import typing, reflection, typecheck, flags, mgd_transient, utils
from .typecheck import Typechecker, fixup, cast, error
from .relations import *
from .rtypes import *
from .errors import errmsg
from .typing import *
from .gatherers import FallOffVisitor, WILL_RETURN
def check(val, elim, act, trg, msg, check_fu... |
# pylint: disable=missing-docstring,no-self-use,bad-whitespace,bad-continuation
import pytest
import numpy as np
from dataframer.column_factory import column_grabber
from dataframer.column_factory import IntColumnMaker, FloatColumnMaker, EnumColumnMaker
from dataframer.column_factory import TimestampColumnMaker, Date... |
# 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
# distributed under the... |
""" Convert LaTeX Sentence to SymPy Expression """
# Author: <NAME>
# Email: ksible *at* outlook *dot* com
# pylint: disable=attribute-defined-outside-init
from sympy import Function, Symbol, Integer, Rational, Float, Pow
from sympy import preorder_traversal, expand, var
from collections import OrderedDict
from inspe... |
"""
Created on Sep 9, 2014
@author: jtaghiyar
"""
import sys
import copy
from helpers import *
from warnings import warn
class Connection(object):
"""
connection between different attributes of different sections.
"""
def __init__(self, start_node, start_param, stop_node, stop_param, path):... |
"""Abstract model of a representation the monster group
Let R_p be the 196884-dimensional representation 196884x of the monster
group modulo a small odd number p as described in [Seys19]. Class
AbstractMmRepSpace is an abstract class for modelling representation
R_p. A small odd modulus p < 256 is passed to the const... |
# -*- coding: utf-8 -*-
from datetime import datetime, timedelta
from urlparse import parse_qs
from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks, maybeDeferred
from twisted.web import xmlrpc
from vumi.utils import http_request, http_request_full
from vumi.transports.failures import... |
import warnings
import os
import shutil
import time
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import RegRCNN.utils.exp_utils as utils
import RegRCNN.utils.model_utils as mutils
'''
Use nn.DataParallel to use more than one GPU
'''
def center_crop_2D_image_bat... |
import os
import operator
import unittest
import numpy as np
from pandas.core.api import DataFrame, Index, notnull
from pandas.core.datetools import bday
from pandas.core.panel import (WidePanel, LongPanelIndex, LongPanel,
group_agg, pivot)
from pandas.util.testing import (ass... |
'''
Authors: <NAME>, <NAME>.
Copyright:
Copyright (c) 2020 Microsoft Research
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, ... |
import flask
from flask import render_template, request, url_for, redirect, session
import json
import logging
import urllib
# Date/time and timezone handling
import arrow # Replacement for datetime, based on moment.js
from dateutil import tz # For interpreting local times
# OAuth2 - Google library implementation... |
"""Functions for building the face recognition network.
"""
# MIT License
#
# Copyright (c) 2016 <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 with... |
from __future__ import division, unicode_literals, absolute_import
import numpy as np
import signal
import tracemalloc
import os
import logging
logger = logging.getLogger(__name__)
import dynesty
from dynesty.utils import unitcheck
from ..utils import estimate_nmcmc, list_2_dict
from ...pipe import data_container, ... |
#!/usr/bin/python3
from datetime import date, datetime, timedelta
from flask import Flask,request,send_file
from subprocess import call
import os
import pygame
import requests
app = Flask(__name__)
workDir = os.path.dirname(os.path.abspath(__file__))
tempSymbol = os.path.join(workDir, 'images' ,"temp.png")
humiSymbo... |
import numpy as np
import tensorflow as tf
from scipy.ndimage.interpolation import map_coordinates
from scipy.interpolate import interp2d
from itertools import product
from PIL import Image
from multiprocessing import cpu_count
from segmentpy.tf114.augmentation import random_aug
from segmentpy.tf114.filter import *
fro... |
import logging
import pandas as pd
from sistr.src.blast_wrapper import BlastReader
from sistr.src.serovar_prediction.constants import \
FLJB_FASTA_PATH, \
FLIC_FASTA_PATH, \
H2_FLJB_SIMILARITY_GROUPS, \
H1_FLIC_SIMILARITY_GROUPS, \
WZY_FASTA_PATH, \
WZX_FASTA_PATH, \
SEROGROUP_SIMILARITY_GR... |
# coding: utf8
""" Cog content generation tool.
http://nedbatchelder.com/code/cog
Copyright 2004-2021, <NAME>.
"""
from __future__ import absolute_import, print_function
import copy
import getopt
import glob
import hashlib
import linecache
import os
import re
import shlex
import sys
import traceback
from .b... |
#
# Copyright The NOMAD Authors.
#
# This file is part of NOMAD.
# See https://nomad-lab.eu for further info.
#
# 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/lic... |
"""
Processor for parsing information from the imdb datafiles available from:
http://www.imdb.com/interfaces
Information courtesy of IMDb (http://www.imdb.com).
Used with permission: http://www.imdb.com/help/show_leaf?usedatasoftware
"""
import re
import locale
import textwrap
import os.path
import operator
import sy... |
import os
import re
import shlex
import numpy as np
import pandas as pd
from scipy.io import mmread, mmwrite
from scipy.sparse import csr_matrix
import tempfile
import subprocess
from typing import List, Dict, Tuple, Union
import logging
logger = logging.getLogger(__name__)
from pegasusio import UnimodalData, CITESeq... |
#!/usr/bin/python
# Copyright: (c) 2020, DellEMC
""" Ansible module for managing Filesystem Snapshots on Unity"""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'suppo... |
"""
Module for processing and handling replays
"""
# Todo move into module
import asyncio
import lzma
from base64 import b64decode, b64encode
from io import StringIO
import bezier
import numpy as np
import pandas as pd
import requests
class DegenerateTriangle(Exception):
pass
def lzma_replay_to_df(lzma_byte_s... |
# -*- coding: utf-8 -*-
# Copyright © tandemdude 2020-present
#
# This file is part of Lightbulb.
#
# Lightbulb is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at ... |
import string
from scml.nlp import (
RepeatingCharacter,
RepeatingSubstring,
collapse_whitespace,
count_alpha,
count_digit,
count_punctuation,
count_space,
count_upper,
emoji_shortcode_to_text,
has_1a1d,
ngrams,
sentences,
split,
strip_ip_address,... |
"""
Copyright 2017 Inmanta
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 ... |
from SolutionDrawer import SolDrawer
from VRP_Model import *
class Solution:
def __init__(self):
self.cost = 0.0
self.routes = []
class RelocationMove(object):
def __init__(self):
self.originRoutePosition = None
self.targetRoutePosition = None
self.origi... |
# -*- coding: utf-8 -*-
from django.shortcuts import render
from django.shortcuts import redirect
from django.http import JsonResponse
from django.http import HttpResponseForbidden, HttpResponse
#log
import sys
import traceback
#hash
import math
import random
#time
import pytz
import datetime
#rest
from rest_frame... |
import pandas as pd
import propylean.properties as prop
from propylean import streams
# _material_stream_equipment_map and __energy_stream_equipment_map are dictionary of list
# which store index of coming from and going to equipment and type of equipment.
# Structured like {12: [10, CentrifugalPump, 21, PipeSegment... |
from dataclasses import dataclass
from typing import List, Union, Optional, Tuple
import numpy
from .solver import Solver
from .solver_interface.solver_interface_utils import SolverOutput
from .utils.chebyshev_ball import chebyshev_ball
from .utils.constraint_utilities import constraint_norm, is_full_rank, \
dete... |
# Copyright (c) 2018 <NAME>.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Any, cast, Optional, Set, Tuple, Union
from UM.FileHandler.FileHandler import FileHandler
from UM.FileHandler.FileWriter import FileWriter # To choose based on the output file mode (text vs. binary).
from UM.F... |
'''
@author <NAME>, <NAME>, <NAME>, <NAME>
@date 30.03.2015
@brief module for generating & matching particle distributions
'''
import numpy as np
from scipy.constants import e, c
from PyHEADTAIL.general.element import Printing
from PyHEADTAIL.particles.particles import Particles
from PyHEADTAIL.particles.rfbucket_m... |
import uuid
import numpy as np
import pyqtgraph.functions as fn
import pyqtgraph.graphicsItems.ROI as pgROI
from pyqtgraph.Point import Point
from pyqtgraph.Qt import QtCore, QtGui, USE_PYSIDE
from .custom_pyqtgraph_items import QMenuCustom
__all__ = ['ROI', 'Handle','PolylineSegment','RectROIcustom','PolyLineROIcus... |
##############################################################################
# EVOLIFE www.dessalles.fr/Evolife <NAME> #
# Telecom ParisTech 2014 www.dessalles.fr #
##############################################################################
################... |
"""Class to handle S-parameters."""
import numpy as np
from numpy.linalg import inv
from numpy import diag, sqrt, identity, matmul, iscomplex
import matplotlib.pyplot as plt
from copy import deepcopy as copy
from rftools.parameters import *
class Network(object):
"""Class to handle S-parameters.
Args:
... |
from math import gcd
from ..utils.math import cartesian
import numpy as np
import warnings
import copy
from .array_elements import ISOTROPIC_SCALAR_SENSOR
from .perturbations import LocationErrors, GainErrors, PhaseErrors, \
MutualCoupling
class ArrayDesign:
"""Base class for all array d... |
from typing import Any, Dict, List, Tuple
import numpy as np
__version__ = "0.0.1"
class DataFrame:
def __init__(self, data: Dict) -> None:
"""A DataFrame holds tabular data organized by index and columns.
Create it by passing a dictionary of NumPy arrays to the values
parameter.
... |
from __future__ import print_function
import time
import os
import glob
import numpy
import math
from scipy.fftpack import fft
from scipy.fftpack.realtransforms import dct
import matplotlib.pyplot as plt
from featureExtract import utilities
from scipy.signal import lfilter
import random
eps = 0.00000001
""" Time-dom... |
# Partially inspired by https://github.com/jordiae/DeepLearning-MAI
import torch
import logging
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import time
import argparse
from utils import load_architecture, evaluate
from training.covid_torch_dataset import CovidDataset, Covid... |
#!/usr/bin/env python
"""Create a bokeh dashboard with customJS callbacks for interactivity"""
import pandas as pd
from bokeh.layouts import row, column, layout, gridplot, widgetbox
from bokeh.models import (CustomJS, RangeSlider, HoverTool, Range1d,
CheckboxGroup, CheckboxButtonGroup, Sele... |
import argparse
import time
import csv
import datetime
from pathlib import Path
import numpy as np
import torch
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import models
import custom_transforms_mono as T
import utils
from radar_eval.eval_utils import getTraj
from datasets.sequenc... |
#!/usr/bin/env python
# coding: utf-8
import os, sys
import subprocess
from math import pi
import numpy as np
from collections import OrderedDict, defaultdict
import tempfile
import datetime
import hashlib
import textwrap
from PIL import Image, ImageDraw, ImageFont
import logging
import functools
import fnmatch
import... |
import numpy as np
import tensorflow as tf
from BeamSearch import BeamSearch
from BeamSearch_Poisson import BeamSearch_Poisson
from LengthModule import LengthModule
import glob
import os
from keras.utils import np_utils
from keras.optimizers import rmsprop
from keras.models import load_model
import metrics
import Visua... |
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os
import tensorflow as tf
import numpy as np
import time
import mnist_model
import itertools
from skimage import io, data
import argparse
try:
import matplotlib.pyplot as plt
except:
print('Ca... |
"""Representation base class."""
from abc import ABC, abstractmethod
from copy import deepcopy
import logging
import numpy as np
from rlpy.tools import bin2state, closestDiscretization, hasFunction, id2vec, vec2id
import scipy.sparse as sp
from .value_learner import ValueLearner
__copyright__ = "Copyright 2013, RLPy h... |
#!/usr/bin/python3
"""
Discover
This is a console application to assist with the "discovery" process of finding
BACnet routers, devices, objects, and property values. It reads and/or writes
a tab-delimited property values text file of the values that it has received.
The console commands are:
wirtn - who... |
# only functions to generate, load, save, check itp..
from random import randint
from math import log
import inspect
import os
import sys
import pickle
from .__tools_single import __cre_rotor, __save_rotor, __load_rotor, __check_rand_rotor, generate_from_64b_inter_key, \
bcolors
from .core import EncryptNextRotor, ... |
from collections import OrderedDict
import periodictable as pdtb
import lmfit as lm
r_e = pdtb.constants.electron_radius * 1e10 # classical electron radius, in A
N_A = pdtb.constants.avogadro_number # Avogadro number, unitless
k_B = 1.38065e-23 # Boltzman constant, in J/K
import numpy as np
import scipy.stats as s... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2020-2022 Barcelona Supercomputing Center (BSC), Spain
#
# 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... |
#!/usr/bin/env python
# coding=utf8
# This code is adapted from the https://github.com/tensorflow/models/tree/master/official/r1/resnet.
# ==========================================================================================
# NAVER’s modifications are Copyright 2020 NAVER corp. All rights reserved.
# ============... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import numpy as np
from .Node import Op
from .. import ndarray
from ..stream import *
from ..logger import Logger
from .._base import get_array_memory
from athena.gpu_ops.Conv2d import Conv2dOp, Conv2d_Gradient_of_DataOp, Conv2d_Gradient_of_FilterOp
from at... |
#Main
#<NAME>
#aqui se guardan los puntajes de cada seccion
puntos_mate = 0
puntos_cien = 0
puntos_esp = 0
def main():
print('Bienvenido a tu examen prueba')
print('Se desplegarán ciertos menus a elegir, selecciona la seccion que quieras realizar:')
print('\nMENU')
print('\n1. MATEMATICAS')
pri... |
import scine_utilities as su
import scine_molassembler as masm
import scine_database as db
import sys
import numpy as np
import random
import glob
from typing import Optional, Tuple, List, Iterable, Dict, Callable, Union
from functools import partial
from collections import defaultdict
from householding import House... |
import numpy as np
import tensorflow as tf
from typing import Union
import unittest
import tcellmatch.api as tm
class _TestFfn_Base(unittest.TestCase):
# DEFINE THESE PATHS TO RUN UNIT TESTS
fn_tmp = "."
indir = "."
def _test_ffn(
self,
model,
chains,
... |
import yaml
from tempfile import NamedTemporaryFile
from StringIO import StringIO
from ConfigParser import ConfigParser
from django.contrib.auth import authenticate
from django.core.management.base import CommandError
from go.base.tests.helpers import GoDjangoTestCase, DjangoVumiApiHelper
from go.base.management.com... |
import numpy as np
import networkx as nx
import collections
import itertools
from itertools import chain
import copy
import matplotlib.pyplot as plt
class Plane(object):
def __init__(self, coefficients):
assert isinstance(coefficients, np.ndarray), "Expected type ndarray, got %s instead" % type(coeffici... |
#! /usr/bin/env python3
# coding=utf-8
# Copyright 2018 The Uber AI Team 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... |
"""Sets-up and tears-down configuration used for testing."""
import json
import os
import re
import secrets
import urllib.parse
from typing import List
from typing import Tuple
import httpx
import pytest
import respx
import graph_onedrive
# Set the variables used to create the OneDrive instances in tests
# Warning:... |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext import get_company_currency, get_default_company
from erpnext.accounts.report.utils import get_currency, convert_to_presentat... |
if __name__ == '__main__' and __package__ is None:
from os import sys
sys.path.append('../')
import os,json,trimesh, argparse
import open3d as o3d
import numpy as np
from pathlib import Path
from tqdm import tqdm
from utils import util_ply, util_label, util, define
from utils.util_search import SAMPLE_METHODS,f... |
# -*- coding: utf-8 -*-
"""This module provides alternative implementations of array
classes defined in the :mod:`allel.model.ndarray` module, using
`dask.array <http://dask.pydata.org/en/latest/array.html>`_ as the
computational engine.
Dask uses blocked algorithms and task scheduling to break up work into
smaller pi... |
# Copyright 2018 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 applica... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=wrong-import-position, redefined-outer-name, range-builtin-not-iterating
"""
Extract information on events from an i3 file needed for running Retro Reco.
"""
from __future__ import absolute_import, division, print_function
__author__ = '<NAME>, <NAME>'
... |
from sqlalchemy import Sequence, ForeignKey
from sqlalchemy import Column, Integer, BigInteger, String, DateTime
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
# 创建数据表基类
Base = declarative_base()
# 成员表
class User(Base):
__tablename__ = 'users'
__ta... |
import torch.nn.functional as F
import torch
import logging
import torch.nn as nn
import numpy as np
import time
from torch.autograd import Variable
__all__ = ['sigmoid_dice_loss','softmax_dice_loss','GeneralizedDiceLoss','FocalLoss','dice','CE_loss','bce_loss','IOU_loss','TverskyLoss','SSIM']
cross_entropy... |
# Copyright (c) 2017 <NAME>
# http://www.alexsocha.com/pynode
from pynode.src import pynode_core
import random
def pause(time):
pynode_core.add_event(pynode_core.EventPause(time))
def delay(func, time, args=[], repeat=False):
def execute():
pynode_core.execute_function(func, args)
if re... |
"""
train on GAN-CS
example
export CUDA_VISIBLE_DEVICES=0
python srez_main.py --dataset_input /home/enhaog/GANCS/srez/dataset_MRI/phantom \
--dataset_output /home/enhaog/GANCS/srez/dataset_MRI/phantom \
--run train \
--gene_mse_factor 1.0
python3 srez_main.... |
"""
Notes:
心得:
1. dataset定义处,如果要用torchvision,最好转为Image, 不然容易出错
2. 网络定义处,最好写一个warmup来获得分类层这类和输入图像大小有关的数据
3. 使用decrease learning rate的时候,需要加载最优的模型
4. decrease learning rate的时候,平原的判定需要稳定一些,可以利用一个队列
5. 使用logger的时候最好写一个hook决定是print还是log
6. 写网络的时候多用用AvgPool2D
7. 跑实验... |
# author: github/zabir-nabil
# relevant imports
import os
import cv2
import pydicom
import pandas as pd
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
# torch dataset
import torch
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
import random... |
#!/usr/bin/python3 -u
import abc
import collections
import email.utils
import functools
import inspect
import json
import os
import pickle
import signal
import socket
import subprocess
import sys
import threading
import time
import traceback
import urllib.error
import urllib.parse
import urllib.request
from datetime im... |
# -*- coding: utf-8 -*-
"""
@author: sebi
PSF_XYZ_Dialog_BF.py
Version: 1.5
Date: 2015-11-02
This program can be used to detect beads an measures the FWHM-XYZ of the PSF.
The crucial steps are:
* Read the z-stack via BioFormats using python-bioformats.
* Define detection parameters for the selected channel.
... |
import threading
import re
import datetime
import LogAnalyzeDBOps as db
import Messages as MSG
import datetime
logonID = '0x785E60E' # Admin actions
linkedLogonID = '0x78B8C4B' # Other actions
# logonID = '0x78B8C68' # Admin actions
# linkedLogonID = '0x78B8C4B' # Other actions
# logonID = '0x1E6C1F95' # Admin actio... |
#!/usr/bin/env python
# stcflash Copyright (C) 2013 laborer (<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 of the License, or
# (at your option) any later version... |
"""Files, symbolic links, operating system utilities."""
import os
import re
import sys
import unicodedata
from argparse import ArgumentTypeError
from functools import partial
from pathlib import Path
from shlex import split
from subprocess import PIPE, run
from time import sleep
from typing import Any, List, Optional,... |
#!/usr/bin/env python3
"""Bulk query client for Salesforce."""
import argparse
import functools
import json
import logging
import pathlib
import sys
import tempfile
import time
import typing
import urllib.error
import urllib.parse
import urllib.request
from email.message import Message
from http.client import HTTPResp... |
from pandas_datareader import data
import matplotlib.pyplot as plt
import pandas as pd
import datetime as dt
import urllib.request, json
import os
import numpy as np
import tensorflow as tf # This code has been tested with TensorFlow 1.6
from sklearn.preprocessing import MinMaxScaler
from PIL import Image
code_file = ... |
import xml.etree.ElementTree as ET
import glob
import argparse
import numpy as np
import multiprocessing
from multiprocessing import Pool, Process, Queue, freeze_support, RLock
from multiprocessing.pool import ThreadPool
import sys
import shutil
import os
import re
import zlib
import pdb
import time
import copy
import ... |
# -*- coding: UTF-8 -*-
# Copyright 2011-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
import six
import sys
from datetime import datetime
from django.db.models import Q
from django.conf import settings
from django.db.models import Count
from django.contrib.humanize.templatetags.humanize import n... |
# #-encoding: utf-8
# Algoritmo genético TFG
# Cada cromosoma es una lista de números que representa
# la siguiente información:
# - La información de cada profesor se almacena durante 8*5 posiciones
# de la lista, siendo 5 el numero de dias de la semana laboral
#
# - Cada posición de la lista se corresponde c... |
"""
The MIT License (MIT)
Copyright (c) 2021-Present AbstractUmbra
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, modif... |
# -*- coding: utf-8 -*-
"""
Aquí vamos a meter todo lo relativo a la representación de las variables
de decisión así como la población (Punto, Poblacion, funciones de mutación,
funciones de cruce, funciones de selección)
"""
import numpy as np
from Estadisticas import Estadisticas
class Punto(np.ndarray):
... |
import ctypes
import os
import sys
import logging
from . import timer
from .exit import has_exit_hooks, invoke_exit_callbacks
from .globs import (DEFAULT_BASIC_BLOCK_LIMIT,
DEFAULT_FUZZ_CONSUMPTION_TIMEOUT, DEFAULT_MAX_INTERRUPTS,
FUZZ_MODES, TRIGGER_MODES)
from .mmio_models.wr... |
from time import time
import cv2
import numpy as np
from scene import Scene
from light import Light
from camera import Camera
from game_object import GameObject
def triangle_area(v0, v1, v2):
"""
| v01[0] v01[1] |
| v02[0] v02[1] | = v01[0]*v02[1] - v01[1]*v02[0]
"""
return (v1[0]-v0[0])*(v2[1]-... |
import discord
import json
import asyncio
from discord.ext import commands
from filehandler import FileHandler
from jsonhandler import JsonHandler
jh = JsonHandler()
fh = FileHandler()
class InventoryCommandS(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.load_data()
def load_da... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.