text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
export ft,ift, rft, irft export ffts, ffts!, iffts, rffts, irffts export fft2d,ifft2d, rfft2d, irfft2d export ft2d,ift2d, rft2d, irft2d export ffts2d, ffts2d!, iffts2d, rffts2d, irffts2d """ optional_collect(a) Only collects certain arrays, for a pure `Array` there is no collect and it returns simply `a`. """ # c...
{"hexsha": "bacd514e8389a88abb1559aba8289f0359c4d92d", "size": 9618, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/fft_helpers.jl", "max_stars_repo_name": "bionanoimaging/FourierTools.jl", "max_stars_repo_head_hexsha": "c8a37c8f38b0b9897fac2be1bf3c1e109f844964", "max_stars_repo_licenses": ["MIT"], "max_star...
""" Gripper for Franka's Panda (has two fingers). """ import numpy as np from envs.robosuite.robosuite.utils.mjcf_utils import xml_path_completion from envs.robosuite.robosuite.models.grippers.gripper_model import GripperModel class PandaGripperBase(GripperModel): """ Gripper for Franka's Panda (has two finge...
{"hexsha": "9901a106da8f26652949a6f97053e205deec9fac", "size": 1758, "ext": "py", "lang": "Python", "max_stars_repo_path": "envs/robosuite/robosuite/models/grippers/panda_gripper.py", "max_stars_repo_name": "hzm2016/assistive-gym-robosuite", "max_stars_repo_head_hexsha": "5c529f4444cc386383618bfa584341740a8468f9", "max...
[STATEMENT] lemma Stirling_2: "Stirling (Suc n) (Suc (Suc 0)) = 2 ^ n - 1" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Stirling (Suc n) (Suc (Suc 0)) = 2 ^ n - 1 [PROOF STEP] using Stirling_2_2 [PROOF STATE] proof (prove) using this: Stirling (Suc (Suc ?n)) (Suc (Suc 0)) = 2 ^ Suc ?n - 1 goal (1 subgoal): 1. St...
{"llama_tokens": 209, "file": null, "length": 2}
import cv2 import numpy as np class Ghost(object): def __init__(self): self.mask = None self.hist = None def update(self, partition, mask): self.mask = mask hist = cv2.calcHist([partition], [0], mask, [16], [0, 180]) cv2.normalize(hist, hist, 0, 255, cv2.NORM_MINMAX) ...
{"hexsha": "423e53029490c49f21e10b018f284b75bba88b37", "size": 908, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/libhistogram/modules.py", "max_stars_repo_name": "andyfangdz/Spectre", "max_stars_repo_head_hexsha": "1010c0dd24d4a7e34e7b9215a23cae3835107bfa", "max_stars_repo_licenses": ["BSD-2-Clause"], "ma...
from __future__ import print_function import click from dicto import click_options_config, Dicto import gym import tensorrl as trl import tensorflow as tf import tfinterface as ti import numpy as np from rl.policy import EpsGreedyQPolicy, BoltzmannQPolicy, MaxBoltzmannQPolicy from rl.memory import SequentialMemory ...
{"hexsha": "f16f4db57fdf091a4b9bbbfe94596a67b24597ce", "size": 2730, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/cartpole_dqn.py", "max_stars_repo_name": "cgarciae/tensorrl", "max_stars_repo_head_hexsha": "aab1a39b509a6f4d3134ba97a6a32f0833ca559a", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
function r8blt_print ( n, ml, a, title ) %*****************************************************************************80 % %% R8BLT_PRINT prints a R8BLT matrix. % % Discussion: % % The R8BLT storage format is appropriate for a banded lower triangular matrix. % The matrix is assumed to be zero below the ML-th s...
{"author": "johannesgerer", "repo": "jburkardt-m", "sha": "1726deb4a34dd08a49c26359d44ef47253f006c1", "save_path": "github-repos/MATLAB/johannesgerer-jburkardt-m", "path": "github-repos/MATLAB/johannesgerer-jburkardt-m/jburkardt-m-1726deb4a34dd08a49c26359d44ef47253f006c1/linplus/r8blt_print.m"}
# sbf_load.jl # # Load an SBF binary file, converting as much as possible in the process # # Jeremy Rüffer # Thünen Institut # Institut für Agrarklimaschutz # Junior Research Group NITROSPHERE # Julia 1.6.1 # 25.01.2018 # Last Edit: 22.07.2021 # A Labview string will have a four byte dimension array before the actua...
{"hexsha": "7e18ba001017bbaf595064a9798ce9ef46559263", "size": 11012, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sbf_load.jl", "max_stars_repo_name": "JeremyRueffer/StofffluesseAG.jl", "max_stars_repo_head_hexsha": "b26593b07fd6b2aa8c46bf8c73d9187422a7c463", "max_stars_repo_licenses": ["MIT"], "max_stars...
####Please do not remove lines below#### from lmfit import Parameters import numpy as np import sys import os sys.path.append(os.path.abspath('.')) sys.path.append(os.path.abspath('./Functions')) sys.path.append(os.path.abspath('./Fortran_routines')) from functools import lru_cache ####Please do not remove lines above#...
{"hexsha": "bdee8b2aec992ef6a45fc0a6ed13d95b4df13155", "size": 18983, "ext": "py", "lang": "Python", "max_stars_repo_path": "Functions/ASAXS/Disk_Uniform.py", "max_stars_repo_name": "chemmatcars/XModFit", "max_stars_repo_head_hexsha": "7d1298448d1908d78797fd67ce0a00ecfaf17629", "max_stars_repo_licenses": ["MIT"], "max_...
#!/usr/bin/env python import numpy as np #paths dataset = "/home/vglasov/datasets/L_CAS_3D_Point_Cloud_People_Dataset/3D Point Cloud People Dataset/" synthetic_dataset = "/home/vglasov/datasets/L_CAS_3D_Point_Cloud_People_Dataset/Synthetic 3D Point Cloud People Dataset/" #Lidar image spec eps = 1e-6 shape = (16, 384...
{"hexsha": "e9a402234cd03a82f841225d29b3a093f891c680", "size": 529, "ext": "py", "lang": "Python", "max_stars_repo_path": "config.py", "max_stars_repo_name": "gla-seva/LU-Net-pytorch", "max_stars_repo_head_hexsha": "30eb6aadc6ff4634f22286f598d2deef319161e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma...
from itertools import product import numpy as np import pylab import pf.io class Cache(object): '''Simple cache for solutions.''' def __init__(self): self.cache = {} def get(self, name): if name not in self.cache: self.cache[name] = np.load(name) return self.cache[name] def step_iter_level...
{"hexsha": "e91e61fccb82e45cb44fc5bd7aa480bf1304e66d", "size": 2757, "ext": "py", "lang": "Python", "max_stars_repo_path": "pf/convergence.py", "max_stars_repo_name": "schreiberx/LibPFASST", "max_stars_repo_head_hexsha": "7b5ea651df16d190e335c12f3b15b8d231418e02", "max_stars_repo_licenses": ["BSD-3-Clause-LBNL"], "max_...
from typing import Literal, Optional from attr import attrs import numpy as np import pandas as pd import scipy.stats from statsmodels.stats.multitest import multipletests # coverage_df : DF region_id // db1 db2 ... # fg_bg_freqs_df: DF fgset_name1 [fgset_name2 ...] db_name // fg_in_db fg_not_db bg_in_db bg_not_db # ...
{"hexsha": "a2da042c20f5e9049d7922e45e99e62c39585f6e", "size": 10892, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/region_set_profiler/enrichment_new_api.py", "max_stars_repo_name": "stephenkraemer/regionset_profiler", "max_stars_repo_head_hexsha": "f4597f025688982827a6b56a49ad92f23d61897c", "max_stars_re...
# Lecture 2: Integral equations/quadratures ## Previous lecture - Intro - IE for external problems ## Todays lecture - IE discretization - Nystrom, collocation, Galerkin method ## Simplest integral equation The simplest integral equation we talked about reads $$\int_{\partial \Omega} \frac{q(y)}{\Vert x - y \Vert}...
{"hexsha": "a1deb462fc4b8a50b4a2f05dc2c22ffb7a754e51", "size": 92078, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "lectures/Lecture-2.ipynb", "max_stars_repo_name": "oseledets/fastpde2017", "max_stars_repo_head_hexsha": "8b4e6d51c00dae158ab73440d266cda62fc59b40", "max_stars_repo_licenses": ["MIT"...
"""A class that simplifies creating and updating state-space models as well as designing controllers for them. """ import control as cnt import frccontrol as frccnt import matplotlib.pyplot as plt import numpy as np from . import dlqr from . import kalmd from . import system_writer class System: def __init__(sel...
{"hexsha": "1a0e27d597557ccfdf72900a88d2d0aab4589138", "size": 12211, "ext": "py", "lang": "Python", "max_stars_repo_path": "frccontrol/system.py", "max_stars_repo_name": "Dwopplee/frccontrol", "max_stars_repo_head_hexsha": "8dac9373515697a6d7d92bd0d267fb4c156677cb", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st...
""" Shader001: Shader example using raw OpenGL api, per vertex attribute per buffer, raw OpenGL API. """ import ctypes from bk7084 import app, gl, Window, ShaderProgram, VertexShader, PixelShader import numpy as np vertex_src = """ #version 330 core layout (location = 0) in vec3 in_position; layout (location = 1)...
{"hexsha": "f0354b5e13d1327f482cf0e71d6f97d3a6c8d667", "size": 1978, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/shader001.py", "max_stars_repo_name": "bk7084/framework", "max_stars_repo_head_hexsha": "c364174409c63dbee90e36d8b08fde17df482e8c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c...
# from scipy.optimize import fmin_l_bfgs_b import numpy as np import matplotlib.pyplot as plt from sympy import derive_by_array, exp, lambdify, log, Piecewise, symbols class HawkesN: def __init__(self, history): """ Parameters ---------- history : sympy.Array Array con...
{"hexsha": "5fc0f6a5424465ba495c34fe7e2983b5a557dbab", "size": 12214, "ext": "py", "lang": "Python", "max_stars_repo_path": "py_hawkesn_sir/py_hawkesn_sir/hawkesn_seir_sympy.py", "max_stars_repo_name": "yogabonito/seir_hawkes", "max_stars_repo_head_hexsha": "c632d7faabea396a91c80e2941d5b93232b64b3b", "max_stars_repo_li...
import numpy as np from metadrive.component.lane.circular_lane import CircularLane from metadrive.component.road_network.edge_road_network import EdgeRoadNetwork from metadrive.component.vehicle_navigation_module.base_navigation import BaseNavigation from metadrive.utils import clip, norm from metadrive.utils.scene_ut...
{"hexsha": "9f2429999ef46c4fadadfea2b9578e174e43087c", "size": 9464, "ext": "py", "lang": "Python", "max_stars_repo_path": "metadrive/component/vehicle_navigation_module/edge_network_navigation.py", "max_stars_repo_name": "liuzuxin/metadrive", "max_stars_repo_head_hexsha": "850c207536531bc85179084acd7c30ab14a66111", "m...
""" predict_incidence_and_prev(;pred_incidence::Vector{Float64}, pred_hospitalisations::Vector{Float64}, pred_deaths::Vector{Float64}, symptomaticrate::Float64, prop_critical::Float64, p_IS::Vector{Float64}...
{"hexsha": "91de57caba422e3986e1aebd2cedba12126499c9", "size": 16181, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/outcomes.jl", "max_stars_repo_name": "SamuelBrand1/KenyaCoVaccines", "max_stars_repo_head_hexsha": "d1ece7ec6fa91b0013fe3ba61e0429fb014f4233", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
from sympy.core.singleton import S from sympy.core.symbol import Symbol from sympy.core.logic import fuzzy_and, fuzzy_bool, fuzzy_not, fuzzy_or from sympy.core.relational import Eq from sympy.sets.sets import FiniteSet, Interval, Set, Union, ProductSet from sympy.sets.fancysets import Complexes, Reals, Range, Rationals...
{"hexsha": "cc23e8bf56f1743cd7f08452dd09a0acf981f5da", "size": 4739, "ext": "py", "lang": "Python", "max_stars_repo_path": "sympy/sets/handlers/issubset.py", "max_stars_repo_name": "utkarshdeorah/sympy", "max_stars_repo_head_hexsha": "dcdf59bbc6b13ddbc329431adf72fcee294b6389", "max_stars_repo_licenses": ["BSD-3-Clause"...
import numpy import time import warnings try: from scipy import io except ImportError: warnings.warn("couldn't import scipy") import theano from theano import config import theano.tensor as T from pylearn2 import rbm_tools from pylearn2.models import rbm def load_rbm_params(fname): mnistvh = io.loadmat(...
{"hexsha": "bd0ba6777b14dcae00c6d1ac65c2895bd0de8866", "size": 2575, "ext": "py", "lang": "Python", "max_stars_repo_path": "pylearn2/tests/rbm/test_ais.py", "max_stars_repo_name": "skearnes/pylearn2", "max_stars_repo_head_hexsha": "3b5024846e8be6493c04f55771f62b66254d7418", "max_stars_repo_licenses": ["BSD-3-Clause"], ...
# Contains all of the reference functions used in different notebooks # (prototyping of these functions present in Reference.ipynb) # imports import pandas as pd import matplotlib import matplotlib.pyplot as plt import numpy as np import seaborn as sns # Reference function 1 # get_file_names(col_names,...
{"hexsha": "83b27c278f4da9a409b7c66ab834b49a37b00598", "size": 2550, "ext": "py", "lang": "Python", "max_stars_repo_path": "reference.py", "max_stars_repo_name": "ryflect/cs692r-hospice", "max_stars_repo_head_hexsha": "7054d5c6394962e94b87b6d44572f6136f1d669e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul...
from notion.client import NotionClient import numpy as np import pandas as pd __all__ = ['CollectionExtract'] class CollectionExtract: def __init__(self, token_v2): r""" Args url: copy your token """ self.client = NotionClient(token_v2=token_v2) def table_extract(s...
{"hexsha": "4cb2998671f4f06cd3fedf05d7c686ee3745f0a0", "size": 2391, "ext": "py", "lang": "Python", "max_stars_repo_path": "notionist/collection_api.py", "max_stars_repo_name": "TooTouch/notionist", "max_stars_repo_head_hexsha": "d3e78e0656301adfbf2a52f7fc8edf36ac2cc596", "max_stars_repo_licenses": ["Apache-2.0"], "max...
import json import os import sys import time import numpy as np import boto3 sys.path.append("/opt/pooled-cell-painting-lambda") import run_DCP import create_batch_jobs import helpful_functions s3 = boto3.client("s3") sqs = boto3.client("sqs") metadata_file_name = "/tmp/metadata.json" fleet_file_name = "stitchFleet....
{"hexsha": "11ede80fb24122cdf49df18438a922869e5b14af", "size": 4004, "ext": "py", "lang": "Python", "max_stars_repo_path": "lambda_python3/PCP-8-BC-Stitching/lambda_function.py", "max_stars_repo_name": "megaman727/pooled-cell-painting-image-processing", "max_stars_repo_head_hexsha": "bcee2e08f78849398a364d98cc8efde024f...
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2018-2020 azai/Rgveda/GolemQuant # # 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...
{"hexsha": "1a263ff426daa778ab4228cf9e1bec650e25b0e4", "size": 6890, "ext": "py", "lang": "Python", "max_stars_repo_path": "996Quant-master/chapter_04/l03_top1700_60min_download_jqdatasdk.py", "max_stars_repo_name": "wangdecheng/QAStrategy", "max_stars_repo_head_hexsha": "d970242ea61cff2f1a6f69545dc7f65e8efd1672", "max...
/* * Copyright (C) 2015 Open Source Robotics Foundation * * 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 appl...
{"hexsha": "0131c864537ce8a09d43d2b30755ccbe0ed2dee8", "size": 3840, "ext": "cc", "lang": "C++", "max_stars_repo_path": "gazebo/physics/dart/DARTFixedJoint.cc", "max_stars_repo_name": "devrt/gazebo-mirror", "max_stars_repo_head_hexsha": "16589c29302bfec51079f62dd247864be54b71d3", "max_stars_repo_licenses": ["ECL-2.0", ...
# Configuation class for ah domains in HOOMD # XXX: Maybe make a dataclass in the future import hoomd import hoomd.md as md import gsd.hoomd import itertools import os import random import sys import yaml import numpy as np # Magic to get the library directory properly sys.path.append(os.path.join(os.path.dirname(__...
{"hexsha": "107aa6a46b4520de299598732f5cc3cec0e72eb0", "size": 2045, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/septins/ahdomain.py", "max_stars_repo_name": "cedelmaier/dragonfruit", "max_stars_repo_head_hexsha": "01d5b8c2b329661c8addd0ca0d0c6fb099212608", "max_stars_repo_licenses": ["MIT"], "max_stars_...
import numpy as np import matplotlib.pyplot as plt import torch import matplotlib def catlist(df, var, cats, scale=1): return [df.loc[df.category == cat, var] * scale for cat in cats] def output_distribution(df, net, X, cut_overlay=None, mass_range=None, ylim=None, bkgs=[], norm='log'): y_score = net(torch....
{"hexsha": "3d37e5101f9b243d323b3f94ff00eec7ec635ad2", "size": 1429, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/punzinet/plot.py", "max_stars_repo_name": "feichtip/punzinet", "max_stars_repo_head_hexsha": "8dd9845d79873a56a5b0589f6449ffa2eaa8fc25", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
if Sys.islinux() py""" import tensorflow as tf import socket if socket.gethostname() != "Dolores": libFwiOp = tf.load_op_library('../Ops/FWI/build/libFwiOp.so') else: libFwiOp = tf.load_op_library('../Ops/FWI/build_dolores/libFwiOp.so') @tf.custom_gradient def fwi_op(λ,μ,ρ,s...
{"hexsha": "a87349413fd22169a5eb46083d1398d94e919776", "size": 2036, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/codes/src_fwi_pgs/fwi_util_op.jl", "max_stars_repo_name": "ziyiyin97/FwiFlow.jl", "max_stars_repo_head_hexsha": "a7f16b7585524fdbc44b44050d6d7f7ad2ab204b", "max_stars_repo_licenses": ["MIT"], ...
# coding=utf-8 # Copyright 2022 The Balloon Learning Environment 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 require...
{"hexsha": "b7f6545f30ed974c11a0416ae2cd22748c17e060", "size": 7880, "ext": "py", "lang": "Python", "max_stars_repo_path": "balloon_learning_environment/generative/vae.py", "max_stars_repo_name": "johannah/balloon-learning-environment", "max_stars_repo_head_hexsha": "cdb2e582f2b03c41f037bf76142d31611f5e0316", "max_star...
import os import time import numpy as np from IPython.display import clear_output sourceDir="//home/czy/DataSet/bluerpic20191227/Skybox" sourceMaskDir = "/home/czy/DataSet/bluerpic20191227/Syn" #trainDir validationDir testDir targetDir=["./traindir32000", "./validatedir4000", "./testdir4000"] Mask...
{"hexsha": "cfd19ee573f8bb9cee0e1885ebd0ac6de4c3fa06", "size": 1647, "ext": "py", "lang": "Python", "max_stars_repo_path": "MyNet/Split.py", "max_stars_repo_name": "chenzeyin9867/Deep-Light", "max_stars_repo_head_hexsha": "4f137d611fed33ca809d29d714b9e5b93566edd6", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import numpy as np from . import AuxReward class ConstantReward(AuxReward): """Constant auxiliary reward.""" def __init__(self, constant_reward): self._reward = constant_reward def __call__(self, obs, action, env_reward): return self._reward
{"hexsha": "0911d4e1e4d7a603db69b977b87307fe0fa7d071", "size": 274, "ext": "py", "lang": "Python", "max_stars_repo_path": "graph_rl/aux_rewards/constant_reward.py", "max_stars_repo_name": "nicoguertler/graphrl", "max_stars_repo_head_hexsha": "21a1cefc53e5c457745570460de0d99e68622e57", "max_stars_repo_licenses": ["MIT"]...
import numpy as np import collections word_dict = None word_list = None _pad = "<pad>" _bos = "<bos>" _eos = "<eos>" """ This code follows the steps of preprocessing in tff shakespeare dataset: https://github.com/google-research/federated/blob/master/utils/datasets/shakespeare_dataset.py """ SEQUENCE_LENGTH = 80 #...
{"hexsha": "8393710249234b1d43162084fd442af34e07600c", "size": 3633, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/fedml/data/fed_shakespeare/utils.py", "max_stars_repo_name": "ray-ruisun/FedML", "max_stars_repo_head_hexsha": "24ff30d636bb70f64e94e9ca205375033597d3dd", "max_stars_repo_licenses": ["Apach...
myTestRule { #Workflow function for no operation #Output from running the example is: # nop nop; writeLine("stdout", "nop"); } INPUT null OUTPUT ruleExecOut
{"hexsha": "bb3f256de33a8b6bac8d3dd578c50ae8ad9a3f9e", "size": 167, "ext": "r", "lang": "R", "max_stars_repo_path": "iRODS/clients/icommands/test/rules3.0/ruleworkflownop.r", "max_stars_repo_name": "PlantandFoodResearch/irods", "max_stars_repo_head_hexsha": "9dfe7ffe5aa0760b7493bd9392ea1270df9335d4", "max_stars_repo_li...
import uvicorn import cv2 import base64 from fastapi import FastAPI, File, Form, UploadFile import numpy from fastapi.middleware.cors import CORSMiddleware from pydantic import BaseModel class img2base64_response(BaseModel): ok: int data: str pass app = FastAPI() app.add_middleware( CORSMiddleware, ...
{"hexsha": "b6fa34ac4b6e1b63a31b6b91a5f6136265e95c65", "size": 1372, "ext": "py", "lang": "Python", "max_stars_repo_path": "pysample.py", "max_stars_repo_name": "badpaybad/cmakes-helloworld", "max_stars_repo_head_hexsha": "173357065bde14ee3621519ebb961d29bab109e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import os, csv, json, pandas as pd import annotate, collect, supervise from pprint import pprint import numpy as np def get_labeled(basedir, annotationdir): def read_rows(name): fname = os.path.join(basedir, 'csv', name) try: return list(csv.reader(open(fname))) except: ...
{"hexsha": "91a32e6f28e3dc64fd27a7dfbd91f193669ed08f", "size": 2007, "ext": "py", "lang": "Python", "max_stars_repo_path": "tab2know/query.py", "max_stars_repo_name": "karmaresearch/tab2know", "max_stars_repo_head_hexsha": "f48a87c43232bf2350da2ce4236dd34c933c1df7", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
using MacroTools: @capture, prewalk using Calculus: differentiate export AnalyticFunction, @analytic import FunctionWrappers import FunctionWrappers: FunctionWrapper const ScalarFun{T} = FunctionWrapper{T, Tuple{T}} """ `F64fun`: `FunctionWrapper` to wrap many different potentials within a single type. Can be used ...
{"hexsha": "50c346e498de8af12f1436c3974f189e89868149", "size": 2938, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/analyticpotential.jl", "max_stars_repo_name": "hlwang0717/JuLIP.jl", "max_stars_repo_head_hexsha": "c8d325191b99be5c545a0fdb2b8fe11581c125fe", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
# %% from bdb import set_trace import os import pickle import torch import numpy as np from math import ceil from model_vc_mel import Generator from model_vc_stft import GeneratorSTFT from model_vc_wav import GeneratorWav import matplotlib.pyplot as plt from librosa import display from librosa.filters import mel from s...
{"hexsha": "89fc962a231e2d7ce7d0dcef924a903d27e436c9", "size": 5484, "ext": "py", "lang": "Python", "max_stars_repo_path": "conversion_nina.py", "max_stars_repo_name": "sebakeaaen/autovc", "max_stars_repo_head_hexsha": "aecc37901528f65209dafe30ac98094ccc6ea475", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2,...
Require Import Setoid. Require Import Coq.Lists.List. Require Import Coq.Program.Equality. Import ListNotations. Require Import Lib.EqDec. Class LinearOrder (A: Type) := { ord : A -> A -> bool; refl : forall x: A, ord x x = true; anti_sym : forall x y: A, ord x y = true -> ord y x = true -> x = y; tra...
{"author": "speederking07", "repo": "magisterka", "sha": "602d1e328ac4a396c282e241744d129573a65381", "save_path": "github-repos/coq/speederking07-magisterka", "path": "github-repos/coq/speederking07-magisterka/magisterka-602d1e328ac4a396c282e241744d129573a65381/backup/Lib/Sorted.v"}
!> subroutine for the calculation of rates in the Redfield approximation SUBROUTINE calculate_redfield_rates_mpi USE harmonic_bath USE hamiltonians USE input_output USE kinds USE linear_algebra USE parameters USE fourier USE unit_conversions IMPLICIT NONE INTEGER :: i,j,k REA...
{"hexsha": "7e8d87b124e60c58be1ffae5b0ec3e461e51e51b", "size": 2528, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "mqds/src/mpi_src/redfield_src/calculate_redfield_rates_mpi.f90", "max_stars_repo_name": "jprov410/mqds", "max_stars_repo_head_hexsha": "beead5c30aac77a7ae2d07e808d8c587cdd1c3ce", "max_stars_repo...
# This file was generated, do not modify it. # hide ŷ = predict(mach_pipe, rows=validation); print( "Measurements:\n", " brier loss: ", brier_loss(ŷ, y[validation]) |> mean, "\n", " auc: ", auc(ŷ, y[validation]), "\n", " accuracy: ", accuracy(mode.(ŷ), y[validation]) )
{"hexsha": "bb7c28d054799bedcb2422f5db814004045c5b9f", "size": 316, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "__site/assets/end-to-end/telco/code/ex40.jl", "max_stars_repo_name": "alan-turing-institute/MLJTutorials", "max_stars_repo_head_hexsha": "f1613ac8968fceee0e4fe43d1fdb5b58c8a84bad", "max_stars_repo_l...
import glob import math import warnings import numpy as np from src.utils import one_half_diagonal_Pn_spectral_gap_from_adjacency_matrix, \ uniform_weighted_Pn_spectral_gap_from_adjacency_matrix def generate_d_regular_graph_by_adjacency(adj_matrix_first_row): """ Generate considering linear adjacency re...
{"hexsha": "6d0ef425d8f3b9cf8638d0fb0c326c024ec4f61b", "size": 9183, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/graphs.py", "max_stars_repo_name": "gianmarcocalbi/asyncdsm-sym", "max_stars_repo_head_hexsha": "21a82c5fafada360faef340db805a772cec61530", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
''' gpaw-tools: Simple Benchmark Calculation for GPAW Usage: $ gpaw -P8 python simple_benchmark_2021.py For AMD CPUs or using Intel CPUs without hyperthreading: (Example CPU is intel here, 4 cores or 8 threads) $ mpirun -n 4 gpaw python simple_benchmark_2021.py For using all threads provided by Intel Hyperth...
{"hexsha": "10a9b233052ac25f02125727eeef3d87e5c4b4b1", "size": 6310, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmarks/simple_benchmark_2021.py", "max_stars_repo_name": "sblisesivdin/gpaw-tools", "max_stars_repo_head_hexsha": "671ce999afa9844f13ed5695f17b062bb81e346b", "max_stars_repo_licenses": ["MIT"]...
#!/usr/bin/env python3 from pathlib import Path import time import zlib import numpy as np from phonebot.core.common.math.utils import anorm, alerp from phonebot.core.common.serial import encode, decode from phonebot.core.common.config import PhonebotSettings, FrameName from phonebot.core.frame_graph.phonebot_graph ...
{"hexsha": "b3a4e1b210e3a75ac5a832abf06224cd3efd172d", "size": 1676, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/demo/demo_viewer_server.py", "max_stars_repo_name": "vi-robotics/pyphonebot-extra", "max_stars_repo_head_hexsha": "5db65d95fe1fafff2cbac7ca8dba66a71d363d6b", "max_stars_repo_licenses": ["M...
"""Plot utility service.""" import matplotlib import matplotlib.pyplot as plt # noqa: E402 import numpy as np # noqa: E402 class PlotUtility(object): """Plot utility.""" # ------------------------------------------------------------------------ # Public methods: included in the API def plot(self...
{"hexsha": "76c36054499b13679dfbaa71c65c466c2fa9043b", "size": 3389, "ext": "py", "lang": "Python", "max_stars_repo_path": "coimbra_chamber/utility/plot/service.py", "max_stars_repo_name": "rinman24/chamber", "max_stars_repo_head_hexsha": "07ffa837b937db4e53dc479dac5428bd61491b5f", "max_stars_repo_licenses": ["MIT"], "...
from scipy.signal import butter, lfilter from scipy import signal from datetime import datetime, date from influxdb import InfluxDBClient import numpy import random import time import operator import sys, os import logging import algorithm as alg import algorithm_detect as detect #from scipy import stats import nitime...
{"hexsha": "f17f512a3f5ffad7a06ff905587c8c8fbaa2ba5d", "size": 12048, "ext": "py", "lang": "Python", "max_stars_repo_path": "stepstone_attack/attack_detection/algtest.py", "max_stars_repo_name": "iotanalytics/SaTC_testbed", "max_stars_repo_head_hexsha": "a6f5471e64cee60202390df366bab7677c04d3cf", "max_stars_repo_licens...
import numpy as np import logging import scipy.optimize as spo def initial_guess(opt_params, eos): r""" Extract initial guess in fit parameters from EOS object. These values were taken from the EOSgroup file. Parameters ---------- opt_params : dict Parameters used in basin fitting algori...
{"hexsha": "6899ab8c253fc4c2e63e833d734eba8685b19424", "size": 16722, "ext": "py", "lang": "Python", "max_stars_repo_path": "despasito/fit_parameters/fit_funcs.py", "max_stars_repo_name": "rakshitkjain/despasito", "max_stars_repo_head_hexsha": "ca83856d5b7ced21b101eaae4d8393a9db7c2f0d", "max_stars_repo_licenses": ["BSD...
import numpy as np import copy from itertools import product import random import matplotlib.pyplot as plt class Grid: def __init__(self, rewards, policy, terminal_states, gamma): self.actions = ["U", "R", "D", "L"] self.rewards = rewards self.policy = policy self.terminal_states =...
{"hexsha": "f9da29c1dca3cce11270b9e5e71089ef20591021", "size": 17247, "ext": "py", "lang": "Python", "max_stars_repo_path": "grid.py", "max_stars_repo_name": "cksoest/model-free-prediction", "max_stars_repo_head_hexsha": "3367ceb22e468018f3f3e88a906e2fd72811674a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
from __future__ import print_function import numpy as np from keras.datasets import cifar10 from keras.models import Sequential from keras.layers.core import Dense, Dropout, Flatten from keras.layers.convolutional import Conv2D, ZeroPadding2D from keras.layers.pooling import MaxPooling2D from keras.utils import to_ca...
{"hexsha": "5bccf0c0877884c5eaddb80e556dc6f68dcbcc91", "size": 1493, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter14/5keras_cifar10.py", "max_stars_repo_name": "Jchen-sudo/ml-code-record", "max_stars_repo_head_hexsha": "4a6f8237c66b381832ebd534cad92c684dc5fe3b", "max_stars_repo_licenses": ["MIT"], "max...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import time import socket import atexit import signal import pprint import logging import cPickle import subprocess import json import StringIO import numpy import theano from theano import tensor fr...
{"hexsha": "b16be3e4b16a641b05bfc4a6c37d165d201e396c", "size": 21519, "ext": "py", "lang": "Python", "max_stars_repo_path": "dictlearn/extractive_qa_training.py", "max_stars_repo_name": "tombosc/dict_based_learning", "max_stars_repo_head_hexsha": "c5e622d6de43ee6d892f8bccedc0a43a2f02a284", "max_stars_repo_licenses": ["...
*DECK DPFQAD SUBROUTINE DPFQAD (F, LDC, C, XI, LXI, K, ID, X1, X2, TOL, QUAD, + IERR) C***BEGIN PROLOGUE DPFQAD C***PURPOSE Compute the integral on (X1,X2) of a product of a C function F and the ID-th derivative of a B-spline, C (PP-representation). C***LIBRARY SLATEC C***CATEGORY...
{"hexsha": "dcbc6dbaf6fe758d47a451b7cc156ca495a490af", "size": 5097, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "slatec/src/dpfqad.f", "max_stars_repo_name": "andremirt/v_cond", "max_stars_repo_head_hexsha": "6b5c364d7cd4243686488b2bd4318be3927e07ea", "max_stars_repo_licenses": ["Unlicense"], "max_stars_coun...
import random import numpy as np import sys seed = 2 def generate_random_dimacs(nr_of_literals, sample_name = 'Sample2_dela'): f = open("Samples/"+sample_name+".txt", 'w+') nr_of_clauses = int(4.2*nr_of_literals) f.write('p cnf {} {}\n'.format(nr_of_literals, nr_of_clauses)) ## 4.2 is supposed to ...
{"hexsha": "d2b4d02dfed69acacb49f5d23a5b71eac11af937", "size": 910, "ext": "py", "lang": "Python", "max_stars_repo_path": "generator.py", "max_stars_repo_name": "BumbarG/LOGRAC-SAT-solver", "max_stars_repo_head_hexsha": "e821c941b07d2cadd63e09cd8892cc829aa3a771", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
""" Spatial Analyses ================ Analyze spatial data and apply spatial measures to spiking data. This tutorial primarily covers the ``spiketools.spatial`` module. """ ################################################################################################### # Apply spatial measures to spatial data # -...
{"hexsha": "67bf7a91af1eb96cf8485fe099d9fb45300d74e0", "size": 10813, "ext": "py", "lang": "Python", "max_stars_repo_path": "tutorials/plot_spatial.py", "max_stars_repo_name": "claire98han/SpikeTools", "max_stars_repo_head_hexsha": "f1cdffd50e2cbdb75961a716425c4665aa930f54", "max_stars_repo_licenses": ["Apache-2.0"], "...
""" an implementation of quasi-discrete Hankel transform. Reference: Li Yu, et.al, Quais-discrete Hankel transform, Optics Letters, 23, 409, 1998. @author: Bingbing Zhu @date: 2021/12/19 """ import numpy as np from scipy.special import jn_zeros, j0, j1, jv class Hankel_qDHT: """ an i...
{"hexsha": "dd331bc6508955bd96aba16eb4af922f21746121", "size": 4391, "ext": "py", "lang": "Python", "max_stars_repo_path": "Hankel_qDHT.py", "max_stars_repo_name": "scientific-computing-collections/Hankel-transform-qDHT", "max_stars_repo_head_hexsha": "fa38d74c9457b5c615e3fe2445faae77b14fe75d", "max_stars_repo_licenses...
""" Metrics to assess performance on classification task given class prediction Functions named as *_score return a scalar value to maximize: the higher the better Function named as *_error or *_loss return a scalar value to minimize: the lower the better """ # Authors: Kevin Liao import numpy as np import math fro...
{"hexsha": "25011f8965c028ab518c068411ced150bbce5a3f", "size": 46409, "ext": "py", "lang": "Python", "max_stars_repo_path": "klearn/model_selection/metrics_depr.py", "max_stars_repo_name": "KevinLiao159/klearn", "max_stars_repo_head_hexsha": "ffc0cb6b69cd21f2aac8934af55ac6e32c4db689", "max_stars_repo_licenses": ["MIT"]...
#!/usr/bin/env python3 """Script to pre-process the raw simulator data.""" import os import numpy as np import healpy as hp def convert(inpath, outpath): """Convert npy simulation files to fits. Removes the mean of the signal. """ os.makedirs(outpath, exist_ok=True) for filename in os.listdi...
{"hexsha": "95573f100754a418a893702223ad93275addc826", "size": 2446, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_preprocess.py", "max_stars_repo_name": "LaGuer/DeepSphere", "max_stars_repo_head_hexsha": "5a02ac01b8fe3a5b9814ae9efd20d10e0c843209", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 71...
--Proof: a -> a theorem Ex001_1(a : Prop) : a -> a := assume H1 : a, show a ,from H1 --using tactics theorem Ex001_2(a : Prop) : a -> a := begin intro H, exact H end
{"author": "SvenWille", "repo": "LeanLogicExercises", "sha": "2dbc920feadd63bbc50f87e69646c0081db26eba", "save_path": "github-repos/lean/SvenWille-LeanLogicExercises", "path": "github-repos/lean/SvenWille-LeanLogicExercises/LeanLogicExercises-2dbc920feadd63bbc50f87e69646c0081db26eba/src/propLogic/Ex001.lean"}
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! EVB-QMDFF - RPMD molecular dynamics and rate constant calculations on ! black-box generated potential energy surfaces ! ! Copyright (c) 2021 by Julien Steffen (steffen@pctc.uni-kiel.de) ! Stefa...
{"hexsha": "de9b8bd9821f3ea4e2c85c5bf4dc9bb1be9540ce", "size": 2315, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/preig4.f90", "max_stars_repo_name": "Trebonius91/EVB-QMDFF", "max_stars_repo_head_hexsha": "8d03e1ad073becb0161b0377b630d7b65fe3c290", "max_stars_repo_licenses": ["MIT", "Unlicense"], "max_s...
# This file was generated, do not modify it. # hide k_range = range(krb, :(knn_model.K), lower=2, upper=100, scale=:log10) l_range = range(krb, :(ridge_model.lambda), lower=1e-4, upper=10, scale=:log10) w_range = range(krb, :(knn_weight), lower=0.1, upper=0.9) ranges = [k_range, l_range, w_range]
{"hexsha": "a764e4d31898e5a39d91874e4265be398a6db688", "size": 298, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "_assets/pages/end-to-end/ames/code/ex25.jl", "max_stars_repo_name": "giordano/DataScienceTutorials.jl", "max_stars_repo_head_hexsha": "8284298842e0d77061cf8ee767d0899fb7d051ff", "max_stars_repo_lice...
import sys # import pydot import numpy import theano import theano.tensor as T # theano.config.optimizer = 'None' # theano.config.exception_verbosity = 'high' theano.config.linker = 'py' class NNet(object): def __init__(self, vocabulary_size, embedding_dimension, context_window_size, num_hidden_lay...
{"hexsha": "1e6dd543467a1f2116b6a081c6d4aa8a800e8a1d", "size": 3300, "ext": "py", "lang": "Python", "max_stars_repo_path": "classifier.py", "max_stars_repo_name": "wenjiesha/word_embedding", "max_stars_repo_head_hexsha": "22d11c45adfdf5189bbd241aa00e0f6dc4575e5e", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c...
subroutine findtic (end1,end2,bigtic,smltic) c****************************************************************************** c this routine makes tic marks at nice round intervals. c****************************************************************************** implicit real*8(a-h,o-z) real*4 end...
{"hexsha": "b7d8b992a921160b239a509ea024ab4fa3a59309", "size": 846, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "Findtic.f", "max_stars_repo_name": "cartilage-ftw/moog17scat", "max_stars_repo_head_hexsha": "1c3c11ff13976834f01393c0784192e7cb48a5e4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 5, "m...
import numpy as np from sklearn.feature_extraction.text import CountVectorizer from sklearn.feature_extraction.text import TfidfTransformer from scripts.text_processing import StemTokenizer, lowercase_strip_accents_and_ownership, WordAnalyzer from scripts.utils import utils def tfidf_from_text(text_series, ngram_ran...
{"hexsha": "533b49c949a46bd2dbf9dcaa47093f76437cca3f", "size": 3048, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/tfidf_wrapper.py", "max_stars_repo_name": "mitroulias77/pyGrams", "max_stars_repo_head_hexsha": "dbbbc142f457e0e995b4f740272b276d38a39cb0", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
import os import numpy as np import pandas as pd import matplotlib.pyplot as plt from datetime import datetime from scipy.stats import iqr from coinbase_analysis.coinbase_utilities import regression def filter_significant_pairs(df_output, significant_pairs): cp_list = [] # Count significant pairs n = le...
{"hexsha": "45cfd0f416c2e5c169c64924d690fbde551e0419", "size": 4659, "ext": "py", "lang": "Python", "max_stars_repo_path": "pairs_crypto/coinbase_analysis/coinbase_fit_spread_oruh.py", "max_stars_repo_name": "factorwonk/fml", "max_stars_repo_head_hexsha": "6ff3d312bfb9ebc459809c3e0b0a087fffe51882", "max_stars_repo_lice...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import os import cv2 import torch import numpy as np from glob import glob from tqdm import tqdm from multiprocessing import Pool from siamban.core.co...
{"hexsha": "17b04ca3697ebfde7ea274222ca95553141e0ff0", "size": 18970, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/tune.py", "max_stars_repo_name": "QiangliangHuang/siamban", "max_stars_repo_head_hexsha": "940208cb26f8146f87f7534d1674791dcb62468a", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c...
import numpy as np import matplotlib.pyplot as plt axes = {'x': 0, 'y': 1} def fold(p, axis, val): s2 = p.shape[axis] - val - 1 m1 = max(0, max(val, s2) - val) m2 = max(0, max(val, s2) - s2) if axis == 0: return np.bitwise_or( np.pad(p[:val, :][::-1, :], ((0, m1), (0, 0))), ...
{"hexsha": "49631fd5412c667f7190429be3919c903a18b3a9", "size": 1334, "ext": "py", "lang": "Python", "max_stars_repo_path": "day_13/puzzles.py", "max_stars_repo_name": "electronsandstuff/Advent-of-Code-2021", "max_stars_repo_head_hexsha": "9c23872640e8d092088dcb6d5cb845cd11d98994", "max_stars_repo_licenses": ["BSD-3-Cla...
# 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 ...
{"hexsha": "bee48eff7412ebba7be2a4d35fca04d2423bebbe", "size": 19253, "ext": "py", "lang": "Python", "max_stars_repo_path": "research/cognitive_planning/train_supervised_active_vision.py", "max_stars_repo_name": "hjkim-haga/TF-OD-API", "max_stars_repo_head_hexsha": "22ac477ff4dfb93fe7a32c94b5f0b1e74330902b", "max_stars...
dv = @data([NA, 3, 2, 5, 4]) dv mean(dv) dropna(dv) mean(dropna(dv)) convert(Array, dv) #fails... convert(Array, dropna(dv)) # works fine... # or overwrite the NA value like: dv[1] = 3 #then convert(Array, dv) # also works # replaciung and converting in one go: dv = @data([NA, 3, 2, 5, 4]) mean(convert(Arr...
{"hexsha": "074ed2046e52e4d2df4e9de20b2924a72fb1c29f", "size": 2671, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/IB/BBG_Volume_JuliaCode/DataFrames_Testing.jl", "max_stars_repo_name": "SvenDuve/JuliaAOT.jl", "max_stars_repo_head_hexsha": "005c86538df418eb3bc9a37c68482019bdf6683a", "max_stars_repo_licenses...
```python ### Running in Google Colab? You'll want to uncomment and run these cell once each time you start this notebook. """ !wget https://raw.githubusercontent.com/psheehan/CIERA-HS-Program/master/BonusProblems/Module3/M33velocities.csv """ ``` # Galaxy Rotation Curves We've already talked quite a bit about the...
{"hexsha": "900a3eab0bf169eca9bc6b7b963c3ffdada051a7", "size": 4763, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "BonusProblems/Module2/BonusChallenge4.ipynb", "max_stars_repo_name": "psheehan/CIERA-HS-Program", "max_stars_repo_head_hexsha": "76f7f0ff994e74e646fa34bbb41c314bf7526e9b", "max_stars_...
import logisticRegression import Clustering from poliTransformation import modifyDataSet import numpy as np import matplotlib.pyplot as plt import easygui from copy import copy dataSet = np.loadtxt("../docs/cluster1.txt", delimiter=';') incomes = dataSet[:, 0] ages = dataSet[:, 1] xplt, yplt = [], [] ini = 1 for i in...
{"hexsha": "8bd0d3df0bea59a524785649d66141aafe5fc3bd", "size": 2400, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/app.py", "max_stars_repo_name": "Charles06x/final-project-ai", "max_stars_repo_head_hexsha": "927d4564b57a2ac7b672cdb0fc18e78e9d97dd51", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
""" This file defines the model classes that wrap PSFs from galsim into the CatSim interface """ import numpy import galsim __all__ = ["PSFbase", "DoubleGaussianPSF", "SNRdocumentPSF", "Kolmogorov_and_Gaussian_PSF"] class PSFbase: """ This is the base class for wrappers of GalSim's PSF classes. To...
{"hexsha": "5f044194a1ba71c6c5e826e73de2a11e44bf4e97", "size": 8807, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/desc/imsim/sims_GalSimInterface/galSimPSF.py", "max_stars_repo_name": "g-braeunlich/imSim", "max_stars_repo_head_hexsha": "c6f97ba39f05313570d15671f2b9eb9bd1de24bc", "max_stars_repo_license...
import torch import numpy as np from torch.nn import functional as F """ Useful geometric operations, e.g. Perspective projection and a differentiable Rodrigues formula Parts of the code are taken from https://github.com/MandyMo/pytorch_HMR """ def batch_rot2aa(Rs): """ Rs is B x 3 x 3 void cMathUtil::Rot...
{"hexsha": "c7bffe73b680bdbdf5fcc33eac20372ded456ef4", "size": 25191, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/pare/pare/utils/geometry.py", "max_stars_repo_name": "YuliangXiu/ICON", "max_stars_repo_head_hexsha": "ece5a09aa2d56aec28017430e65a0352622a0f30", "max_stars_repo_licenses": ["Intel"], "max_st...
# -*- coding: utf-8 -*- """ Created on Tue Mar 9 16:05:34 2021 @author: Ivan """ import os from sys import platform import numpy as np import pandas as pd from decord import VideoReader from decord import cpu, gpu import torch import torch.utils.data # decord is required for loading the videos. I have seen that ...
{"hexsha": "9c58a3ac03b170e766d1590129f5fd43637bc743", "size": 3853, "ext": "py", "lang": "Python", "max_stars_repo_path": "load_video_metadata.py", "max_stars_repo_name": "IvanNik17/Harbor-Image-Data-Extraction", "max_stars_repo_head_hexsha": "faad36186cf1374e430d5dac82172bed2861b68c", "max_stars_repo_licenses": ["MIT...
import pygame import pygame.camera from pygame.locals import * import numpy as np import scipy.ndimage.filters as filt import matplotlib.pyplot as plt import matplotlib.cm as cm import time import serialConnection def waitCountdown(): for i in range(4, 0, -1): time.sleep(1) #print i ROWNUM = 100...
{"hexsha": "95dc3d156717ff9b34d25625e73250e4ed084152", "size": 1383, "ext": "py", "lang": "Python", "max_stars_repo_path": "camerastream.py", "max_stars_repo_name": "calcdude84se/lasersandbox", "max_stars_repo_head_hexsha": "c52f6eab8d4f02f2206c93a73ed68e6e54106f4c", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
using SafeTestsets const LONGER_TESTS = false const GROUP = get(ENV, "GROUP", "All") if GROUP == "All" || GROUP == "Core" @time @safetestset "DynamicHMC" begin include("dynamicHMC.jl") end @time @safetestset "Turing" begin include("turing.jl") end # @time @safetestset "ABC" begin include("abc.jl") end e...
{"hexsha": "2ac9295f2dc4b02677c2bfc09d7682b01c46f7be", "size": 497, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "JuliaDiffEq/BayesDiffEq.jl", "max_stars_repo_head_hexsha": "3f1da73c0e999e3198bb7e59f31ef2e1771bddf4", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
/*============================================================================= Copyright (c) 2002 2004 2006 Joel de Guzman Copyright (c) 2004 Eric Niebler Copyright (c) 2005 Thomas Guest http://spirit.sourceforge.net/ Use, modification and distribution is subject to the Boost Software L...
{"hexsha": "3a3af8aad70552f0020079f2b42355eed61f158b", "size": 5616, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "REDSI_1160929_1161573/boost_1_67_0/tools/quickbook/src/state.cpp", "max_stars_repo_name": "Wultyc/ISEP_1718_2A2S_REDSI_TrabalhoGrupo", "max_stars_repo_head_hexsha": "eb0f7ef64e188fe871f47c2ef9cdef36...
------------------------------------------------------------------------ -- Parser indices ------------------------------------------------------------------------ module RecursiveDescent.Index where open import Data.Bool open import Data.Product.Record open import Relation.Nullary open import Relation.Binary open im...
{"hexsha": "2c5988d58da2151ec60fe433779ee8852f59a8f3", "size": 3096, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "misc/RecursiveDescent/Index.agda", "max_stars_repo_name": "yurrriq/parser-combinators", "max_stars_repo_head_hexsha": "b396d35cc2cb7e8aea50b982429ee385f001aa88", "max_stars_repo_licenses": ["MIT"]...
# -*- coding: UTF-8 -*- import os import pickle import gzip import theano.tensor as T from .utils import * def normalize(x): r""" Normalization: Scale data to [0, 1] .. math :: z = (x - min(x)) / (max(x) - min(x)) Parameters ---------- x: numpy array Returns ------- z,...
{"hexsha": "e9236634e67c2d8029ef1e368c40e8057cb0de65", "size": 7243, "ext": "py", "lang": "Python", "max_stars_repo_path": "yadll/data.py", "max_stars_repo_name": "pchavanne/dl", "max_stars_repo_head_hexsha": "6114234a8a25cfda7a596b9a6e75bb121de6f4d2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "max_star...
import numpy as np from torch.autograd import Variable from src.models.base_models import UserEncoder, ItemEncoder, Generator, Discriminator import torch.nn as nn import os import torch import wandb # 1. Start a new run wandb.init(project="adversarial-recommendation") # 2. Save model inputs and hyperparameters confi...
{"hexsha": "4d83baefe1b1e67d64b4dffe37821b56280fa93e", "size": 14840, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/arcf.py", "max_stars_repo_name": "neerajsharma9195/adversarial-recommendation-systems", "max_stars_repo_head_hexsha": "46500d18a7175237f07df80af4f9b25e9d4c1188", "max_stars_repo_licens...
## ------------------------------------------------------------------- # bounds let ps = Plots.Plot[] for ider in FLX_IDERS p = plot(title = ider, xlabel = "replica", ylabel = "flx") xticks = (EXPS, string.(EXPS)) for method in ALL_METHODS color = method_colors[method] ...
{"hexsha": "86cb57275a51678d7255e9fc4b9eab7246ad08db", "size": 1254, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "scripts/iJR904/DEPRECATED/2.2.8_inbound_study.jl", "max_stars_repo_name": "josePereiro/Chemostat_Heerden2013.jl", "max_stars_repo_head_hexsha": "00f97a57a64daf8d175b2eb22871c5fc83d2e6f0", "max_star...
list = ["NAME: Rajavee Srivastava","EMAIL: rajvisrivastav18@gmail.com","USED LANGUAGE: JULIA", "BIOSTACK: Genomics","SLACK USERNAME: @Rajvi"] for i in list println(i) end
{"hexsha": "22014828ee7dba3917cb15fcd98dd4a236e0d572", "size": 186, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "stage_0_rajvi.jl", "max_stars_repo_name": "jravimicro/team-rosalind-project", "max_stars_repo_head_hexsha": "4700ef6722c909ce9f5c48d4008ddaaf29d47d46", "max_stars_repo_licenses": ["MIT"], "max_stars...
import numpy as np import pandas as pd import scipy.stats import scipy.optimize class demo: """This class is used for illustrative and replication purposes. This object embodies a segmented regression model with parametric node placement. The specification of both the segmented regression model itself and the ...
{"hexsha": "e85fe30465a573d687cf5ceee3021d43ad1f8c5e", "size": 6177, "ext": "py", "lang": "Python", "max_stars_repo_path": "segmented/demo.py", "max_stars_repo_name": "cluhmann/segmented", "max_stars_repo_head_hexsha": "05523e5f8fe686ab2895b9baf7705dedcd61b8ca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
""" This is the wrapper interface for white-box attack on object detectors """ import numpy as np import json, cv2 import os class AttackWrapper(object): def __init__(self, num_iter=200, max_distortion=0.0001, eps=20, norm_ball=0, ...
{"hexsha": "855552df0996739aa18d1abc169b615dcfc7d567", "size": 1743, "ext": "py", "lang": "Python", "max_stars_repo_path": "attack_wrapper/attack_wrapper.py", "max_stars_repo_name": "yuezunli/BMVC2018R-AP", "max_stars_repo_head_hexsha": "aaccd20934e85b4b635f1b3ec8fcc757589cfb42", "max_stars_repo_licenses": ["MIT"], "ma...
import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True): # Capture frame-by-frame ret, frame = cap.read() # Our operations on the frame come here GRAY = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY) SEPIA = cv2.cvtColor(frame, cv2.CALIB_CB_ASYMMETRIC_GRID) RANDOM = cv2.cvtC...
{"hexsha": "f550e980690259dc0d28e04e0e04445d0c81672a", "size": 677, "ext": "py", "lang": "Python", "max_stars_repo_path": "FIlterProcessing.py", "max_stars_repo_name": "abhi00o7/OpenCV-minor-project", "max_stars_repo_head_hexsha": "86fefb2fd3259fee7139926d0fe0bb674c8d464f", "max_stars_repo_licenses": ["MIT"], "max_star...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Consensus mechanism for Truthcoin. This is the mechanism that, theoretically: 1. Allows the software to determine the state of Decisions truthfully, and 2. Only allows an efficient number of most-traded-upon-Decisions. """ from __future__ import division, print_fun...
{"hexsha": "4f95364211c6778c1a4c870e027f3d63ed178137", "size": 17720, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib-other/pylib/consensus/consensus.py", "max_stars_repo_name": "endolith/Truthcoin", "max_stars_repo_head_hexsha": "448b35fb94f27e61f5989ead7ef87e03da2e9237", "max_stars_repo_licenses": ["MIT"],...
""" General-purpose functions """ import numpy as np def int_to_bin_vec(integer, n=13): vec = np.zeros(n, dtype=bool) for i in range(n,0,-1): if integer == 0: return vec if integer >= 2**i: vec[i-1] = True integer -= 2**i return vec def is_coding_all...
{"hexsha": "4d97d8a4136020de6afaed5a6f62609a6b412635", "size": 663, "ext": "py", "lang": "Python", "max_stars_repo_path": "validation/src/val_utils.py", "max_stars_repo_name": "theglobaljukebox/Woodetal2021-Analysis", "max_stars_repo_head_hexsha": "5af83047bf81ddb8f28d89b955cd7bcdb3e53867", "max_stars_repo_licenses": [...
#!/usr/bin/env python3 import sys sys.path.append('../') # or just install the module sys.path.append('../../fuzzy-tools') # or just install the module sys.path.append('../../astro-lightcurves-handler') # or just install the module #######################################################################################...
{"hexsha": "b5c7312682175238791cc71be54e8372b8e003c3", "size": 2671, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/export_2dprojections.py", "max_stars_repo_name": "oscarpimentel/astro-lightcurves-features", "max_stars_repo_head_hexsha": "11c17ce41e6a10339f00e6cdf5400b2c0a873eb3", "max_stars_repo_l...
# PyCaMa: Python for multiobjective cash management with multiple bank accounts from gurobipy import * import numpy as np class multibank(object): def __init__(self, banks, trans, A, gzero, gone, v, bmin): """Defines the cash management system""" self.banks = list(banks) ...
{"hexsha": "ff4f32aeedfdc4066770a2b4f99188a562279ce1", "size": 13557, "ext": "py", "lang": "Python", "max_stars_repo_path": "PyCaMa.py", "max_stars_repo_name": "PacoSalas/PyCaMa", "max_stars_repo_head_hexsha": "b5a261638e36b015acfa0ea820ec938aa49281ca", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_count": 6,...
import itertools from typing import Optional, Dict, Tuple, Any, List from collections import Counter import hail as hl from hail.expr.expressions import Expression, StructExpression, \ expr_struct, expr_any, expr_bool, analyze, Indices, \ construct_reference, construct_expr, extract_refs_by_indices, \ Expre...
{"hexsha": "76fbdc2c17bdc7251ca90de85261bd42c3baebf8", "size": 154732, "ext": "py", "lang": "Python", "max_stars_repo_path": "hail/python/hail/matrixtable.py", "max_stars_repo_name": "saponas/hail", "max_stars_repo_head_hexsha": "bafea6b18247a4279d6ef11015e8e9f3c2b5ecea", "max_stars_repo_licenses": ["MIT"], "max_stars_...
# AUTOGENERATED! DO NOT EDIT! File to edit: 01_tfidf.ipynb (unless otherwise specified). __all__ = ['get_freq', 'form_matrix', 'get_query_vec', 'get_cos_sim'] # Cell from collections import Counter import numpy as np import math from fastcore.test import test_eq from nbdev.showdoc import * # Cell def get_freq(prepro...
{"hexsha": "818fe9074c43b2f1d45da53ffec3674e06aa9b01", "size": 2368, "ext": "py", "lang": "Python", "max_stars_repo_path": "nbdev_testing/tfidf.py", "max_stars_repo_name": "Sylvia9628/nbdev_testing", "max_stars_repo_head_hexsha": "dd4c4b874d80be684fd2be913c815d9fc5544d65", "max_stars_repo_licenses": ["Apache-2.0"], "ma...
import numpy as np import torch dt = 0.01 def fx_(x): return x def gx_(x): g_ = np.array([1])*dt return torch.tensor(g_,dtype=torch.float) def df_dx_(x, type = 'tensor'): dfdx = np.array([1]) if type == 'numpy': return dfdx if type == 'tensor': return torch.tensor(dfdx,dtype=...
{"hexsha": "314c31e1976c6950f4655e7427054ae4d69bbeaa", "size": 3118, "ext": "py", "lang": "Python", "max_stars_repo_path": "robot_models/SingleIntegrator1D.py", "max_stars_repo_name": "hardikparwana/Safe-Learning-DASC", "max_stars_repo_head_hexsha": "26bade8f316ccdeacd9337fb2786aaa9259167b8", "max_stars_repo_licenses":...
ishorizontal(s::Segment) = s.p1[2]==s.p2[2] isvertical(s::Segment) = s.p1[1]==s.p2[1] function draw_segment!(field, s::Segment) start, goal = s.p1, s.p2 field[start[2], start[1]] += 1 dif = sign.(goal - start) current = start while current != goal current += dif field[current[2], cu...
{"hexsha": "d5ae2558867d965706cd71dee36fbe5aee5d3081", "size": 810, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/day05.jl", "max_stars_repo_name": "petrposik/AoC2021", "max_stars_repo_head_hexsha": "5f864b2dc7b84c7bd4867701d2cf71b81b4dc749", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max...
# -*- coding: utf-8 -*- import numpy as np import pygame as pg from map import Map import character import os from utils import get_path import time import pygame_menu as pgm from character import * import utils def toggle_fullscreen(): screen = pg.display.get_surface() tmp = screen.convert() captio...
{"hexsha": "01d71b35c81ebb4d50527adea37b2a813c1b7528", "size": 11366, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/jeu.py", "max_stars_repo_name": "florian6973/hackathon", "max_stars_repo_head_hexsha": "55a879416845458dfc6760ccae1a8852db4012b0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
import numpy from chainer.backends import cuda from chainer.functions.connection import bilinear from chainer import initializers from chainer import link from chainer import variable class Bilinear(link.Link): """Bilinear layer that performs tensor multiplication. Bilinear is a primitive link that wraps t...
{"hexsha": "a26bbdeb95b93032ddcb5e983bcb27ad8bab9520", "size": 4660, "ext": "py", "lang": "Python", "max_stars_repo_path": "chainer/links/connection/bilinear.py", "max_stars_repo_name": "LuoYuanke/PrivChainer", "max_stars_repo_head_hexsha": "758d765c7903f6913cfd58c21db069d5f2a12203", "max_stars_repo_licenses": ["MIT"],...
[STATEMENT] lemma full_checker_spec: assumes \<open>(A, A') \<in> polys_rel\<close> shows \<open>full_checker spec A pac \<le> \<Down>{((st, G), (st', G')). (st, st') \<in> status_rel \<and> (st \<noteq> FAILED \<longrightarrow> (G, G') \<in> polys_rel_full)} (PAC_checker_specification spec...
{"llama_tokens": 10041, "file": "PAC_Checker_PAC_Checker_Specification", "length": 32}
import os import matplotlib.pyplot as plt import numpy as np from safe_control_gym.utils.utils import mkdirs from safe_control_gym.controllers.mpc.mpc_utils import compute_state_rmse def get_cost(test_runs): num_epochs = len(test_runs) num_episodes = len(test_runs[0]) costs = np.zeros((num_epochs, num_ep...
{"hexsha": "5db6580e5edfa4da704e7fd7979b08b5cd37c622", "size": 18520, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/arxiv/utils/gpmpc_plotting_utils.py", "max_stars_repo_name": "Federico-PizarroBejarano/safe-control-gym", "max_stars_repo_head_hexsha": "7412a7244e0ae77aa95034a5a65548b2c91e5e19", "ma...
''' Created on Nov 10, 2015 @author: kashefy ''' import numpy as np import cv2 as cv2 import cv2.cv as cv import caffe def view_blob_label_segm(nb_imgs, path_solver): solver = caffe.SGDSolver(path_solver) for _ in xrange(nb_imgs): solver.net.forward() # train net ...
{"hexsha": "bcd2a51c0b1b1f8272527ee67eddc6764f53ae71", "size": 927, "ext": "py", "lang": "Python", "max_stars_repo_path": "nideep/blobs/view_blob_data_segm.py", "max_stars_repo_name": "kashefy/caffe_sandbox", "max_stars_repo_head_hexsha": "31afc409df14fece0ac21707185e586dd2d625a9", "max_stars_repo_licenses": ["BSD-2-Cl...
Address(F Street) is a street that runs northsouth. Along with Anderson Road Anderson and Pole Line Road, it is perhaps one of the most important northsouth thoroughfares in Davis. While downtown, it runs between E Street and G Street. It starts at 1st Street and runs north out of town, where it becomes County Road ...
{"hexsha": "20e39d235dd04f766830af4e484690c6b93d22cd", "size": 1502, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/F_Street.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import random import torch import numpy as np from torch.utils.data import DataLoader from torch.utils.data.distributed import DistributedSampler from experiments.nlg_gru.dataloaders.text_dataset import TextDataset from utils.data_utils import Ba...
{"hexsha": "58be2132fef71b94955ab271cb0abd7abd96431e", "size": 3524, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/nlg_gru/dataloaders/text_dataloader.py", "max_stars_repo_name": "simra/msrflute", "max_stars_repo_head_hexsha": "c28e2e6bcfa9464b8640ccd625393bbed28491c3", "max_stars_repo_licenses": [...
# This file is part of faro. # # Developed for the LSST Data Management System. # This product includes software developed by the LSST Project # (https://www.lsst.org). # See the COPYRIGHT file at the top-level directory of this distribution # for details of code ownership. # # This program is free software: you can re...
{"hexsha": "ef7a382286ab33946f5699909f9b45701db8e6b0", "size": 4927, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/lsst/faro/utils/coord_util.py", "max_stars_repo_name": "lsst/faro", "max_stars_repo_head_hexsha": "c9d0b822c4e3533531fa3849ae4bb92545373db5", "max_stars_repo_licenses": ["MIT"], "max_stars_...
struct MPoly{T} terms::OrderedDict{Vector{Int},T} vars::Vector{Symbol} end terms(p::MPoly) = p.terms eltype(::MPoly{T}) where {T}= T vars(p::MPoly) = p.vars nvars(p::MPoly) = length(vars(p)) zero(::Type{MPoly{T}}; vars::Vector{Symbol}=Symbol[]) where {T} = MPoly{T}(OrderedDict{Vector{Int},T}(), vars) zero(...
{"hexsha": "7b278fe1b91cbd970256a3cc2d30e57c6d75926c", "size": 2473, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/mpoly.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/MultiPoly.jl-b9d7351b-c616-5ab5-9ced-54f189935774", "max_stars_repo_head_hexsha": "7444514ea13eb09d40f20c44b531c38ebe7bc743", "...
# -*- coding: utf-8 -*- # Copyright (c) 2020. Distributed under the terms of the MIT License. from copy import copy, deepcopy from dataclasses import dataclass from functools import reduce from typing import Dict, Optional, List import numpy as np from monty.json import MSONable from vise.util.mix_in import ToJsonFil...
{"hexsha": "20a64f77dda47efd9f9a4f80f734935c5333ff70", "size": 6221, "ext": "py", "lang": "Python", "max_stars_repo_path": "vise/analyzer/dos_data.py", "max_stars_repo_name": "kumagai-group/vise", "max_stars_repo_head_hexsha": "8adfe61ad8f31767ec562f02f271e2495f357cd4", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
[STATEMENT] lemma pr_pri_agrk_unused: "(evs, S, A, U) \<in> protocol \<Longrightarrow> Pri_AgrK x \<notin> U \<Longrightarrow> analz (insert (Pri_AgrK x) (A \<union> spies evs)) = insert (Pri_AgrK x) (analz (A \<union> spies evs))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>(evs, S, A, U) \<i...
{"llama_tokens": 248, "file": "Password_Authentication_Protocol_Protocol", "length": 1}