text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
# Author: Meduri Venkata Shivaditya
# Bernoulli mixture model for mnist digits
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from scipy.stats import bernoulli as bern
import warnings
warnings.filterwarnings("ignore")
def bernoulli_mixture_pmf(data, means, K):
'''To comp... | {"hexsha": "2e1ca83e3b55fb208fb87571648a2fa0fedf146a", "size": 5382, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/mixBerMnistEM.py", "max_stars_repo_name": "VaibhaviMishra04/pyprobml", "max_stars_repo_head_hexsha": "53208f571561acd25e8608ac5d1eb5e2610f6cc0", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma Lcm_fin_dvd_iff:
"Lcm\<^sub>f\<^sub>i\<^sub>n A dvd b \<longleftrightarrow> (\<forall>a\<in>A. a dvd b)" if "finite A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (Lcm\<^sub>f\<^sub>i\<^sub>n A dvd b) = (\<forall>a\<in>A. a dvd b)
[PROOF STEP]
using that
[PROOF STATE]
proof (prove)
using this... | {"llama_tokens": 253, "file": null, "length": 2} |
import os
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pytest
class TestExonJunctionAdjacencies(object):
@pytest.fixture
def snap25_exon(self, db, snap25_exon_id):
return db[snap25_exon_id]
@pytest.fixture
def adjacencies(self, junction_metadata, db):
... | {"hexsha": "38acd920f57fcdee6c54620aab1e76aade316724", "size": 5590, "ext": "py", "lang": "Python", "max_stars_repo_path": "outrigger/tests/index/test_adjacencies.py", "max_stars_repo_name": "gokceneraslan/outrigger", "max_stars_repo_head_hexsha": "6729fb179498fbb69078866e502eefb6c56d3205", "max_stars_repo_licenses": [... |
import cv2
import sys
import numpy as np
from model import EMR
# prevents opencl usage and unnecessary logging messages
cv2.ocl.setUseOpenCL(False)
EMOTIONS = ['Angry', 'Disgusted', 'Fearful', 'Happy', 'Sad', 'Surprised', 'Neutral']
# Initialize object of EMR class
network = EMR()
network.build_network()... | {"hexsha": "ed3e1a72950a2fb440d0cfbf26c83329352f075b", "size": 1829, "ext": "py", "lang": "Python", "max_stars_repo_path": "multiface.py", "max_stars_repo_name": "DurgaBhavani695/EmotionDetection", "max_stars_repo_head_hexsha": "fb19417351485ed9d075620533245141e5d013f8", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
The DavisDixon Bikeway isnt a bike paths bike path, rather a series of roads with bike lanes on them. This is probably the best way to get to Dixon.
Davis to Dixon
1. Head south on Old Davis Road.
2. Turn right on Tremont Road.
3. Turn left on Runge Road.
4. Turn right on Vaughn Street.
5. Youll cross some rail... | {"hexsha": "07f571a68c58a62fa25868cc79022f0965aeb78e", "size": 900, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Davis-Dixon_Bikeway.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | {"hexsha": "8ab80a0c4a48f8113334c4afc6fc27827ec1284e", "size": 22610, "ext": "py", "lang": "Python", "max_stars_repo_path": "pennylane/tape/cv_param_shift.py", "max_stars_repo_name": "ryanlevy/pennylane", "max_stars_repo_head_hexsha": "fb03b09d17267ebd0b9050432f9eeb84b5dff200", "max_stars_repo_licenses": ["Apache-2.0"]... |
! -----------------------------------------------------------------------------
! This file was automatically created by SARAH version 4.12.1
! SARAH References: arXiv:0806.0538, 0909.2863, 1002.0840, 1207.0906, 1309.7223
! (c) Florian Staub, 2013
! ---------------------------------------------------------------... | {"hexsha": "8906946fe0e45ce92e2d29ae0eb0ad71b1767961", "size": 270110, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Externals/SPheno-4.0.3/NMSSM_IS/3-Body-Decays/Chi.f90", "max_stars_repo_name": "yuanfangtardis/vscode_project", "max_stars_repo_head_hexsha": "2d78a85413cc85789cc4fee8ec991eb2a0563ef8", "max_s... |
""" This files contain clustering method that works on the latent variable itself.
"""
import scipy
import numpy as np
from sklearn.cluster import KMeans
from sklearn.metrics.pairwise import pairwise_kernels
from sklearn.base import BaseEstimator, ClusterMixin
from sklearn.utils import check_random_state
from moegpli... | {"hexsha": "dc57b2b2ce854c6de7a955be0370528db436278f", "size": 9335, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/moegplib/clustering/kernelkmeans.py", "max_stars_repo_name": "DLR-RM/moegplib", "max_stars_repo_head_hexsha": "501c7fff49bc98e7cb62831f4185c34523837597", "max_stars_repo_licenses": ["MIT"], "m... |
@testset "2D p-FEM" begin
W = JacobiWeight(1,1) .* Jacobi(1,1)
x = axes(W,1)
D = Derivative(x)
D2 = -((D*W)'*(D*W))
M = W'W
A = KronTrav(D2,M)
N = 30;
V = view(A,Block(N,N));
@time MemoryLayout(arguments(V)[2]) isa LazyBandedMatrices.ApplyBandedLayout{typeof(*)}
Δ = KronTrav(D2... | {"hexsha": "7f3917b7b3c2328526638b2bb97974be7048ae29", "size": 510, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_pdes.jl", "max_stars_repo_name": "ioannisPApapadopoulos/ClassicalOrthogonalPolynomials.jl", "max_stars_repo_head_hexsha": "63610e3236dd7ffa9152db00734aab6af28f1793", "max_stars_repo_licens... |
"""compute minibatch blobs for training a Fast R-CNN network"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import cv2
import numpy as np
import numpy.random as npr
from lib.config import config as cfg
from lib.utils.blob import prep_im_for_... | {"hexsha": "9855eaac993a78b0d7b0697bf8598a099c578a18", "size": 3601, "ext": "py", "lang": "Python", "max_stars_repo_path": "train/lib/utils/minibatch.py", "max_stars_repo_name": "rulin-jone/Image-manipulation-detection", "max_stars_repo_head_hexsha": "ccc2bb7ea4bc82d569b3911a46c77dbbd37d635c", "max_stars_repo_licenses"... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Serge Sharoff, University of Leeds. An extension from https://github.com/adjidieng/ETM
# Modifications concern the possibility to choose the parameters and to encode new datasets using the same vocabulary
# It does read the entire corpus into memory for efficient conve... | {"hexsha": "b0d9d6f0b4b3e3067ffa484ab157037676a70058", "size": 12629, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/data_new.py", "max_stars_repo_name": "ssharoff/ETM", "max_stars_repo_head_hexsha": "0d77eb9aba02baa5827f8c20c63dcdbb3873fd87", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
from os.path import dirname, join
import numpy as np
import lut2d
import pixelcrawl
from sacred import Ingredient
from functools import lru_cache
ing = Ingredient('mapgen')
@ing.config
def cfg():
world_size = 128
bias_fac = 0.1 # scale NN bias init (relative to weight init)
agent_count = 200
easy_st... | {"hexsha": "2e8853261ac18d7d94256cdcf6319ec8b7b68830", "size": 2833, "ext": "py", "lang": "Python", "max_stars_repo_path": "world/mapgen.py", "max_stars_repo_name": "martinxyz/pixelcrawl", "max_stars_repo_head_hexsha": "e1218be20ec2fb65ab577b366f54546b59db5854", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4,... |
from scipy.constants import c, elementary_charge
one_gev_c2_to_kg = 1.7826619e-27
one_kgm_s_to_mev_c = (1.7826619e-30 * c)**(-1)
q_factor = elementary_charge / one_gev_c2_to_kg / c
# p = 10 kg m / s
# p_MeV_c = p * one_kgm_s_to_mev_c
# p_kgm_s = p_MeV_c / one_kgm_s_to_mev_c
| {"hexsha": "6a78d83fd205bd3e93c2c02c57e34f405ec68c19", "size": 278, "ext": "py", "lang": "Python", "max_stars_repo_path": "emtracks/conversions.py", "max_stars_repo_name": "ckampa13/particle_EM_tracks", "max_stars_repo_head_hexsha": "2c1bb964971a534a21de7ae40a08ae51020692d3", "max_stars_repo_licenses": ["MIT"], "max_st... |
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 7 18:49:22 2019
@author: ben91
"""
from SimulationClasses import *
import numpy as np
def Hook5():
def scheme(u):
fl = 1/30*u[:,0]-13/60*u[:,1]+47/60*u[:,2]+9/20*u[:,3]-1/20*u[:,4]
return fl
FVM = FiniteVolumeMethod(5, scheme)
... | {"hexsha": "d1abb451a5d9f1fb13747468f2eefa934b200175", "size": 17396, "ext": "py", "lang": "Python", "max_stars_repo_path": "FiniteVolumeSchemes.py", "max_stars_repo_name": "comp-physics/WENO-NN", "max_stars_repo_head_hexsha": "ab877b1747520acdbada8575a975586caa9a1371", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
function im_ext = bound_extension(im,By,Bx,type);
% im_ext = bound_extension(im,B,type);
%
% Extend an image for avoiding boundary artifacts,
%
% By, Bx: widths of the added stripes.
% type: 'mirror' Mirror extension
% 'mirror_nr': Mirror without repeating the last pixel
% 'circu... | {"author": "ricedsp", "repo": "D-AMP_Toolbox", "sha": "6e597d98c84755697b65554d59485d50a549c01a", "save_path": "github-repos/MATLAB/ricedsp-D-AMP_Toolbox", "path": "github-repos/MATLAB/ricedsp-D-AMP_Toolbox/D-AMP_Toolbox-6e597d98c84755697b65554d59485d50a549c01a/Packages/BLS-GSM/Added_PyrTools/bound_extension.m"} |
export logsumexp, rDirichlet, embed, condNorm,
ldnorm, lmvbeta, vech, xpnd_tri;
"""
logsumexp(x[, usemax])
Computes `log(sum(exp(x)))` in a stable manner.
### Example
```julia
x = rand(5)
logsumexp(x)
log(sum(exp.(x)))
```
"""
function logsumexp(x::Array{T}, usemax::Bool=true) where T <: Real
if usemax
... | {"hexsha": "71470e3bae79be8ced6e99660ea6c7875774679e", "size": 5428, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/generalTools.jl", "max_stars_repo_name": "mheiner/BayesInference.jl", "max_stars_repo_head_hexsha": "7c23e40328cf7b2618ee6f9554fe303083a23b38", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import wandb
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.backends.backend_agg import FigureCanvasAgg
from torchvision.utils import save_image
from utils.data_utils import _recolour_label, _1hot_2_2d, de_torch, move_color_channel
from utils.training_helpers import instance_checker, unpack_batch
fro... | {"hexsha": "c93e4e08882fd620d7df3e61362f3f17ec426721", "size": 34454, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/evaluation_utils.py", "max_stars_repo_name": "EliasKassapis/CAR", "max_stars_repo_head_hexsha": "ff7ec86aab68c4b9ff8aea171244991bd132d487", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
from __future__ import division
import os
import sys
import time
import glob
import logging
from tqdm import tqdm
import torch
import torch.nn as nn
import torch.utils
import torch.nn.functional as F
import torch.backends.cudnn as cudnn
import torchvision.transforms as transforms
from torch.utils.data im... | {"hexsha": "2bdc49f7a356c10f5a120a6aae285a0d0b9f80b6", "size": 3176, "ext": "py", "lang": "Python", "max_stars_repo_path": "AGD_ST/search/eval_teacher.py", "max_stars_repo_name": "Erfun76/AGD", "max_stars_repo_head_hexsha": "c20755f7198b299c3ad080a1a1215b4f42100e5f", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
"""
The collection of classes implementing render logic.
The renderer takes the array of cells' colors and renders the screen
frame from it. Also, it is possible to expand a list of user actions,
adding ones specific to the renderer, like zoom, scroll, etc.
The default renderer is :class:`RendererPlain`. Though there... | {"hexsha": "33597f29d8b159dd5a3e6556bfcac7a99f277397", "size": 8210, "ext": "py", "lang": "Python", "max_stars_repo_path": "xentica/core/renderers.py", "max_stars_repo_name": "a5kin/xentica", "max_stars_repo_head_hexsha": "ca08fac9f85af71c9d6d98545a33d50323f851b3", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
[STATEMENT]
lemma ex_in_inf:
fixes A::"'x set"
assumes at: "at TYPE('x)"
and fs: "finite A"
obtains c::"'x" where "c\<notin>A"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<And>c. c \<notin> A \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (... | {"llama_tokens": 1000, "file": null, "length": 16} |
import urllib
import numpy as np
import pickle
from storage import MemcachedStorage
def async_reduce(storage, input_bytes, bucket_name, object_name):
assert isinstance(storage, MemcachedStorage)
storage.save_v2(input_bytes, object_name, bucket_name)
new_model = storage.load_or_wait_v2(object_name, buck... | {"hexsha": "e4458ecd0994e0f14bd6d9b24f9af0eca4e001b0", "size": 9543, "ext": "py", "lang": "Python", "max_stars_repo_path": "communicator/memcached_primitive_nn.py", "max_stars_repo_name": "DS3Lab/LambdaML", "max_stars_repo_head_hexsha": "0afca7819e08632ba116fec8e102084e4040a47a", "max_stars_repo_licenses": ["Apache-2.0... |
using Formatting
using CFTime, Dates
using DataStructures
using NCDatasets
function checkData(
hist_dir :: String,
casename :: String,
varnames :: Array{String, 1},
year_rng :: Array{Int64, 1};
verbose :: Bool = false,
)
expect_filenames = DataStructures.OrderedDict()
println("I will also... | {"hexsha": "0e30d859d322384dced1ae259bc336280b499814", "size": 1608, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test06_check_energy/func_checkData.jl", "max_stars_repo_name": "meteorologytoday/IOM", "max_stars_repo_head_hexsha": "e7508b9f94fefb46844bf0d69421500faf0117bb", "max_stars_repo_licenses": ["MI... |
[STATEMENT]
lemma list_before_rel_empty[simp]: "list_before_rel [] = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. list_before_rel [] = {}
[PROOF STEP]
unfolding list_before_rel_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. {(a, b). \<exists>l1 l2 l3. [] = l1 @ a # l2 @ b # l3} = {}
[PROOF STEP]
by auto | {"llama_tokens": 145, "file": "Prpu_Maxflow_Graph_Topological_Ordering", "length": 2} |
\section{Introduction} \label{intro}
\lipsum[1-2]
\sidenote{This is a sidenote made with the \textbackslash sidenote package}
\lipsum[3-4] | {"hexsha": "65c63925f6064378d18a15c910d80cde73e87e18", "size": 138, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "main/introduction.tex", "max_stars_repo_name": "roaldarbol/preprint-template", "max_stars_repo_head_hexsha": "0034faaea30fccf0f91a88ad0120e63a12ddffc7", "max_stars_repo_licenses": ["MIT"], "max_stars... |
needs os/console
black white color
: bred red bold fg ;
: blk black fg ;
cls
." Welcome to the " bred .ver blk ." installer!" cr
cr cr
os [IF]
create procname 255 allot
create proclink 255 allot
85 constant linux_readlink
: has/proc?
" /proc/" procname place
getpid (.) procname +place
" /exe" procname +place
p... | {"hexsha": "adf9e016d490e40e6c553a2edc9d2f45d122f7b1", "size": 3155, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "tools/install.f", "max_stars_repo_name": "ronaaron/reva", "max_stars_repo_head_hexsha": "edc8cbef27219ecf8ff00ad9afdf92687796e7a2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9, "max_s... |
using Knet
import Gym
import AutoGrad: value
import Random
using Statistics
# using TimerOutputs
# reset_timer!()
const F = Float32
mutable struct History
xsize
nA::Int
γ::F
states # flattens all states into a vector
actions::Vector{Int}
rewards::Vector{F}
end
History(xsize, nA, γ, atype) =... | {"hexsha": "d600fdded766bc921d00165547016c004f91180b", "size": 4315, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/actor_critic_pong.jl", "max_stars_repo_name": "JuliaTagBot/DeepRLexamples.jl", "max_stars_repo_head_hexsha": "11269a324196d039e482a993d8c2e54326203a29", "max_stars_repo_licenses": ["MIT"],... |
\section{Linear Systems of Equations}
\label{sec:linearequations}
(Real numbers only this time.)
Linear equations are of the form $Ax = b$ where $A$ is a matrix and $x$ and $b$ are vectors. The rows of $A$ and $b$ form a system of equations that must be simultaneously satisfied by the entries of $x$. If $x,b\in\mathb... | {"hexsha": "5fac06cf1059867186fe01bbfa2ad4b4ab84d3ed", "size": 3997, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "notes/chapters/sections/linalg_linearequations.tex", "max_stars_repo_name": "jpbm/probabilism", "max_stars_repo_head_hexsha": "a2f5c1595aed616236b2b889195604f365175899", "max_stars_repo_licenses": [... |
include("plot_utils.jl")
θ = 180.0
ϕ = 0.0
#title = "boost_regular_12"
fname = "../data/voronoi_ul7n12_2e6.h5"
title = split(fname, "/")[end]
title = split(title, ".")[1]
plot_convergence(fname, string(title))
write_convergence(fname, string(title))
atmos, line, S_λ, α_tot = plotter(read_irregular(fname)..., θ, ϕ,... | {"hexsha": "c24e7c9f3b4108daf55f0574ef50306048f81cf7", "size": 854, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/plot_script.jl", "max_stars_repo_name": "meudnaes/VoronoiRT", "max_stars_repo_head_hexsha": "448eead8fa6e911ed40e2dfaba5baa1c9ef54cf2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
from ahh import pre
import numpy as np
import xarray as xr
import pandas as pd
__author__ = 'huang.andrew12@gmail.com'
__copyright__ = 'Andrew Huang'
def arr_1d(periods=15, freq=1, y=False,
xy=False, dt=False, start=0, neg=False,
seed=None, no_zeros=True):
"""
Create a 1 di... | {"hexsha": "9853a9e8bf4f4409629c81c283e3cb9b83cbca6b", "size": 3048, "ext": "py", "lang": "Python", "max_stars_repo_path": "ahh/exp.py", "max_stars_repo_name": "ahuang11/ahh", "max_stars_repo_head_hexsha": "59f124c3aa04cde58db0ec2e81025eb63a92404e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "max_stars_r... |
/*
Copyright (C) GridGain Systems. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... | {"hexsha": "bf262848ed6e661eb6e2300e5b64cba85ca8c4e4", "size": 6293, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "modules/clients/cpp/main/src/impl/cmd/gridclienttcpcommandexecutor.cpp", "max_stars_repo_name": "cybernetics/gridgain", "max_stars_repo_head_hexsha": "39f3819c9769b04caca62b263581c0458f21c4d6", "max... |
[STATEMENT]
lemma vcard_Sup_le_cmult:
assumes "small U" and \<kappa>: "\<And>x. x \<in> U \<Longrightarrow> vcard x \<le> \<kappa>"
shows "vcard (\<Squnion>U) \<le> vcard (set U) \<otimes> \<kappa>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vcard (\<Squnion> U) \<le> vcard (set U) \<otimes> \<kappa>
[PROOF ... | {"llama_tokens": 3886, "file": "ZFC_in_HOL_ZFC_Cardinals", "length": 39} |
import pandas as pd
import math
import numpy as np
__all__=['SearchUrlBuilder']
#------------------
#
#------------------
class SearchUrlBuilder:
#---------------
#
#---------------
def __init__(self):
self.target_url='https://www.sciencedirect.com/search/advanced?qs=%20'
# self.default_keyfile='/Users/steven... | {"hexsha": "98feb5e13b4271f38dda51718108e20cb3ee3ee5", "size": 2084, "ext": "py", "lang": "Python", "max_stars_repo_path": "ScienceDirect/package/search_url_builder.py", "max_stars_repo_name": "crb479/mcdevitt-trauma-ml", "max_stars_repo_head_hexsha": "9ed7ed7cd1e4be0071a18f9bbf375414088d5ed2", "max_stars_repo_licenses... |
[STATEMENT]
lemma doctor_optimal_match_unique:
assumes "doctor_optimal_match ds X"
assumes "doctor_optimal_match ds Y"
shows "X = Y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. X = Y
[PROOF STEP]
proof(rule iffD2[OF set_eq_iff, rule_format])
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>x. (x \<in... | {"llama_tokens": 932, "file": "Stable_Matching_Contracts", "length": 7} |
import csv
import time
import numpy as np
from pylabnet.utils.iq_upconversion.optimizer import IQOptimizer, IQOptimizer_GD
import pylabnet.utils.iq_upconversion.iq_upconversion_misc as ium
import pylabnet.hardware.awg.zi_hdawg as zi_hdawg
import pyvisa
from pylabnet.utils.logging.logger import LogClient
from pylabnet.... | {"hexsha": "f829b0951e3d12fe7718831e9e11ff5485d91853", "size": 19986, "ext": "py", "lang": "Python", "max_stars_repo_path": "pylabnet/utils/iq_upconversion/iq_calibration.py", "max_stars_repo_name": "wi11dey/pylabnet", "max_stars_repo_head_hexsha": "a6e3362f727c45aaa60e61496e858ae92e85574d", "max_stars_repo_licenses": ... |
# -*- coding: utf-8 -*-
# @Time : 20/5/1 12:01
# @Author : qgking
# @Email : qgking@tju.edu.cn
# @Software: PyCharm
# @Desc : StructSegPreprocess.py
import sys
sys.path.extend(["../../", "../", "./"])
from common.base_utls import *
from common.data_utils import *
import scipy.io as sio
import torch
from torch... | {"hexsha": "6b75a756766ae3f8b81575ba32600818554e6467", "size": 7769, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/preprocess/COVIDPreprocess.py", "max_stars_repo_name": "qgking/DASC_COVID19", "max_stars_repo_head_hexsha": "3300516b1d0e9896e2fb2ffda8527e0e1a1fcf2c", "max_stars_repo_licenses": ["MIT"], "ma... |
using Test
using ASE
using JuLIP.Testing
h0("Testing ASE.jl")
@testset "ASE" begin
@testset "Atoms" begin include("testase.jl"); end
@testset "Calculators" begin include("test_calculators.jl"); end
@testset "JuLIP vs ASE" begin include("test_asevsjulip.jl"); end
end
| {"hexsha": "5c7936b9031707bda96e27e9d529bc799019898b", "size": 279, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "SebastianM-C/ASE.jl", "max_stars_repo_head_hexsha": "8141022829b48b9223ef92097e94371d5cb2cb26", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14, ... |
from tqdm import tqdm
import numpy as np
class Trainer:
def __init__(self,
agent,
bandit,
alpha):
self.agent = agent
self.bandit = bandit
self.alpha = alpha
self.max_reward_p = np.max(bandit.p)
def train(self, epochs):
... | {"hexsha": "6d20a602c88468f1acb5b94e0d50e8af1fbabf3c", "size": 2013, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/williams/trainer.py", "max_stars_repo_name": "NickleDave/williams", "max_stars_repo_head_hexsha": "bfc362e82dfa5785116e11142e90e7f6908255b0", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_... |
import sys
import numpy as np
import collections
from multiprocessing.pool import ThreadPool
import multiprocessing.managers
from six.moves.cPickle import loads, dumps
try:
# joblib 0.12.x
from joblib.pool import MemmappingPool as MemmappingPool
except ImportError:
# joblib 0.11.x
from joblib.pool impo... | {"hexsha": "af625180bba69dd69eb831053e8c32fd11a3f6d2", "size": 14594, "ext": "py", "lang": "Python", "max_stars_repo_path": "batchup/work_pool.py", "max_stars_repo_name": "Britefury/batchup", "max_stars_repo_head_hexsha": "eba03676d9707133a67184200c10d9c5b575c6a5", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
from sklearn.datasets import load_boston
from keras.models import Sequential
from keras.layers import Dense, Conv1D, Flatten, MaxPooling1D
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error
import matplotlib.pyplot as plt
from preprocess import *
import numpy as np
impor... | {"hexsha": "3523165f5a33defe843647a510b46cf26d333542", "size": 3402, "ext": "py", "lang": "Python", "max_stars_repo_path": "CSCI560/Energy_Disaggregation/CNN.py", "max_stars_repo_name": "bridget-haus/Energy_Disaggregation", "max_stars_repo_head_hexsha": "5cf5a9277bda471c3c4e3b897a7d2fc32a782da3", "max_stars_repo_licens... |
################################################################################
# IMPORTING FILES AND LIBRARIES ################################################
################################################################################
# Files
import a_star # contains A* algorithm and some other functions
import... | {"hexsha": "96b070f433053c3c14bca9a92e592878a3df4d87", "size": 3874, "ext": "py", "lang": "Python", "max_stars_repo_path": "PopUpNext_v2/main.py", "max_stars_repo_name": "stefanbirs/FMES", "max_stars_repo_head_hexsha": "d31d36c9abb08a0388a02a9178df58c58d2ec506", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
[STATEMENT]
lemma get_set_eq [simp]: "get (set r x h) r = x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. get (Array_Time.set r x h) r = x
[PROOF STEP]
by (simp add: get_def set_def o_def) | {"llama_tokens": 88, "file": "Van_Emde_Boas_Trees_Imperative_HOL_Time_Array_Time", "length": 1} |
#ifndef UUID_98C06485_8AE9_47DA_B99F_62CA5AF00FF4
#define UUID_98C06485_8AE9_47DA_B99F_62CA5AF00FF4
#pragma once
#include "utils.hpp"
#include <atomic>
#include <iostream>
#include <cstdint>
#include <memory>
#include <typeindex>
#include <vector>
#include <boost/intrusive_ptr.hpp>
namespace Neptools
{
template <typ... | {"hexsha": "55c144db9c9360835e392986b26c75546c655c3f", "size": 6775, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/dynamic_struct.hpp", "max_stars_repo_name": "clienthax/neptools", "max_stars_repo_head_hexsha": "90f3e1cc8cf388e7050b15c44fa51e330973fd53", "max_stars_repo_licenses": ["WTFPL"], "max_stars_count... |
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 2 14:42:22 2021
@author: glifi
"""
## Naive-Bayes classifier is not suitable due to the negative values in the feature vectors.
import math
import time
import numpy as np
from scipy import io
from sklearn import metrics
import itertools
from matplotlib import pyplot ... | {"hexsha": "ee0fe4862979af07e588fbea095de5655a166850", "size": 1957, "ext": "py", "lang": "Python", "max_stars_repo_path": "Feature Only Models/naive_bayes.py", "max_stars_repo_name": "daviddavini/cs-260-project", "max_stars_repo_head_hexsha": "9e1067f8ff85c8c573262589bbe52740ef11275d", "max_stars_repo_licenses": ["MIT... |
# import tensorflow as tf
import numpy as np
for _ in range(500):
iwi = np.zeros([350, 350], dtype=np.int32)
for i in range(350):
for j in range(350):
if i == j + 2:
iwi[i, j] = 1
| {"hexsha": "08563c2da0d98bba9e63dda3fa297e30941e1237", "size": 236, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tmp.py", "max_stars_repo_name": "lephong/diffmetric_coref", "max_stars_repo_head_hexsha": "37543d5000911917f86a3c1747a50aec65b53c2d", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count... |
# Factorize two different matrices (one real, one complex) and solve for multiple rhs and free memory
using Distributed
if nworkers()<3
addprocs(3)
end
@everywhere using MUMPSjInv
using Test
include("getDivGrad.jl");
A = getDivGrad(24,20,22);
A2 = getDivGrad(30,31,33);
n = size(A,1);
n2 = size(A2... | {"hexsha": "0e0b6ae2cada4e3d606f8942992e1fc9ba067230", "size": 1460, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/testTwoSystemParallel.jl", "max_stars_repo_name": "UnofficialJuliaMirror/MUMPS.jl-bf6389e2-cca1-5e17-ac22-36425c4ccbb4", "max_stars_repo_head_hexsha": "735cc81f194c220dc8305ca19897453f4ddb1c17... |
##############################################################################################################################################################
##############################################################################################################################################################
""... | {"hexsha": "8aae143a8948f3628338151ad12582b91083e3be", "size": 11246, "ext": "py", "lang": "Python", "max_stars_repo_path": "compute_mpi3d_score.py", "max_stars_repo_name": "SteveCruz/icpr-syn2real", "max_stars_repo_head_hexsha": "179065de9552673fa9d627b42044de7cd0ddd08f", "max_stars_repo_licenses": ["MIT"], "max_stars... |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
C See packages/seacas/LICENSE for details
SUBROUTINE SORBLK (IDELB, INDEX, MAT, NELBLK)... | {"hexsha": "129da682ebcc71119c054408d149bc2f3131678c", "size": 507, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/numbers/nu_sorblk.f", "max_stars_repo_name": "jschueller/seacas", "max_stars_repo_head_hexsha": "14c34ae08b757cba43a3a03ec0f129c8a168a9d3", "max_stars_repo_licenses": [... |
import doce
import time
import numpy as np
from pathlib import Path
if __name__ == "__main__":
doce.cli.main()
# use case where:
# - the results are stored on disk using npy files
# - one factor affects the size of the results vectors
# - the metrics does not operate on the same data, resulting on result vect... | {"hexsha": "addd01bf7497d828787fa705a1827641c87701d6", "size": 2312, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/npyDemo.py", "max_stars_repo_name": "rastegah/doce", "max_stars_repo_head_hexsha": "8259c27c4182a398a4f7c752fcc38809535dd9e7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
import tempfile
import mmcv
import numpy as np
from mmpose.core import (apply_bugeye_effect, apply_sunglasses_effect,
imshow_bboxes, imshow_keypoints, imshow_keypoints_3d)
def test_imshow_keypoints():
# 2D keypoint
img = np.zeros((100, 100, 3), dtype=np.uint8)
kpts = np.array([[... | {"hexsha": "73e28fd5bc0ec8112a43cd9d31eb96f30137cb12", "size": 2647, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_visualization.py", "max_stars_repo_name": "jlgzb/mmpose", "max_stars_repo_head_hexsha": "0ecf06e3580f141f6ab44645768a0d6d8ba48383", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
[STATEMENT]
lemma convex_with_affine_domain_is_lsc:
fixes f :: "'a::euclidean_space \<Rightarrow> ereal"
assumes "convex_on UNIV f"
assumes "affine (domain f)"
shows "lsc f"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. lsc f
[PROOF STEP]
by (metis assms affine_no_rel_frontier emptyE lsc_def lsc_hull_liminf... | {"llama_tokens": 160, "file": "Lower_Semicontinuous_Lower_Semicontinuous", "length": 1} |
# Utilities:
function draw_fullscreen(vao_id)
glBindVertexArray(vao_id)
glDrawArrays(GL_TRIANGLES, 0, 3)
glBindVertexArray(0)
return
end
struct PostprocessPrerender end
function (sp::PostprocessPrerender)()
glDepthMask(GL_TRUE)
glDisable(GL_DEPTH_TEST)
glDisable(GL_BLEND)
glDisable(GL_... | {"hexsha": "cab31cb5073349dedccf9de6097353e74a9aefcb", "size": 9627, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "GLMakie/src/postprocessing.jl", "max_stars_repo_name": "garrekstemo/Makie.jl", "max_stars_repo_head_hexsha": "ea4e1980636ce42a1c028469143ef2c4ca2485d2", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma obtains_subsets_differenceset_card_bound:
fixes A::"'a set" and c::real
assumes "finite A" and "c>0" and "A \<noteq> {}" and "A \<subseteq> G" and "additive_energy A = 2 * c"
obtains B and A' where "B \<subseteq> A" and "B \<noteq> {}" and "card B \<ge> c^4 * card A / 16"
and "A' \<subset... | {"llama_tokens": 151949, "file": "Balog_Szemeredi_Gowers_Balog_Szemeredi_Gowers_Main_Proof", "length": 622} |
#from IPython import embed
import torch.nn as nn
import logging
import torch
import torch.nn.functional as F
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from torch.nn.modules.batchnorm import _BatchNorm
from mmdet.ops import ContextBlock, DeformConv, ModulatedDeformConv
from... | {"hexsha": "3e9572a5d2771787006eef3dcba70f1d973b8027", "size": 203861, "ext": "py", "lang": "Python", "max_stars_repo_path": "mmdetection/mmdet/models/agg/stsn.py", "max_stars_repo_name": "lidongyv/Reppoint-Tracking", "max_stars_repo_head_hexsha": "81b81e921f6b905e68aba117ffc4fca8ffcfcfd6", "max_stars_repo_licenses": [... |
from numpy import repeat
from numpy import reshape
from numpy import zeros
from gwlfe.Memoization import memoize
def Withdrawal(NYrs, StreamWithdrawal, GroundWithdrawal):
result = zeros((NYrs, 12))
for Y in range(NYrs):
for i in range(12):
result[Y][i] = (result[Y][i] + StreamWithdrawal[i... | {"hexsha": "c3092e99301a0fa99029a29ac88bdf4da018ce8a", "size": 516, "ext": "py", "lang": "Python", "max_stars_repo_path": "gwlfe/Input/WaterBudget/Withdrawal.py", "max_stars_repo_name": "mudkipmaster/gwlf-e", "max_stars_repo_head_hexsha": "9e058445537dd32d1916f76c4b73ca64261771cd", "max_stars_repo_licenses": ["Apache-2... |
import sys
import numpy
from scipy.special import binom
def help():
print("Usage: python nirvana.py NdK P")
print("\tN: number of dice, e.g. 3")
print("\tK: number of sides for each die, e.g. 6")
print("\tP: probability of success, e.g. 15")
def computeArguments(arg):
[die, sides] = arg[1].split("... | {"hexsha": "e930a117f39d5e3542a7f715d24b1c943ee0cbb2", "size": 1789, "ext": "py", "lang": "Python", "max_stars_repo_path": "nirvana.py", "max_stars_repo_name": "fagiodarkie/exaltered-nirvana-computing", "max_stars_repo_head_hexsha": "1c781418b8d1d0657a667dc28092da843777668e", "max_stars_repo_licenses": ["MIT"], "max_st... |
subroutine ifacerfl(mpnt,npt,srchval)
C
C
C#######################################################################
C
C PURPOSE -
C
C THIS ROUTINE FINDS POINTS THAT ARE WITHIN A MINIMUM SEARCH RANGE
C FROM CONSTRAINED BOUNDARIES AND SET icr1 FOR THE POINTS
C
C INPUT ARGUMENTS -
C
C m... | {"hexsha": "9159377c3d4702b978419d0d050ae2829264c27b", "size": 9325, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/ifacerfl.f", "max_stars_repo_name": "millerta/LaGriT-1", "max_stars_repo_head_hexsha": "511ef22f3b7e839c7e0484604cd7f6a2278ae6b9", "max_stars_repo_licenses": ["CNRI-Python"], "max_stars_count"... |
#!/usr/bin/env python3
import utils as u
import numpy as np
poisson = np.random.poisson
e=5
att=1/3
h=1-att
max_block=20
def grindWithHS():
numSims = 100000
blocksNoGrind=[]
blocksGrind=[]
biggerThanExp=0
HSBlocksLost=[]
failedAttempts=0
noAttackBlocks=[]
for i in range(numSims):
... | {"hexsha": "dd086a5d3e330cf3101623b6b930e769e75c6354", "size": 8520, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/other-sims/general_grinding.py", "max_stars_repo_name": "filecoin-project/consensus", "max_stars_repo_head_hexsha": "8824ad5fb8948706995805692d594f6ccf199176", "max_stars_repo_licenses": ["Ap... |
(*
Copyright 2014 Cornell University
Copyright 2015 Cornell University
Copyright 2016 Cornell University
This file is part of VPrl (the Verified Nuprl project).
VPrl is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Sof... | {"author": "vrahli", "repo": "NuprlInCoq", "sha": "0c3d7723836d3f615ea47f56e58b2ea6173e7d98", "save_path": "github-repos/coq/vrahli-NuprlInCoq", "path": "github-repos/coq/vrahli-NuprlInCoq/NuprlInCoq-0c3d7723836d3f615ea47f56e58b2ea6173e7d98/rules/rules_arith_exception.v"} |
# -*- coding: utf-8 -*-
import sys
import cv2
import numpy as np
# Draw rectangle on top of the input image
def draw_rectangle(event, x, y, flags, params):
global x_init, y_init, drawing, top_left_pt, bottom_right_pt, img_orig
# Detecting a mouse click
if event == cv2.EVENT_LBUTTONDOWN:
drawing =... | {"hexsha": "82464a7169a3af62f95ccd560602d72316684ab1", "size": 6884, "ext": "py", "lang": "Python", "max_stars_repo_path": "LearningOpenCV/opencv_test.py", "max_stars_repo_name": "yyFFans/DemoPractises", "max_stars_repo_head_hexsha": "e0e08413efc598489401c8370f4c7762b3493851", "max_stars_repo_licenses": ["MIT"], "max_s... |
"""
Helper Functions containing training and evaluation methods
"""
import torch
import torch.nn.functional as F
import numpy as np
from tqdm.auto import tqdm
from utility import categorical_accuracy, binary_accuracy, other_evaluations
from config.root import device
def train(model, iterator, optimizer, criterion):
... | {"hexsha": "e9568700b7b5d8d2d04bdc29ab46718dca7dee76", "size": 2865, "ext": "py", "lang": "Python", "max_stars_repo_path": "FITBGenerator/SequenceLabeling/helperfunctions.py", "max_stars_repo_name": "shivammehta007/NLPinEnglishLearning", "max_stars_repo_head_hexsha": "ae869d868e39df9b1787134ba6e964acd385dd2e", "max_sta... |
using AdventOfCodeSolutions
using Test
function input(puzzle::Puzzle{2020, 3, n}) where n
io = openInput(puzzle)
A = split(read(io, String), '\n', keepempty=false)
return permutedims(hcat(map(collect, A)...))
end
function treesHitUsingSlope(A, slope)
position = [1, 1]
trees = 0
while (position... | {"hexsha": "31a2b8fc68834894db90e34270413bc6bbcc7573", "size": 961, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "2020/src/day_3.jl", "max_stars_repo_name": "MarkRedeman/AdventOfCode.jl", "max_stars_repo_head_hexsha": "d83584f4cc5272cf125325c98b0a98aedffb2e30", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#include <boost/mpl/aux_/preprocessed/msvc60/divides.hpp>
| {"hexsha": "04b0f02f1e1172d7e578d750ad4b1af5c97ed184", "size": 58, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_mpl_aux__preprocessed_msvc60_divides.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licen... |
# Example based on example from mlflow repository https://github.com/mlflow/mlflow
# The data set used in this example is from http://archive.ics.uci.edu/ml/datasets/Wine+Quality
# P. Cortez, A. Cerdeira, F. Almeida, T. Matos and J. Reis.
# Modeling wine preferences by data mining from physicochemical properties. In De... | {"hexsha": "c6f936eb66d99afb8ba031c212a0e2143ff173fe", "size": 3442, "ext": "py", "lang": "Python", "max_stars_repo_path": "dev-environment/mlflow/models/sklearn-elasticnet-wine/train.py", "max_stars_repo_name": "arkadius/prinz", "max_stars_repo_head_hexsha": "7ac306fbccfb9751d00cd072399fcaf22b45431e", "max_stars_repo_... |
using TextParse
import TextParse: tryparsenext, unwrap, failedat, AbstractToken, LocalOpts
import CodecZlib: GzipCompressorStream
using Test
using Dates, Random
using Nullables
# dumb way to compare two AbstractTokens
Base.:(==)(a::T, b::T) where {T<:AbstractToken} = string(a) == string(b)
@testset "TextParse" begin... | {"hexsha": "b1b1c2bec23f6f54abe7d1aa4ad87f8149d688ef", "size": 28029, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "harryscholes/TextParse.jl", "max_stars_repo_head_hexsha": "f4e72b1a4a222504cfa8fb9e35bbd5897506fb92", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import numpy as np
def lagrange_polynomial(x_data, y_data):
if x_data.size != y_data.size:
raise Exception("X and Y vectors must have equal number of elements.")
if x_data.size < 3:
raise Exception("X and Y vectors have to contain at least 3 elements.")
n = x_data.size
def _interpol... | {"hexsha": "f600760103331d770612304db10ce603a1990c12", "size": 695, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/interpolation/lagrange polynomial/lagrange_polynomial.py", "max_stars_repo_name": "djeada/Numerical-Methodes", "max_stars_repo_head_hexsha": "45a5288f4719568a62a82374efbb3fc06d33ec46", "max_sta... |
import argparse
import glob
import json
import logging
import os.path
import sys
import numpy as np
import vispy
import vispy.color
import vispy.scene
import vispy.visuals
from psbody.mesh import Mesh, MeshViewers, MeshViewer
from vispy.io import write_mesh, read_mesh, load_data_file
import os
import time , math
impor... | {"hexsha": "2a532e65c43c06b6e47c2a9c9c10fe2c1c748799", "size": 10149, "ext": "py", "lang": "Python", "max_stars_repo_path": "Test Coresspondence/view_mesh.py", "max_stars_repo_name": "emanhamed/Processing3DMeshes", "max_stars_repo_head_hexsha": "6974c581c3891a37e3b4187dbe4c7158c18cea0f", "max_stars_repo_licenses": ["MI... |
[STATEMENT]
lemma HNF_of_HNF_id:
fixes H :: "int mat"
assumes HNF_H: "Hermite_JNF associates res H"
and H: "H \<in> carrier_mat n n"
and H_P1_H1: "H = P1 * H1"
and inv_P1: "invertible_mat P1"
and H1: "H1 \<in> carrier_mat n n"
and P1: "P1 \<in> carrier_mat n n"
and HNF_H1: "Hermite_JNF associates res H... | {"llama_tokens": 659, "file": "Modular_arithmetic_LLL_and_HNF_algorithms_HNF_Mod_Det_Soundness", "length": 5} |
import pytest
import os
import numpy as np
import pyscal.core as pc
import pyscal.crystal_structures as pcs
def test_q_4():
atoms, boxdims = pcs.make_crystal('bcc', repetitions = [4, 4, 4])
sys = pc.System()
sys.atoms = atoms
sys.box = boxdims
#sys.get_neighbors(method = 'voronoi')
sys.find_ne... | {"hexsha": "f3671fdc27209cd81cb2c973c2f845d3cd76d852", "size": 1923, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_q_atom.py", "max_stars_repo_name": "qinlene/pyscal", "max_stars_repo_head_hexsha": "3542ac1a181db577840cb5ee99ebea5991ecc6dc", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_co... |
#!/usr/bin/env python
"""
Main driver script to be called with its respective arguments.
Loads data, applies preprocessing, compiles model(s), trains them and validates/saves them.
Also plots various results.
"""
# IMPORTS
#########
import os
import numpy as np
import argparse
from sklearn.model_selection import tra... | {"hexsha": "0ee26da67b1f6b8abd9a6632a41d12e1c196a4d8", "size": 22711, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "butkej/MIL4Cyto", "max_stars_repo_head_hexsha": "d754c3d53850ee41ac92b9e94e97ea763124a065", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_stars_... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import math
import glob
import numpy as np
import matplotlib.pyplot as plt
import multiprocessing
from common import DataPreset, load_preset_from_file, save_plot
def plot_step(params):
name = params['name']
#preset = params['preset']
ste... | {"hexsha": "634352bfbebec518f6803af266b8b5399e6e34d1", "size": 5677, "ext": "py", "lang": "Python", "max_stars_repo_path": "gen_plots.py", "max_stars_repo_name": "mroja/kuramoto", "max_stars_repo_head_hexsha": "9957ae1cf09e0c463a2c3ba3e2421b6628caa27c", "max_stars_repo_licenses": ["WTFPL"], "max_stars_count": 1, "max_s... |
"""
abstract type AbstractChainElement{S<:AbstractCell, F}
Abstract type for representing an element of a chain. Create subtypes of this if there is a
more efficient way to store a simplex and coefficient than as two fields.
An `AbstractChainElement{S, F}` behaves like a `S` when doing comparisons and like a `F`
... | {"hexsha": "bb49900758550f3f704d46eacce350dc9a1a46a8", "size": 6563, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/base/chainelement.jl", "max_stars_repo_name": "davidhien/Ripserer.jl", "max_stars_repo_head_hexsha": "95391396bea1b2b922967f7da21de05d6b3b67bb", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
#===============================================================================
test_functions.jl
Author: Tom Price
Date: Dec 2018
automated test script for Julia API
this code should be run at startup in fresh julia REPL
=========================================================================... | {"hexsha": "a48c2dc5482f487fba1e2c50894a365492459ee4", "size": 32760, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "bioinformatics/test/test_functions.jl", "max_stars_repo_name": "MakerButt/chaipcr", "max_stars_repo_head_hexsha": "a4c0521d1b2ffb2aa1c90ff21f3ca4779b6831d1", "max_stars_repo_licenses": ["Apache-2.... |
program transform_pdb
implicit none
character*255 infile
character*255 outfile
character*16 tar
integer i,n
logical ofile
integer, dimension(:), allocatable :: ir1,ir2
inquire(file="swap_pdb.dat",exist=ofile)
if(ofile) then
open(1... | {"hexsha": "11598a997c31ad660780f347527b461c5bf43bca", "size": 2617, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "contrib/marat/swap/main.f", "max_stars_repo_name": "dinisAbranches/nwchem", "max_stars_repo_head_hexsha": "21cb07ff634475600ab687882652b823cad8c0cd", "max_stars_repo_licenses": ["ECL-2.0"], "max_s... |
[STATEMENT]
lemma las_trans_r:
assumes "locally_antisym R (A + B)"
shows "locally_antisym R B"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. locally_antisym R B
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
locally_antisym R (A + B)
goal (1 subgoal):
1. locally_antisym R B
[PROOF STEP]
unfo... | {"llama_tokens": 299, "file": "Weighted_Path_Order_Relations", "length": 3} |
/*
* Copyright Andrey Semashev 2007 - 2013.
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*/
/*!
* \file util_explicit_operator_bool.cpp
* \author Andrey Semashev
* \date 17.07.201... | {"hexsha": "61f812d2f2af869795f8a64c2a5166c2dd8760cf", "size": 907, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "libs/log/test/compile/util_explicit_operator_bool.cpp", "max_stars_repo_name": "HelloSunyi/boost_1_54_0", "max_stars_repo_head_hexsha": "429fea793612f973d4b7a0e69c5af8156ae2b56e", "max_stars_repo_lic... |
## a zoom in window
## mutlicursor
## And checkboxes
## and radio buttons
import matplotlib
matplotlib.use('Qt5Agg')
import matplotlib.pyplot as plt
from matplotlib.widgets import Button
from scipy import signal
import numpy as np
from pyM2FS.calibration_helper_funcs import get_psf
from scipy.ndimage import gaus... | {"hexsha": "9e578d70f7bf11dbb5996eebf806e8144f77e37c", "size": 21076, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyM2FS/linebrowser.py", "max_stars_repo_name": "akremin/M2FSreduce", "max_stars_repo_head_hexsha": "42092f18aa1e5d7ad6f6528a395ee93e89165b30", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
import torch
import os
import natsort
import pandas as pd
import torch
from torchvision import transforms
from PIL import Image
from torchvision.datasets import CIFAR10
from torch.utils.data import Dataset, DataLoader, random_s... | {"hexsha": "42b0dcb36746001dca013279d96ee53de35f8205", "size": 2924, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/nas/darts/datasets.py", "max_stars_repo_name": "curiousjit/nni", "max_stars_repo_head_hexsha": "d12283f4d9fb97c2f5ef6e14a2e8bd09d9b3a01e", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
module ComponentPackages
import JSON, JSON2, HTTP
include("ComponentMetas.jl")
using .ComponentMetas
const ROOT_PATH = (@__DIR__) * "/.."
const META_FILENAME = ROOT_PATH * "/components_meta.json"
struct ComponentPackage
name ::String
package_name ::String
... | {"hexsha": "9210aa4182fbf19b8d8089bb37a0ce410d7ba304", "size": 7553, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ComponentPackages.jl", "max_stars_repo_name": "EricForgy/Dashboards", "max_stars_repo_head_hexsha": "ffb04fbf6d126178b2a9bb60de8cea088ffa8caf", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import torch
import numpy as np
import scipy.io
# import h5py
import torch.nn as nn
import operator
from functools import reduce
from functools import partial
#################################################
#
# Utilities
#
#################################################
device = torch.device('cuda' if torch.cuda.... | {"hexsha": "1388a24f9f9b3796a3ce360274b9c7cf2aa71b19", "size": 8937, "ext": "py", "lang": "Python", "max_stars_repo_path": "utilities3.py", "max_stars_repo_name": "ktcarr/fourier_neural_operator", "max_stars_repo_head_hexsha": "31ce8fc80ae34b28ef2638aa61757af955573b65", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
"""Module with a class defining an Artificial Neural Network."""
import os
import pickle
import tensorflow as tf
import numpy as np
from tqdm.auto import tqdm
class NeuralNetwork:
def __init__(self, layers, lr, lam, model=None, lb=None, ub=None):
# Making sure the dtype is consistent
self.dtype ... | {"hexsha": "7f1c717bfce33950be5c6841b817de8b59e5be63", "size": 5045, "ext": "py", "lang": "Python", "max_stars_repo_path": "podnn/neuralnetwork.py", "max_stars_repo_name": "BJUT-SIPL/POD-NN", "max_stars_repo_head_hexsha": "4cc38416ec140dd94991d007c8250c20a986881f", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
# Asymptotic solutions in long-times
Projectile motion in a non-homogenous potential field with drag is described by the equation
$$y_{\tau \tau} + \beta \epsilon y_{\tau}^2 + (1 + \phi)\frac{1}{(1 + \epsilon y)^2} = 0,$$
with $y(0) = \epsilon$ and $y_{\tau}(0)=1$, and where $\epsilon \ll 1$ is expected.
```python... | {"hexsha": "64f8eb859d6cf30dda567e6ced4fba84440515bd", "size": 503497, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "src/asymptotic-all.ipynb", "max_stars_repo_name": "7deeptide/Thesis_scratch", "max_stars_repo_head_hexsha": "d776d57f642de4df718c1f655f080c8fe402e092", "max_stars_repo_licenses": ["... |
# starpar.py
import numpy as np
import pandas as pd
from ..load_sim import LoadSim
from ..util.mass_to_lum import mass_to_lum
class StarPar():
@LoadSim.Decorators.check_pickle
def read_starpar_all(self, prefix='starpar_all',
savdir=None, force_override=False):
rr = dict()
... | {"hexsha": "97cde2743e02fa28214de31cc1f9d1ed9d052c84", "size": 3391, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyathena/tigress_ncr/starpar.py", "max_stars_repo_name": "changgoo/pyathena-1", "max_stars_repo_head_hexsha": "c461ac3390d773537ce52393e3ebf68a3282aa46", "max_stars_repo_licenses": ["MIT"], "max_s... |
import tensorflow as tf
import numpy as np
import mnist_data
import os
import vae
import glob
import sys
import time
import scipy
from calc_rec_error import *
""" parameters """
# source activate tensorflow_p36 && pip install pillow && pip install scikit-image && pip install scikit-learn
# source activate tensorflow... | {"hexsha": "37d16852a725b942aadee00f5a1c501830f4af35", "size": 5464, "ext": "py", "lang": "Python", "max_stars_repo_path": "Monte-Carlo-Attacks/Monte-Carlo-Fashion_MNIST_CVAE/reconstruction_attack.py", "max_stars_repo_name": "SAP-samples/security-research-mi-gen-nn", "max_stars_repo_head_hexsha": "15627f73fcc497c87a67f... |
def plot_isolines():
# 3rd party imports
import numpy as np
# Internal imports
import geomagnetism as geo
colatitudes = np.linspace(0, 180, 181)
longitudes = np.linspace(-180, 179, 360)
dintensities, dangles, dintensities_sv, dangles_sv = geo.grid_geomagnetic(
colatitudes, l... | {"hexsha": "73761f880646031f9a551dedd960f9e8c03ba67b", "size": 1068, "ext": "py", "lang": "Python", "max_stars_repo_path": "geomagnetism/__main__.py", "max_stars_repo_name": "Bertin-fap/geomagnetism", "max_stars_repo_head_hexsha": "64187b7480af4c9fc6b6f306fdf8fdf6c2f64d24", "max_stars_repo_licenses": ["MIT"], "max_star... |
# code structure follows the style of Symplectic ODE-Net
# https://github.com/d-biswa/Symplectic-ODENet/blob/master/experiment-single-embed/data.py
import numpy as np
from se3hamneuralode import to_pickle, from_pickle
import gym
import envs
def sample_gym(seed=0, timesteps=10, trials=50, min_angle=0.,
... | {"hexsha": "47bf3363948135dce6a7e74a2593616e562c249f", "size": 3230, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/pendulum/data.py", "max_stars_repo_name": "thaipduong/SE3HamiltonianDynsLearning", "max_stars_repo_head_hexsha": "caf385cf810055e88314e6e4b39b566f9a0be419", "max_stars_repo_licenses": ["M... |
module MakieThemes
include("GGThemr/GGThemr.jl")
using .GGThemr
export ggthemr, show_ggthemr, ggthemr_colorthemes
end # module
| {"hexsha": "058443d9be490607d2b6e2ff7d5f4fd90da95f55", "size": 130, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MakieThemes.jl", "max_stars_repo_name": "UnofficialJuliaMirror/MakieThemes.jl-e296ed71-da82-5faf-88ab-0034a9761098", "max_stars_repo_head_hexsha": "934bc8166d267edc9120ce9d6bcacd87785dd4d8", "ma... |
from orangecontrib.comsyl.util.CompactAFReader import CompactAFReader
import numpy
from srxraylib.util.h5_simple_writer import H5SimpleWriter
#
########################################################################################################################
#
def W_at_x2x2(af,index_x2=None,index_y2=None,index... | {"hexsha": "441f4b3621271a5e008b3ce13b140dde6ed8ca55", "size": 3653, "ext": "py", "lang": "Python", "max_stars_repo_path": "VORTX/vortx.py", "max_stars_repo_name": "srio/shadow3-scripts", "max_stars_repo_head_hexsha": "10712641333c29ca9854e9cc60d86cb321f3762b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ... |
/-
Copyright (c) 2020 Kenny Lau. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kenny Lau
! This file was ported from Lean 3 source module algebra.polynomial.group_ring_action
! leanprover-community/mathlib commit 10bf4f825ad729c5653adc039dafa3622e7f93c9
! Please do n... | {"author": "leanprover-community", "repo": "mathlib3port", "sha": "62505aa236c58c8559783b16d33e30df3daa54f4", "save_path": "github-repos/lean/leanprover-community-mathlib3port", "path": "github-repos/lean/leanprover-community-mathlib3port/mathlib3port-62505aa236c58c8559783b16d33e30df3daa54f4/Mathbin/Algebra/Polynomial/... |
import numpy as np
def normalize(distribution):
min_val = min(distribution.values())
if min_val < 0:
distribution = dict([(k, v - min_val) for k, v in distribution.items()])
sum_val = sum(distribution.values())
return dict([(k, v / sum_val) for k, v in distribution.items()])
def avg(distrib... | {"hexsha": "23ab635d57c770148c762742dc22164c6fb32852", "size": 1810, "ext": "py", "lang": "Python", "max_stars_repo_path": "klearn/IT.py", "max_stars_repo_name": "epfl-dlab/KLearn", "max_stars_repo_head_hexsha": "e05ef059005f55a7321e5b7765236c39e6941132", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 3,... |
#!/usr/bin/env python
# coding=utf-8
from __future__ import division, print_function, unicode_literals
import gzip
import pickle
from six.moves.urllib.request import urlretrieve
import numpy as np
import h5py
import os
import sys
bs_data_dir = os.environ.get('BRAINSTORM_DATA_DIR', '.')
url = 'http://deeplearning.net/d... | {"hexsha": "158c286cbce2579658d0a820b4f10922c84e6235", "size": 3389, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/create_mnist.py", "max_stars_repo_name": "PyCN/brainstorm", "max_stars_repo_head_hexsha": "8f1fc886faf268b25085fa5c95bf106b1805d766", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14... |
[STATEMENT]
lemma acyclicP_wf_subcls1:
"acyclicP (subcls1 P) \<Longrightarrow> wfP ((subcls1 P)\<inverse>\<inverse>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. acyclicP (subcls1 P) \<Longrightarrow> wfP (subcls1 P)\<inverse>\<inverse>
[PROOF STEP]
unfolding wfP_def
[PROOF STATE]
proof (prove)
goal (1 subgoal)... | {"llama_tokens": 224, "file": "JinjaThreads_Common_WellForm", "length": 2} |
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 02 11:48:53 2017
@author: Suhas Somnath
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
from pyUSID.io.dtype_utils import stack_real_to_compound
from pyUSID.io.hdf_utils import write_main_dataset, create_results... | {"hexsha": "65950441e0160a5d26780abddd1d5ca11d644fff", "size": 19238, "ext": "py", "lang": "Python", "max_stars_repo_path": "giv_bayesian/giv_bayesian_mpi.py", "max_stars_repo_name": "pycroscopy/distUSID", "max_stars_repo_head_hexsha": "2054896710e395d13d03319d35eb81085534b85f", "max_stars_repo_licenses": ["MIT"], "max... |
import Bio.PDB.DSSP as DSSP
import Bio.PDB as PDB
import numpy as np
import glob
from Bio.PDB.DSSP import dssp_dict_from_pdb_file
def get_feats(file):
'''Given a protein name ('file'), will extract features related to amino acid charges'''
alphas=['H','I','G']
betas=['B','E']
p = PDB.PDBParser(QUIET=... | {"hexsha": "78f54afa37395e6d158f2b3fa1b797e1f40e7534", "size": 4300, "ext": "py", "lang": "Python", "max_stars_repo_path": "calc_fractions.py", "max_stars_repo_name": "roosavarjus/cbh21-protein-solubility-challenge", "max_stars_repo_head_hexsha": "470fe60da62dac7c05ed606cf9533344c0b1d9cd", "max_stars_repo_licenses": ["... |
import numpy as np
class ObsPreprocessor:
def __init__(self, max_rails, reorder_rails):
self.max_rails = max_rails
self.reorder_rails = reorder_rails
def _fill_padding(self, obs, max_rails):
"""
:param obs: Agent state
:param max_rails: Maximum number of rails... | {"hexsha": "17190a91e5e387dd9403e68f5f9540753fc0377c", "size": 2527, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/preprocessing.py", "max_stars_repo_name": "misterdev/flatland-marl", "max_stars_repo_head_hexsha": "347cddf5cec1e4184426ea4227a00206aed3bcaf", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
# coding:utf-8
from os import path
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from wordcloud import WordCloud, STOPWORDS
def generate_wordcloud(text):
# WordCloud configurations
d=path.dirname(__file__)
alice_mask = np.array(Image.open(path.join(d, "Images//alice_mask.png")))... | {"hexsha": "7ce8d39f06f5879dccac274d70739a4eb8b9e3ee", "size": 871, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotWordcloud.py", "max_stars_repo_name": "zhengyangca/wordcloud_jieba_statistics", "max_stars_repo_head_hexsha": "f9ed4b73f13be643573083d37bafe82743c3fe03", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma diamond_an_an_same:
"|an(x)>an(x) = an(x)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. | an x > an x = an x
[PROOF STEP]
by (simp add: diamond_an_an an_mult_idempotent) | {"llama_tokens": 94, "file": "Correctness_Algebras_N_Semirings_Modal", "length": 1} |
import cartopy.crs as ccrs
import cartopy.io.shapereader as shpreader
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
import matplotlib.patches as mpatches
import csv
import matplotlib.animation as animation
c = np.arange(1, 10)
norm = mpl.colors.Normalize(vmin=c.min(), vmax=c.max())
cmap ... | {"hexsha": "c181969839a3e1143079031db51138b7994d43c2", "size": 6285, "ext": "py", "lang": "Python", "max_stars_repo_path": "Homeless/animatedMap.py", "max_stars_repo_name": "hminke/DataVisualizations", "max_stars_repo_head_hexsha": "2a6dff8bd7b2759c7b0d81f0aea7052990bab756", "max_stars_repo_licenses": ["MIT"], "max_sta... |
r"""Functions for spectator scattering corrections to $B\to V\ell^+\ell^-$ decays.
This includes weak annihilation, chromomagnetic contributions, and light
quark-loop spectator scattering.
"""
import flavio
import numpy as np
from flavio.classes import AuxiliaryQuantity, Implementation
from flavio.physics.bdecays.com... | {"hexsha": "184b0daa3e58653d7f742a83ccefb562276dd59f", "size": 2778, "ext": "py", "lang": "Python", "max_stars_repo_path": "flavio/physics/bdecays/bvll/nonfactorizable.py", "max_stars_repo_name": "Felicia56/flavio", "max_stars_repo_head_hexsha": "ea735bd8febbb961d249eddf338a4960c1fbee69", "max_stars_repo_licenses": ["M... |
# Author: Yuke Zhu
# Modified by: Kaichun Mo
# -*- coding: utf-8 -*-
import sys
import os
import h5py
import json
import numpy as np
import random
import skimage.io
import scipy.misc as misc
from skimage.transform import resize
# At every location, there may be multiple images generated with
# different jittered view... | {"hexsha": "10e83fe940d246874cd2a8a5eed69a872e826d91", "size": 6740, "ext": "py", "lang": "Python", "max_stars_repo_path": "visu/env_visu.py", "max_stars_repo_name": "daerduoCarey/AdobeIndoorNav", "max_stars_repo_head_hexsha": "e5cfbb374373eae985b0aca21b35d5442ce4eecc", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""filename.py
This uses the features from the persistence images to create an MDS plot.
"""
import os
import json
import dotenv
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
from sklearn.manifold import MDS
DOTENV_KEY2VAL = dotenv.... | {"hexsha": "dea175e85aff1c368af05d56cf24954c2a5238eb", "size": 4256, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/clustering/clustering_mds_plot.py", "max_stars_repo_name": "pjhartout/TDA_ADNI_MLCB", "max_stars_repo_head_hexsha": "40f61389645db043d6c33e08abf2ed6b97794170", "max_stars_repo_licenses": [... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.