text
stringlengths
0
27.1M
meta
dict
[STATEMENT] lemma wadjust_loop_start_Oc_via_Bk_move[simp]: "wadjust_loop_right_move2 m rs (c, Bk # list) \<Longrightarrow> wadjust_loop_start m rs (c, Oc # list)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. wadjust_loop_right_move2 m rs (c, Bk # list) \<Longrightarrow> wadjust_loop_start m rs (c, Oc # list) [...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Universal_Turing_Machine_UTM", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 430, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_fo...
# -*- coding: utf-8 -*- """ Created on Sun Apr 23 2017 Last update on Mon Apr 24 2017 @author: Michiel Stock Parsing the Ghent park network """ import json import geopandas as gpd import shapely import numpy as np if __name__=='__main__': # read roads in Ghent streets = gpd.read_file('Data/ex_SXXm38nTMVKwsP...
{ "alphanum_fraction": 0.604784689, "author": null, "avg_line_length": 29.0277777778, "converted": null, "ext": "py", "file": null, "hexsha": "65001edf51736ee6e536d6a732a07bf186e242e7", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from PIL import Image import cv2 import matplotlib.pyplot as plt import pandas as pd from src.utils import rle_utils as rle import numpy as np # Code modified from https://www.kaggle.com/dschettler8845/sartorius-segmentation-mask-dataset#create_dataset def get_img_and_mask(img_path, annotation, width, height, mask_onl...
{ "alphanum_fraction": 0.682626539, "author": null, "avg_line_length": 35.3709677419, "converted": null, "ext": "py", "file": null, "hexsha": "ebda1c655645b01a0b90c8dcdf7226e2be178583", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import tensorflow_probability as tfp from tensorflow.keras import Model tfd = tfp.distributions tfb = tfp.bijectors def trainable_lu_factorization(event_size, batch_shape=(), seed=...
{ "alphanum_fraction": 0.5693069307, "author": null, "avg_line_length": 37.4845360825, "converted": null, "ext": "py", "file": null, "hexsha": "626358498f51a3f717b84e758e0301e1451ad169", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#coding: utf-8 import pygame from pygame.locals import * import random import sys #import os #import codecs from PIL import Image import numpy as np import cv2 # import module that I made import faceCamera import detectFace CS = 6 # cell size SCR_RECT = Rect(0, 0, 6*int(800/6), 6*int(800/6)) # screen size depends on...
{ "alphanum_fraction": 0.4932053494, "author": null, "avg_line_length": 39.9655172414, "converted": null, "ext": "py", "file": null, "hexsha": "07f499a08994986445ae6a78c851c8bd15746b66", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import tensorflow as tf from ..core.image_warp import image_warp class ImageWarpTest(tf.test.TestCase): def _warp_test(self, first, second, flow, debug=False): num_batch, height, width, channels = second.shape second_ = tf.placeholder(tf.float32, shape=second.shape, name='im') ...
{ "alphanum_fraction": 0.4169611307, "author": null, "avg_line_length": 31.7653061224, "converted": null, "ext": "py", "file": null, "hexsha": "e85ba55aa866df8d2756a7b9e6f8243088da3458", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import pandas as pd import theano import theano.tensor as tt def get_variational_scores(result, config, model, inference, true_pop_size): approx_params = list(inference.approx.shared_params.values()) distance = abs(model.pop_size - true_pop_size)/true_pop_size input_vars = tt.dvectors(le...
{ "alphanum_fraction": 0.7032224532, "author": null, "avg_line_length": 41.8260869565, "converted": null, "ext": "py", "file": null, "hexsha": "9158b33782dc36bb929b1f44d14ca211ddc0bc84", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
function loadData(path::String) datasets = DataFrame[] # Init empty vector if ispath(path) if isfile(path) push!(datasets, CSV.read(path)) return datasets else files = readdir(path) # grab all files in the given folder for f in files ...
{ "alphanum_fraction": 0.5646017699, "author": null, "avg_line_length": 25.6818181818, "converted": null, "ext": "jl", "file": null, "hexsha": "4649451f966b7b3bb8314cd196d2c5e078509f59", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
@reexport module Maze export MazeEnv using ReinforcementLearningBase import Base: * const Actions = [ CartesianIndex(0, -1), # left CartesianIndex(0, 1), # right CartesianIndex(-1, 0), # up CartesianIndex(1, 0), # down ] mutable struct MazeEnv <: AbstractEnv walls::Set{CartesianIndex{2}} ...
{ "alphanum_fraction": 0.6194895592, "author": null, "avg_line_length": 26.2804878049, "converted": null, "ext": "jl", "file": null, "hexsha": "4c8cbc89782f7705c48434944d9612361f4bbe65", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" Generate sample x, y, data of hierarchical structure for bebi103 documentation. """ import numpy as np import pandas as pd def _generate_sample_data(): np.random.seed(3252) J_1 = 3 n = np.array([20, 25, 18]) theta = np.array([3, 7]) tau = np.array([1, 4]) sigma = np.array([2, 3]) rho ...
{ "alphanum_fraction": 0.5487077535, "author": null, "avg_line_length": 22.3555555556, "converted": null, "ext": "py", "file": null, "hexsha": "7e953b4eece94ef933bfb60ed5da0ef2aa91df5b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from ml_logger import logger from cde.model_fitting.GoodnessOfFitResults import GoodnessOfFitResults from cde.evaluation.simulation_eval import base_experiment import cde.model_fitting.ConfigRunner as ConfigRunner import matplotlib.pyplot as plt import numpy as np import pandas as pd EXP_PREFIX = 'question1_noise_re...
{ "alphanum_fraction": 0.694630414, "author": null, "avg_line_length": 51.9078014184, "converted": null, "ext": "py", "file": null, "hexsha": "807162c0ef56b9f90162e85d50f0322e6d219fbb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Test layers in modules.autoregressive. """ # =================================================================...
{ "alphanum_fraction": 0.6148862655, "author": null, "avg_line_length": 38.3756906077, "converted": null, "ext": "py", "file": null, "hexsha": "a679c7eeefb87a97f8de3005b3a20fa7eae56ee5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
struct LinearInterpolant{T,N} y::Array{T,N} Δx::Float64 end function (f::LinearInterpolant)(a::Float64) Δx = f.Δx s = a/(Δx); n₁ = floor(Int64,s); n₂ = ceil(Int64,s); Δn = (s - n₁) (1-Δn)*f.y[n₁+1] + Δn*f.y[n₂+1] end function qnms(;l=0,m=0,n=0,s=0,amax=0.99, ϵ = 0.01) as, ωs, Alms...
{ "alphanum_fraction": 0.5736842105, "author": null, "avg_line_length": 24.5161290323, "converted": null, "ext": "jl", "file": null, "hexsha": "2cfaeb9539a3da73c89337b6bcff4f47d7ea4cd4", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# -*- coding: utf-8 -*- """ Created on Wed Apr 5 16:00:11 2017 @author: lracuna """ import numpy as np import cv2 import glob # termination criteria criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 30, 0.001) # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((6*7,3...
{ "alphanum_fraction": 0.6647307286, "author": null, "avg_line_length": 27.0571428571, "converted": null, "ext": "py", "file": null, "hexsha": "27ea807fbfda4660f366a3144595ea320011170e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
str="Data Science" ;str str1='Data Science';str1 str2="Teacher guide's";str2 str3='Teacher guide"s';str3 str4="Data Science using R" str5='Data Science using python' paste("Hello","World",sep="$") paste(str1,str2,str3,str4,str5,sep=" ") paste(c("something","go's","wrong"),"in LPU",sep="+",collapse="#") for...
{ "alphanum_fraction": 0.6846689895, "author": null, "avg_line_length": 30.2105263158, "converted": null, "ext": "r", "file": null, "hexsha": "c402f03ea7fcda1755a9e85ae6c96e88ad9efb75", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
from collections import OrderedDict from tempfile import TemporaryDirectory from typing import ( Tuple, Union, List, Iterable, Dict, Any, Type, Callable, Optional, Sequence, ) import numpy as np import torch from nebullvm import optimize_torch_model from nebullvm.api.frontend.u...
{ "alphanum_fraction": 0.6392632291, "author": null, "avg_line_length": 38.0574257426, "converted": null, "ext": "py", "file": null, "hexsha": "f12581dc5bdaf922df320cb722ab7f5e9cd4e087", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
C$PRAGMA SUN OPT=2 subroutine tabgen c $Id$ c c ***** computes and tabulates f0(x) to f5(x) ***** c ***** in range x = -0.24 to x = 26.4 ***** c ***** in units of x = 0.08 ***** c ***** the two electron integral sp routines ...
{ "alphanum_fraction": 0.5271580989, "author": null, "avg_line_length": 28.2465753425, "converted": null, "ext": "f", "file": null, "hexsha": "94fc027a80e7b6b10cb813e6bffff07f9e1a23d0", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright 2020 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
{ "alphanum_fraction": 0.6283302559, "author": null, "avg_line_length": 25.7891156463, "converted": null, "ext": "py", "file": null, "hexsha": "d23e858d234635e53e88fe8e93559c0a3484a719", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# =========================================== # # mian Heatmap Library # @author: tbj128 # # =========================================== # # Imports # from scipy.stats import stats from mian.model.otu_table import OTUTable import numpy as np from mian.analysis.alpha_diversity import AlphaDiversity class Heatmap(obj...
{ "alphanum_fraction": 0.5802758621, "author": null, "avg_line_length": 39.8351648352, "converted": null, "ext": "py", "file": null, "hexsha": "ec5bad93306e12afb4ba34a29afded81189e5f27", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# This file conists of the functions which are used in SLMC/Restricted-SLMC training. import numpy as np import numpy.random as rnd from sklearn import linear_model from Configuration import Configuration from Hamiltonian import first_NN_interaction, second_NN_interaction, third_NN_interaction from LocalUpdate import ...
{ "alphanum_fraction": 0.6694571969, "author": null, "avg_line_length": 42.32, "converted": null, "ext": "py", "file": null, "hexsha": "46701c3fa0f21cfc7f180e36d59567caef34ad47", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
ctp 7/27/02 reverse the arguments in arg c ---------------------------------------------------------------------- subroutine ANGULAR_ARRAY_LE_QG(massin,NSANG) implicit none integer n,n1,n2,n3,n4,n5,ndim real*8 theta_s3 real*8 arg(1:3,0:9,1:3),arg_x(0:9),arg_y(0:9) real*8 NSANG(0:9,...
{ "alphanum_fraction": 0.4008169064, "author": null, "avg_line_length": 32.5021645022, "converted": null, "ext": "f", "file": null, "hexsha": "ebe91c040803cb54bb4e79a69634c387d8561592", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from second_step_on_vertex_visit import second_step_on_vertex_visit import numpy as np import pandas as pd from initialize_graph import Vertex, build_graph, find_shortest_path from initialize_graph import Robot from collections import defaultdict import networkx as nx import matplotlib.pyplot as plt from first_step_on...
{ "alphanum_fraction": 0.6719964468, "author": null, "avg_line_length": 39.8495575221, "converted": null, "ext": "py", "file": null, "hexsha": "900a8edbe308980f7ae27c4734f41fcdf6f1c53b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/* * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. */ #include "bgp/routing-instance/service_chaining.h" #include <boost/foreach.hpp> #include <algorithm> #include "base/task_annotations.h" #include "base/task_trigger.h" #include "bgp/bgp_config.h" #include "bgp/bgp_log.h" #include "bgp/bgp_peer_...
{ "alphanum_fraction": 0.6259728806, "author": null, "avg_line_length": 38.0494966443, "converted": null, "ext": "cc", "file": null, "hexsha": "287c625f6108f6c68119cdaef83c308a2808876d", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
import numpy as np from second.core.anchor_generator import ( AnchorGeneratorStride, AnchorGeneratorRange) def build(anchor_config): """Create optimizer based on config. Args: optimizer_config: A Optimizer proto message. Returns: An optimizer and a list of variables for summary. Raises: ...
{ "alphanum_fraction": 0.6830449827, "author": null, "avg_line_length": 32.8409090909, "converted": null, "ext": "py", "file": null, "hexsha": "13b828363dfa816cecf2e182ca5e1d0dfc9b24a0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# ------------------------------------------------------------------------------- # Copyright IBM Corp. 2016 # # 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/licens...
{ "alphanum_fraction": 0.6155021, "author": null, "avg_line_length": 40.921875, "converted": null, "ext": "py", "file": null, "hexsha": "deb809048daeb51e3f4e837d64980c194a21a757", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
!***************************************************************************************** !> author: GasinAn ! ! Simplified Modern Fortran Edition of the DOP853 ODE Solver. ! !### License ! ! Simplified Modern Fortran Edition of the DOP853 ODE Solver ! https://github.com/GasinAn/easydop853 ! !...
{ "alphanum_fraction": 0.6192596716, "author": null, "avg_line_length": 41.2988505747, "converted": null, "ext": "f90", "file": null, "hexsha": "a98b8edd6eec2f778978e13c75f560638b6f4173", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
struct TikzFigure <: AbstractTikzFigure axes::Vector{AbstractTikzAxis} end function TikzFigure() return TikzFigure([EmptyTikzAxis()]) end function EmptyTikzFigure() return TikzFigure() end
{ "alphanum_fraction": 0.7948717949, "author": null, "avg_line_length": 15, "converted": null, "ext": "jl", "file": null, "hexsha": "20b4ac9370813cb68f6a20fa2172b5f14886eacd", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": n...
[STATEMENT] lemma times_inf [simp]: "x * y = x \<sqinter> y" [PROOF STATE] proof (prove) goal (1 subgoal): 1. x * y = x \<sqinter> y [PROOF STEP] by simp
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Stone_Relation_Algebras_Relation_Algebras", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 71, "mathlib_filename": null, "max_forks_count": null, "max_f...
abstract type AbstractBoolDomain <: AbstractDomain end """ struct BoolDomain <: AbstractDomain Boolean domain, uses a IntDomain in it. (true is 1 and false is 0) """ struct BoolDomain <: AbstractBoolDomain inner::IntDomain function BoolDomain(trailer::Trailer) return new(IntDomain(tr...
{ "alphanum_fraction": 0.6486908949, "author": null, "avg_line_length": 23.4770642202, "converted": null, "ext": "jl", "file": null, "hexsha": "bcef5df773a7f0322d15b686162609329fbc7f27", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
[STATEMENT] lemma lspasl_starr_der: "(h1,h2\<triangleright>h0) \<Longrightarrow> \<not> ((A ** B) h0) \<Longrightarrow> ((h1,h2\<triangleright>h0) \<and> \<not> ((A h1) \<or> ((A ** B) h0)) \<and> (starr_applied h1 h2 h0 (A ** B))) \<or> ((h1,h2\<triangleright>h0) \<and> \<not> ((B h2) \<or> ((A ** B) h0)) \<an...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Separata_Separata", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 394, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_m...
import os import sys import json import pickle import random import torch # from torch.utils.tensorboard.summary import image from tqdm import tqdm import matplotlib.pyplot as plt import numpy as np import pylab as pl from mpl_toolkits.axes_grid1.inset_locator import inset_axes import torchvision.transforms.function...
{ "alphanum_fraction": 0.6143327068, "author": null, "avg_line_length": 40, "converted": null, "ext": "py", "file": null, "hexsha": "95bf2cc99700a54292e148ea4070c366ae1bb889", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
import argparse import asyncio import functools import io import json import re import subprocess import time from concurrent.futures import ThreadPoolExecutor from pathlib import Path from threading import Thread import janus import numpy as np import tesserocr import websockets from skimage.color import rgb2gray fr...
{ "alphanum_fraction": 0.6319582057, "author": null, "avg_line_length": 29.8440860215, "converted": null, "ext": "py", "file": null, "hexsha": "131d84a848ca0f6032fc44895d3af45614514888", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Pipeline.py # Author: Marcus D. Bloice <https://github.com/mdbloice> # Licensed under the terms of the MIT Licence. """ The Pipeline module is the user facing API for the Augmentor package. It contains the :class:`~Augmentor.Pipeline.Pipeline` class which is used to create pipeline objects, which can be used to buil...
{ "alphanum_fraction": 0.6418237941, "author": null, "avg_line_length": 44.9273182957, "converted": null, "ext": "py", "file": null, "hexsha": "76ff447ed1660b7fdca3e6b2265273554a44afd4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import cv2 import matplotlib.pyplot as plt from scipy.fftpack import fft2, ifft2, fftshift, ifftshift from scipy.stats import multivariate_normal from scipy.ndimage import rotate from .image_io import crop_patch from .utils import pre_process, rotateImage, plot ######################################...
{ "alphanum_fraction": 0.5663734915, "author": null, "avg_line_length": 39.4274193548, "converted": null, "ext": "py", "file": null, "hexsha": "4c3479b2d76a8a8df041a730ca2f64e730bb73b9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
// example/stopwatch_example.cpp ---------------------------------------------------// // Copyright Beman Dawes 2006, 2008 // Copyright 2009-2011 Vicente J. Botet Escriba // Distributed under the Boost Software License, Version 1.0. // See http://www.boost.org/LICENSE_1_0.txt // See http://www.boost.org/libs/chr...
{ "alphanum_fraction": 0.6587622903, "author": null, "avg_line_length": 28.3442622951, "converted": null, "ext": "cpp", "file": null, "hexsha": "2c775332a51e4c99530331b11e7e951cb405c6ba", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
[STATEMENT] lemma antisymPI: "(\<And>x y. \<lbrakk> r x y; r y x \<rbrakk> \<Longrightarrow> x = y) \<Longrightarrow> antisymp r" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (\<And>x y. \<lbrakk>r x y; r y x\<rbrakk> \<Longrightarrow> x = y) \<Longrightarrow> antisymp r [PROOF STEP] by (fact antisympI)
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "JinjaThreads_MM_Orders", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 132, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_ev...
[STATEMENT] lemma assign_eval\<^sub>w_const\<^sub>C: shows "(\<langle>x \<leftarrow> Const c, mds, mem\<rangle>, \<langle>Stop, mds, mem (x := c)\<rangle>) \<in> C.eval\<^sub>w" [PROOF STATE] proof (prove) goal (1 subgoal): 1. eval_abv\<^sub>C \<langle>x \<leftarrow> aexp\<^sub>C.Const c, mds, mem\<rangle>\<^sub>C \...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Dependent_SIFUM_Refinement_Examples_Eg1Eg2", "hexsha": null, "include": null, "lang": null, "length": 7, "llama_tokens": 1113, "mathlib_filename": null, "max_forks_count": null, "ma...
import numpy as np from numba import cuda, int32, float32 from numba.cuda.testing import unittest, CUDATestCase from numba.core.config import ENABLE_CUDASIM def useless_sync(ary): i = cuda.grid(1) cuda.syncthreads() ary[i] = i def simple_smem(ary): N = 100 sm = cuda.shared.array(N, int32) i ...
{ "alphanum_fraction": 0.6040400078, "author": null, "avg_line_length": 30.1715976331, "converted": null, "ext": "py", "file": null, "hexsha": "163976e072605bd1631cd1ba862a5d6647e8c843", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from flearn.servers.server import Server import numpy as np class qFFL(Server): def __init__(self, q, L, train_data, ids, Learner, initial_params, learning_rate): self.L = L self.q = q super(qFFL, self).__init__(train_data, ids, Learner, initial_params, learning_rate) def trai...
{ "alphanum_fraction": 0.6152606126, "author": null, "avg_line_length": 47.7179487179, "converted": null, "ext": "py", "file": null, "hexsha": "13ec6878ba9dd99ffd8b2a17ec2c5bfc193b57ea", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
% DEMSPGP1D2 Do a simple 1-D regression after Snelson & Ghahramani's example. % GP % Fix seeds randn('seed', 2e5); rand('seed', 2e5); seedVal = 2e5; dataSetName = 'spgp1d'; experimentNo = 2; % load data [X, y] = mapLoadData(dataSetName, seedVal); % Set up model options = gpOptions('fitc'); options.numActive = 9; %...
{ "alphanum_fraction": null, "author": "SheffieldML", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max...
FFT_TYPE = "scipy" import os import pathlib import warnings import numpy as np import scipy.signal from scipy.io import wavfile from ..parameter import Parameter from ..processor import Processor from ..parameter_list import ParameterList if FFT_TYPE == "scipy": from scipy.fftpack import fft, ifft else: ...
{ "alphanum_fraction": 0.584175671, "author": null, "avg_line_length": 45.5396825397, "converted": null, "ext": "py", "file": null, "hexsha": "432306f4b7fc108577eabddefd8c48e2e119b11e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# -*- coding: utf-8 -*- # # Copyright 2018-2020 Data61, CSIRO # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
{ "alphanum_fraction": 0.6067741935, "author": null, "avg_line_length": 39.0756302521, "converted": null, "ext": "py", "file": null, "hexsha": "dd87420fdd9ed9e6c9dfd668f83dc1e3aaef8be7", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- from ..io.spec import spec import h5py import numpy as np import matplotlib.pyplot as plt from scipy import interpolate from ..math.utils import logscale import warnings def show( x, y, images, xp, yp, xlabel, ylabel, names, transpose=False, flipvert=Fa...
{ "alphanum_fraction": 0.5020799193, "author": null, "avg_line_length": 25.7564935065, "converted": null, "ext": "py", "file": null, "hexsha": "cafa40005ee431747842024f1a01a763d9993d4d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
Require Import ssr. Require Import lib. Require Import withzero. Set Implicit Arguments. Unset Strict Implicit. Import Prenex Implicits. Open Scope dnat_scope. Module Type GALOIS. (* -------------------------------------------------------------------------- *) (* Rings ...
{ "alphanum_fraction": null, "author": "kallol26", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_da...
[STATEMENT] lemma read_point: assumes "point p" and "mapping x" shows "point (x[[p]])" [PROOF STATE] proof (prove) goal (1 subgoal): 1. point (x[[p]]) [PROOF STEP] using assms comp_associative read_injective read_surjective [PROOF STATE] proof (prove) using this: point p coreflexive (x[[x]]) \<and> times_top_c...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Relational_Disjoint_Set_Forests_Disjoint_Set_Forests", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 250, "mathlib_filename": null, "max_forks_count": nu...
#include <Eigen/Dense> #include <iostream> #include <fstream> #include <boost/dynamic_bitset.hpp> #include <boost/container/vector.hpp> #include <boost/unordered_map.hpp> #include <boost/random/uniform_01.hpp> #include <boost/random/niederreiter_base2.hpp> #include <./Timer.cpp> typedef boost::dynamic_bitset<> Vetor; ...
{ "alphanum_fraction": 0.5859899329, "author": null, "avg_line_length": 27.9921722114, "converted": null, "ext": "cpp", "file": null, "hexsha": "b70be8a5d9602e682ae5ccd0cc4b8fdead4fd1db", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
\subsection{Surface integral for vector fields}
{ "alphanum_fraction": 0.7843137255, "author": null, "avg_line_length": 10.2, "converted": null, "ext": "tex", "file": null, "hexsha": "c5162a1d42bd9fbed8682137406040af9b0d5900", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2019-12-04 15:13 qiang.zhou <theodoruszq@gmail.com> # # Distributed under terms of the MIT license. """ """ import cv2 from PIL import Image import random import numpy as np import torch import torchvision.transforms.functional as TF de...
{ "alphanum_fraction": 0.6429798197, "author": null, "avg_line_length": 36.9682539683, "converted": null, "ext": "py", "file": null, "hexsha": "dfd4614d0cc9d43846559d9d421f60c0c12c3a2e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
using Polyhedra include("simplex.jl") include("permutahedron.jl") include("board.jl") myeq(x::Real, y::Real) = myeq(promote(x, y)...) myeq{T<:Real}(x::T, y::T) = x == y myeq{T<:AbstractFloat}(x::T, y::T) = y < x+1024*eps(T) && x < y+1024*eps(T) myeq{S<:Real,T<:Real}(x::Vector{S}, y::Vector{T}) = myeq(promote(x, y)......
{ "alphanum_fraction": 0.6054216867, "author": null, "avg_line_length": 27.6666666667, "converted": null, "ext": "jl", "file": null, "hexsha": "7ae7ba711d2ceb53a085cbfca2efd852ec8a4fff", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import numpy as np import matplotlib.pyplot as plt import matplotlib from matplotlib import rc # TO MANAGE MATPLOTLIB PARAMETERS" rc('font',family='serif') rc('text',usetex = True) import scipy.optimize as optimization logeVe,logr,logAcce,logtcelle,logAdve,logDiffe,logEmaxHe,logSye,logIC,logBr = np.loadtxt('e...
{ "alphanum_fraction": 0.6415929204, "author": null, "avg_line_length": 41.0909090909, "converted": null, "ext": "py", "file": null, "hexsha": "313c221fc7b1155fbbff10a47e3b459bcb176336", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" This module contains the tests for timeconv function """ # Standard library imports # Third party imports from pytest import approx #https://www.scivision.dev/pytest-approx-equal-assert-allclose/ import numpy as np from pathlib import Path import sys from numpy import rad2deg, deg2rad # Local application import...
{ "alphanum_fraction": 0.6850341046, "author": null, "avg_line_length": 38.7409326425, "converted": null, "ext": "py", "file": null, "hexsha": "263498d088831b05d0d60639d4696feedf39cb0b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import sys import json from pathlib import Path import logging import gc import click import numpy as np import torch from data import Vocab, Dataset from model import MultiClassModel from config import Config logger = logging.getLogger(__name__) LOG_FORMAT = '[%(asctime)s] [%(levelname)s] %(message)s (%(funcName)s@...
{ "alphanum_fraction": 0.6450471698, "author": null, "avg_line_length": 32.932038835, "converted": null, "ext": "py", "file": null, "hexsha": "c8f5bd519cfa12ee7a74e2d9c1105cc5aa793de4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import numpy as np import matplotlib.pyplot as plt def plot_nodes(graph, color='r'): for node in range(len(graph.x_of_node)): x, y = graph.x_of_node[node], graph.y_of_node[node] plt.plot(graph.x_of_node[node], graph.y_of_node[node], 'o', color=color) plt.text(x, y, node, c...
{ "alphanum_fraction": 0.598073999, "author": null, "avg_line_length": 30.828125, "converted": null, "ext": "py", "file": null, "hexsha": "7a9df278290b2ba4d3afc908f911a7427c709652", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_co...
import time import numpy as np import vpi import cv2 from threading import Thread from PIL import Image from jetvision.elements import Camera MAX_DISP = 64 WINDOW_SIZE = 10 def get_calibration() -> tuple: fs = cv2.FileStorage( "calibration/rectify_map_imx219_160deg_1080p.yaml", cv2.FILE_STORAGE_READ ...
{ "alphanum_fraction": 0.5068780602, "author": null, "avg_line_length": 29.3767123288, "converted": null, "ext": "py", "file": null, "hexsha": "1b75e5a59786ebb60325ebed64ad38e6a155314d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. """ signal """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import numpy as np from onnx import onnx_pb from onnx.numpy_helper import to_array...
{ "alphanum_fraction": 0.5806341241, "author": null, "avg_line_length": 36.9957805907, "converted": null, "ext": "py", "file": null, "hexsha": "0d53ece16420e68c069f6ba34fbf9be4fa60c449", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
{ "alphanum_fraction": 0.6587664192, "author": null, "avg_line_length": 36.8631578947, "converted": null, "ext": "py", "file": null, "hexsha": "768e37560dbf4b45264ad4d78d06e177e9ec95d9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#pragma once #include <Eigen/Dense> #include <Eigen/Sparse> #include <cstdlib> namespace edp { template<typename T, class ColFunc> auto constructMat(size_t dim, ColFunc&& colFunc) -> Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> { Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> res(dim, dim); res.setZero(...
{ "alphanum_fraction": 0.5694444444, "author": null, "avg_line_length": 25.2467532468, "converted": null, "ext": "hpp", "file": null, "hexsha": "c436d83efe656b084ed12df20a43f5dc7e96e08e", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
Glacier Point Apartments is a quiet and friendly community located in an optimal area of West Davis. Residents enjoy a fitness center, pool and spa, barbeque spot, media loft and internet lounge with free WiFi. With quick freeway access, walking distance to shopping, restaurants and more, and a bike path and bus li...
{ "alphanum_fraction": 0.7944322029, "author": null, "avg_line_length": 218.9058823529, "converted": null, "ext": "f", "file": null, "hexsha": "37d56945d91fbcc4517edac807c9bd55455da093", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fo...
#!/usr/bin/env python # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 ai : """Identify and flag sources as either stellar sources, extended sources or anomalous sources Anomalous sources fall into several categories: - Saturated sources: the pixel values in the cores of these sources are maxed out at the detect...
{ "alphanum_fraction": 0.5315963275, "author": null, "avg_line_length": 44.1934770591, "converted": null, "ext": "py", "file": null, "hexsha": "b7b95102ce568cc4d0294700e0420cce7afa80bf", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/* * Copyright 2014 Antony Polukhin * Copyright 2015 Andrey Semashev * * Distributed under the Boost Software License, Version 1.0. * See http://www.boost.org/LICENSE_1_0.txt */ #ifndef BOOST_WINAPI_CRYPT_HPP_INCLUDED_ #define BOOST_WINAPI_CRYPT_HPP_INCLUDED_ #include <boost/winapi/basic_types.hpp> #include <bo...
{ "alphanum_fraction": 0.7613983783, "author": null, "avg_line_length": 31.0867768595, "converted": null, "ext": "hpp", "file": null, "hexsha": "98c5958b432579bacdb8ac1642d247f79a94d278", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
from ..data import DATA_PATH from .. import simple_cov import pytest from pyuvdata import UVData import os import numpy as np @pytest.fixture def sky_model(): uvd = UVData() uvd.read_uvh5( os.path.join( DATA_PATH, "Garray_antenna_diameter2.0_fractional_spacing1.0_nant6_nf200_df...
{ "alphanum_fraction": 0.6354790419, "author": null, "avg_line_length": 29.0434782609, "converted": null, "ext": "py", "file": null, "hexsha": "4b60a15ddc160dc1b28a093ef2568d7975072c4a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Forced DA Analysis ------------------ Top-level script to run the forced DA analysis, following the procedure described in `CarlierForcedDA2019`_. Arguments: *--Required--* - **beam** *(int)*: Beam to use. Flags: **['-b', '--beam']** Choices: ``[1, 2]`` - **energy** *(MultiClass)*: Beam energy in GeV. F...
{ "alphanum_fraction": 0.6332804015, "author": null, "avg_line_length": 35.447533009, "converted": null, "ext": "py", "file": null, "hexsha": "e12e962e29477d438462ea394ddccc482d4b42f8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import os import scipy.io import numpy as np from collections import OrderedDict import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable import torch import time import sys sys.path.insert(0, '../prroi_pool') from modules.prroi_pool import PrRoIPool2D def append_params(params, mo...
{ "alphanum_fraction": 0.5364779874, "author": null, "avg_line_length": 36.1363636364, "converted": null, "ext": "py", "file": null, "hexsha": "71dc0de1f9b4e56ed28314886c45b7d5949d386e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import functools import pickle import random from baselines.common.vec_env import VecEnvWrapper import gym import numpy as np import os.path as osp import tensorflow as tf from rllab.envs.base import Env, EnvSpec import rllab.misc.logger as rl_logger from sandbox.rocky.tf.envs.base import TfEnv, to_tf_space from rlla...
{ "alphanum_fraction": 0.6176670827, "author": null, "avg_line_length": 38.0691144708, "converted": null, "ext": "py", "file": null, "hexsha": "447354c5e894cea53e3b76fd46177f39196e18f2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma scene_union_foldr_remove_element: assumes "set xs \<subseteq> set Vars" shows "a \<squnion>\<^sub>S \<Squnion>\<^sub>S xs = a \<squnion>\<^sub>S \<Squnion>\<^sub>S (removeAll a xs)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. a \<squnion>\<^sub>S \<Squnion>\<^sub>S xs = a \<squnion>\<^sub>S ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Optics_Scene_Spaces", "hexsha": null, "include": null, "lang": null, "length": 15, "llama_tokens": 2475, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_eve...
import torch as tc import torch.nn as nn import torch.nn.functional as F from transformers import BertModel , BertTokenizer import pdb import math def loss_1(pred , anss , ents , no_rel , class_weight , pad_ix = -100): ''' 直接平均,按类别加权 and unweighted avg ''' import numpy as np bs , ne , _ , d = pred.size() if...
{ "alphanum_fraction": 0.6378865979, "author": null, "avg_line_length": 26.7586206897, "converted": null, "ext": "py", "file": null, "hexsha": "efa88fa24b2ca0d4e8b1227f03037e819e86c2d3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np import itertools from .displacements import Displacements from .kvectors import Kvectors class Lattice(): """Class to generate the lattice.""" __vecsLattice = np.array([], dtype=np.float) __vecsBasis = np.array([], dtype=np.float) __idxBasis = np.array([]) __idxSub = np.array(...
{ "alphanum_fraction": 0.6054194637, "author": null, "avg_line_length": 39.6281337047, "converted": null, "ext": "py", "file": null, "hexsha": "eaa97c9cd1b48d772d2a8e83836abe3955cebb1a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Created byMartin.cz # Copyright (c) Martin Strohalm. All rights reserved. import numpy # comparison with tolerance def equals(v1, v2, epsilon): """ Returns True if difference between given values is less then tolerance. Args: v1: float Value one. v2: float ...
{ "alphanum_fraction": 0.5142696866, "author": null, "avg_line_length": 21.8058103976, "converted": null, "ext": "py", "file": null, "hexsha": "cc9973f62074bef567e5b0023d2295010a56f7c1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{parskip} \usepackage{svg} \usepackage[utf8]{inputenc} \usepackage{helvet} \renewcommand{\familydefault}{\sfdefault} \usepackage{geometry} \usepackage[document]{ragged2e} \geometry{letterpaper, portrait, top=1in, bottom=1in, left=1.5in, right...
{ "alphanum_fraction": 0.6513133555, "author": null, "avg_line_length": 31.5034965035, "converted": null, "ext": "tex", "file": null, "hexsha": "16c02f5d22325d2c13452c444b937edd909dc2cc", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#include"Character.h" #include "Kobieta.h" #include "Julek.h" #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_SUITE(CharacterTest) Kobieta K(32,32,5); Julek J(56,78,8); BOOST_AUTO_TEST_CASE(KobietaInitializingLivesChecking) { BOOST_CHECK_EQUAL(K.getLives(),5); } BOOST_AUTO_TEST_CASE(KobietaIniti...
{ "alphanum_fraction": 0.7128851541, "author": null, "avg_line_length": 21.6363636364, "converted": null, "ext": "cpp", "file": null, "hexsha": "b88553c881680ca591224f688ec13fcb11bd15cf", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#! /usr/bin/env python """ Phase_function class definition """ from __future__ import division, print_function __author__ = 'Julien Milli' __all__ = [] import numpy as np import matplotlib.pyplot as plt from scipy.interpolate import interp1d class Phase_function(object): """ This class represents the scatterin...
{ "alphanum_fraction": 0.561549101, "author": null, "avg_line_length": 41.0059701493, "converted": null, "ext": "py", "file": null, "hexsha": "d9f99a5168ebd697c80e27e81f7d99ca54bba56a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
[STATEMENT] lemma empty_fv_exists_fun: "fv t = {} \<Longrightarrow> \<exists>f X. t = Fun f X" [PROOF STATE] proof (prove) goal (1 subgoal): 1. fv t = {} \<Longrightarrow> \<exists>f X. t = Fun f X [PROOF STEP] by (cases t) auto
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Stateful_Protocol_Composition_and_Typing_Messages", "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 94, "mathlib_filename": null, "max_forks_count": null, ...
import pathlib import torch import numpy as np import gvision_utils import img_utils class PretrainedModel(): def __init__(self, modelname): model_pt = model_class_dict[modelname](pretrained=True) #model.eval() self.model = nn.DataParallel(model_pt.cuda()) self.model.eval() ...
{ "alphanum_fraction": 0.6284820921, "author": null, "avg_line_length": 33.5047619048, "converted": null, "ext": "py", "file": null, "hexsha": "34899bd8875a66fd881bc6443c43c2a74b2aa7c3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
__precompile__() module DataProcessingHierarchyTools using ProgressMeter using Glob using MAT using StrTables, LaTeX_Entities using StableHashes import StableHashes.shash import Base:filter,show, convert include("types.jl") const def = LaTeX_Entities.default function git_annex() cmd = nothing try cmd...
{ "alphanum_fraction": 0.5686418394, "author": null, "avg_line_length": 26.9851485149, "converted": null, "ext": "jl", "file": null, "hexsha": "f7a27164a0a9b1a7c6c0194dd38421d282d5b10d", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
(* Default settings (from HsToCoq.Coq.Preamble) *) Generalizable All Variables. Unset Implicit Arguments. Set Maximal Implicit Insertion. Unset Strict Implicit. Unset Printing Implicit Defensive. Require Coq.Program.Tactics. Require Coq.Program.Wf. (* Preamble *) Require String BitTerminationProofs. Import String....
{ "alphanum_fraction": null, "author": "plclub", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_date...
[STATEMENT] lemma monad_alt_optionT' [locale_witness]: "monad_alt return (bind :: ('a option, 'm) bind) alt \<Longrightarrow> monad_alt return (bind :: ('a, ('a, 'm) optionT) bind) alt" [PROOF STATE] proof (prove) goal (1 subgoal): 1. monad_alt Monad_Overloading.return Monad_Overloading.bind alt \<Longrightarrow> ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Monomorphic_Monad_Monad_Overloading", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 273, "mathlib_filename": null, "max_forks_count": null, "max_forks_...
import gym import numpy as np import dso.task.control # Registers custom and third-party environments from dso.program import Program, from_str_tokens from dso.library import Library from dso.functions import create_tokens import dso.task.control.utils as U REWARD_SEED_SHIFT = int(1e6) # Reserve the first million s...
{ "alphanum_fraction": 0.6373375883, "author": null, "avg_line_length": 33.6168582375, "converted": null, "ext": "py", "file": null, "hexsha": "2445d9b4e43f0ca35d924e067b2e8c34f1e13842", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from collections import Counter import os from argparse import Namespace flags = Namespace( train_file='dane_disco.txt', seq_size=3, batch_size=120, embedding_size=84, lstm_size=384, g...
{ "alphanum_fraction": 0.5347743308, "author": null, "avg_line_length": 37.9957446809, "converted": null, "ext": "py", "file": null, "hexsha": "1006d6b801cbf64e8668487910e65f5b1517e75c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/********************************************************************** * Copyright (c) 2008-2014, Alliance for Sustainable Energy. * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published ...
{ "alphanum_fraction": 0.6366915743, "author": null, "avg_line_length": 29.1804511278, "converted": null, "ext": "hpp", "file": null, "hexsha": "4f97eebc40515552ee42816c3b0e9faf7b584e0d", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
''' All the functions linked to the prediction behaviour of the robot ''' import algebra as alg from math import sqrt,cos,sin,acos,pi,atan2 import numpy as np deltaT = 0.4 #s def predictionNextPosition(linearSpeed,position): ''' Return the predicted next position of the robot Considering...
{ "alphanum_fraction": 0.6502826247, "author": null, "avg_line_length": 38.0280373832, "converted": null, "ext": "py", "file": null, "hexsha": "7005e066dab9d5308d5a6191bcc6107d3eca0b66", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import tensorflow as tf from tensorflow.contrib.layers import xavier_initializer from tensorflow.examples.tutorials.mnist import input_data import numpy as np import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec import os import imageio initializer = xavier_initializer() # 为生成器生成随机噪声 Z = tf.placeho...
{ "alphanum_fraction": 0.6897679952, "author": null, "avg_line_length": 26.896, "converted": null, "ext": "py", "file": null, "hexsha": "b75bb37f1676249ed027d88d0665886761ca6d54", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
import unittest import numpy as np from sklearn.metrics import pairwise_kernels from skactiveml.pool._quire import ( _del_i_inv, _L_aa_inv, _one_versus_rest_transform, Quire, ) from skactiveml.utils import MISSING_LABEL, is_labeled, is_unlabeled class TestQuire(unittest.TestCase): def setUp(self...
{ "alphanum_fraction": 0.5952380952, "author": null, "avg_line_length": 37.125, "converted": null, "ext": "py", "file": null, "hexsha": "fd7d331b7aab98290968dc1a676e4a5dadb50cb3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
import numpy as np import spikeextractors as se class OutputRecordingExtractor(se.RecordingExtractor): def __init__(self, *, base_recording, block_size): super().__init__() self._base_recording = base_recording self._block_size = block_size self.copy_channel_properties(recording=sel...
{ "alphanum_fraction": 0.5899688297, "author": null, "avg_line_length": 38.7802197802, "converted": null, "ext": "py", "file": null, "hexsha": "6ca809dee9e660c2feb96510a260bd5b6dbd3d29", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma has_white_path_to_refl[iff]: "(x has_white_path_to x) s" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (x has_white_path_to x) s [PROOF STEP] unfolding has_white_path_to_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. (\<lambda>x y. (x points_to y) s \<and> white y s)\<^sup>*\<^sup>* x x [...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "ConcurrentGC_Global_Invariants_Lemmas", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 158, "mathlib_filename": null, "max_forks_count": null, "max_fork...
import torch import numpy as np from sklearn.mixture import GaussianMixture from torch import nn import os from torch.utils.data import DataLoader from sklearn.cluster import KMeans from torch.autograd import Variable from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score from python_research.io ...
{ "alphanum_fraction": 0.5823313413, "author": null, "avg_line_length": 46.4515050167, "converted": null, "ext": "py", "file": null, "hexsha": "9603d860a3c81fde962e79d06e39a8bfaecd16b4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
//======================================================================= // Copyright 2001 University of Notre Dame. // Copyright 2006 Trustees of Indiana University // Authors: Jeremy G. Siek and Douglas Gregor <dgregor@cs.indiana.edu> // // Distributed under the Boost Software License, Version 1.0. (See // acc...
{ "alphanum_fraction": 0.6190547381, "author": null, "avg_line_length": 37.7300564061, "converted": null, "ext": "hpp", "file": null, "hexsha": "aadf90407b8b22e172cbefc8b8d692a687b25c7f", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import gym import numpy as np import random import simple_memory_testing_env import matplotlib.pyplot as plt rotate_right = 1 rotate_left = 0 forward = 2 def test_env(): env = gym.make(f"SimpleMemoryTestingEnv-v0") obs = env.reset() #env.render() obs = env.step(forward) obs = env.step(...
{ "alphanum_fraction": 0.584627964, "author": null, "avg_line_length": 16.527027027, "converted": null, "ext": "py", "file": null, "hexsha": "5386a4f595c20a63b86a0832b636d2617225ee84", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
[STATEMENT] lemma Exit_not_dyn_standard_control_dependent: assumes control:"n controls\<^sub>s (_Exit_) via as" shows "False" [PROOF STATE] proof (prove) goal (1 subgoal): 1. False [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal): 1. False [PROOF STEP] from control [PROOF STATE] proof (chain) picki...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Slicing_Basic_DynStandardControlDependence", "hexsha": null, "include": null, "lang": null, "length": 13, "llama_tokens": 838, "mathlib_filename": null, "max_forks_count": null, "ma...
/* ***************************************************** THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT EDIT. ***************************************************** Generated by: gltbx.generate_defines_bpl */ #include <boost/python/def.hpp> #include <boost/python/scope.hpp> #include <gltbx/include_open...
{ "alphanum_fraction": 0.7311210381, "author": null, "avg_line_length": 26.7863247863, "converted": null, "ext": "cpp", "file": null, "hexsha": "0fb841a6a18ff91aee202f5c33ae80bc9066fd1f", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import pickle import os import torch import time import numpy as np from torch import nn import matplotlib.pyplot as plt from regretnet import ibp from regretnet.mipcertify.mip_solver import MIPNetwork from regretnet.regretnet import RegretNet, calc_agent_util, optimize_misreports, tiled_misreport_util from regretnet....
{ "alphanum_fraction": 0.7173061224, "author": null, "avg_line_length": 45.3703703704, "converted": null, "ext": "py", "file": null, "hexsha": "88574781cb5cda87453d7ccf566b1cd556e28f98", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import scipy.io as sio import numpy as np from skimage import data, io import cv2 M = sio.loadmat('M.mat') M = M['M'] # cv2.imshow('M', M) # cv2.waitKey(0) # # A = cv2.imread('kodim11.JPG', 3) # print type(A) # cv2.imshow('Aasd', A) # cv2.waitKey(0) Dict = sio.loadmat('Dict.mat') Dict = Dict['Dict'] # normalized = np...
{ "alphanum_fraction": 0.5842259007, "author": null, "avg_line_length": 24.4523809524, "converted": null, "ext": "py", "file": null, "hexsha": "100b202f62481dcd275fb0a153e03db913a81709", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
"""Reads the text data stored as sparse matrix.""" import numpy as np import scipy.sparse as sp from sklearn.model_selection import train_test_split import pandas as pd def removeFirstColumn(data): new_data = [] for i in range(len(data)): new_data.append(data[i][1:]) new_data = np.array(new_data) ...
{ "alphanum_fraction": 0.5903465347, "author": null, "avg_line_length": 33.6666666667, "converted": null, "ext": "py", "file": null, "hexsha": "c24014cb944377060ce705b220410f6c20955b1f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma satisifies_atom_restrict_to_Cons: "v \<Turnstile>\<^sub>a\<^sub>s restrict_to I (set as) \<Longrightarrow> (i \<in> I \<Longrightarrow> v \<Turnstile>\<^sub>a a) \<Longrightarrow> v \<Turnstile>\<^sub>a\<^sub>s restrict_to I (set ((i,a) # as))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbr...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Simplex_Simplex", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 377, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max...
import numpy as np from sympy import symbols from . import example_smooth_reservoir_models as ESRM from .smooth_model_run import SmoothModelRun def critics(): symbs = symbols("t k_01 k_10 k_0o k_1o") t, k_01, k_10, k_0o, k_1o = symbs srm = ESRM.critics(symbs) pardict = {k_0o: 0.01, k_1o: 0.08, k_01: ...
{ "alphanum_fraction": 0.6038674033, "author": null, "avg_line_length": 30.1666666667, "converted": null, "ext": "py", "file": null, "hexsha": "73e6d49701842df30038213a510474181808b907", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np class TransReplayBuffer(object): def __init__(self, size): self.size = size self.buffer = [] def get_single(self, index): return self.buffer[index] def offset(self): self.buffer.pop(0) def get_batch(self, batch_size): return self.get_trunc...
{ "alphanum_fraction": 0.6208684381, "author": null, "avg_line_length": 26.1525423729, "converted": null, "ext": "py", "file": null, "hexsha": "bbaf52e95d5e623d7467fb62bb1eb337bcd217a4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\chapter{Additional link functions for neural networks}
{ "alphanum_fraction": 0.8103448276, "author": null, "avg_line_length": 14.5, "converted": null, "ext": "tex", "file": null, "hexsha": "bbd51b0e5311ba6c3119e28328713fbf511a9617", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": ...
#!/usr/bin/env python import numpy class Point: def __init__(self, x, y): self.x = x self.y = y def euclideanDist(p1, p2): from math import sqrt return sqrt((p1.x-p2.x)**2 + (p1.y-p2.y)**2) def getMinDist(p1, precision=0.001, startX=0, endX=3): """Get x of point on (x,x^2) that has m...
{ "alphanum_fraction": 0.5972540046, "author": null, "avg_line_length": 26.4848484848, "converted": null, "ext": "py", "file": null, "hexsha": "c54672db672bf9b2057afeb9fe8fffc7697bc14c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | +---------...
{ "alphanum_fraction": 0.6209224557, "author": null, "avg_line_length": 32.1698240866, "converted": null, "ext": "cpp", "file": null, "hexsha": "e91d36f9f727e3d1d7dd2f257a3345c42acabf4e", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# -*- coding: utf-8 -*- import numpy as np import os from knn_practice.knn_1 import classify0 # 把32✖️32的二进制图像矩阵转换为1✖️1024的向量 def img2vector(filename): return_vect = np.zeros((1, 1024)) with open(filename) as fr: for i in range(32): line_str = fr.readline() for j in range(32): ...
{ "alphanum_fraction": 0.6256599789, "author": null, "avg_line_length": 32.1016949153, "converted": null, "ext": "py", "file": null, "hexsha": "dfaf9e9d24831e16fd3b86f7d4fa5338d335903f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" This script defines some functions used for visualize the final results. """ import numpy as np import matplotlib.pyplot as plt import torch from modules.model import Net def import_best_model(best_model, category, phi, theta): """ Argumnets: best_model: .pth file containing model parameters ...
{ "alphanum_fraction": 0.5678370178, "author": null, "avg_line_length": 28.1341463415, "converted": null, "ext": "py", "file": null, "hexsha": "4720629639023fa0fea3869b630730c1a790bde9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...