text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
'''
Livro-Introdução-a-Visão-Computacional-com-Python-e-OpenCV-3
Repositório de imagens
https://github.com/opencv/opencv/tree/master/samples/data
'''
import cv2
import numpy as np
from matplotlib import pyplot as plt
#import mahotas
VERMELHO = (0, 0, 255)
VERDE = (0, 255, 0)
AZUL = (255, 0, 0)
AMARELO = (0, 255, ... | {"hexsha": "e6a3b439f814e0cda59fa77639ece480628690f6", "size": 1851, "ext": "py", "lang": "Python", "max_stars_repo_path": "OpenCV/bookIntroCV_011_detecao_faces_imagens.py", "max_stars_repo_name": "fotavio16/PycharmProjects", "max_stars_repo_head_hexsha": "f5be49db941de69159ec543e8a6dde61f9f94d86", "max_stars_repo_lice... |
#!/usr/bin/env python3
import numpy as np
import isce
import isceobj
import stdproc
import copy
from iscesys.StdOEL.StdOELPy import create_writer
from isceobj.Orbit.Orbit import Orbit
###Load data from an insarApp run
###Load orbit2sch by default
def load_pickle(step='orbit2sch'):
import cPickle
insarObj = cP... | {"hexsha": "02843a1289a8216194ac8d2993da042d84e1d086", "size": 4433, "ext": "py", "lang": "Python", "max_stars_repo_path": "docs/dev/Example3_orbits.py", "max_stars_repo_name": "vincentschut/isce2", "max_stars_repo_head_hexsha": "1557a05b7b6a3e65abcfc32f89c982ccc9b65e3c", "max_stars_repo_licenses": ["ECL-2.0", "Apache-... |
[STATEMENT]
lemma foundation14:"(\<tau> \<Turnstile> A \<triangleq> false) = (\<tau> \<Turnstile> not A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<tau> \<Turnstile> A \<triangleq> false) = (\<tau> \<Turnstile> not A)
[PROOF STEP]
by(auto simp: OclNot_def OclValid_def invalid_def false_def true_def null_d... | {"llama_tokens": 148, "file": "Featherweight_OCL_UML_Logic", "length": 1} |
#
# This file is part of CasADi.
#
# CasADi -- A symbolic framework for dynamic optimization.
# Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl,
# K.U. Leuven. All rights reserved.
# Copyright (C) 2011-2014 Greg Horn
#
# CasADi is free software; you can... | {"hexsha": "862cad8a8d96a5ffadef4c592c193208e7075b7f", "size": 1812, "ext": "py", "lang": "Python", "max_stars_repo_path": "crane_controllers/external/casadi-3.4.5/docs/api/examples/matrix/btf.py", "max_stars_repo_name": "tingelst/crane", "max_stars_repo_head_hexsha": "e14bca2bd4e2397dce09180029223832aad9b070", "max_st... |
import matplotlib.pylab as plt
import sklearn.metrics as mt
from numpy import round
def roc_metric(pred, obs, plot=False):
fpr_rt_lm, tpr_rt_lm, _ = mt.roc_curve(obs, pred)
auc_score = mt.auc(fpr_rt_lm, tpr_rt_lm, reorder=True)
if plot:
#plt.clear()
plt.plot(fpr_rt_lm, tpr_rt_lm, label='R... | {"hexsha": "30ec2013c8d56e8efefe64a4a57db1fd06765bc3", "size": 1711, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/common/evaluation.py", "max_stars_repo_name": "SensorDX/rainqc", "max_stars_repo_head_hexsha": "d957705e0f1e2e05b3bf23c5b6fd77a135ac69cd", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars... |
/*
* $Id: vecio.cc 1414 2005-11-01 22:04:59Z cookedm $
*
* Copyright (C) 1997 Todd Veldhuizen <tveldhui@oonumerics.org>
* All rights reserved. Please see <blitz/blitz.h> for terms and
* conditions of use.
*
*/
#ifndef BZ_VECIO_CC
#define BZ_VECIO_CC
#ifndef BZ_VECTOR_H
#include <blitz/vector.h>
... | {"hexsha": "fc0af8756c2db11d27a83b01acf959177aabb360", "size": 1014, "ext": "cc", "lang": "C++", "max_stars_repo_path": "bin/Python27/Lib/site-packages/scipy/weave/blitz/blitz/vecio.cc", "max_stars_repo_name": "lefevre-fraser/openmeta-mms", "max_stars_repo_head_hexsha": "08f3115e76498df1f8d70641d71f5c52cab4ce5f", "max_... |
[STATEMENT]
lemma LIM_compose_eventually:
assumes "f \<midarrow>a\<rightarrow> b"
and "g \<midarrow>b\<rightarrow> c"
and "eventually (\<lambda>x. f x \<noteq> b) (at a)"
shows "(\<lambda>x. g (f x)) \<midarrow>a\<rightarrow> c"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<lambda>x. g (f x)) \<midar... | {"llama_tokens": 262, "file": null, "length": 2} |
"""Authors: Cody Baker and Ben Dichter."""
from abc import ABC
from typing import Union, Optional
from pathlib import Path
import numpy as np
import spikeextractors as se
from pynwb import NWBFile
from pynwb.device import Device
from pynwb.ecephys import ElectrodeGroup, ElectricalSeries
from ...basedatainterface impo... | {"hexsha": "436bdb52c4357d7099b0fdd1fd793dd4bba89b59", "size": 6800, "ext": "py", "lang": "Python", "max_stars_repo_path": "nwb_conversion_tools/datainterfaces/ecephys/baserecordingextractorinterface.py", "max_stars_repo_name": "JuliaSprenger/nwb-conversion-tools", "max_stars_repo_head_hexsha": "f6519c88a563fba991e9e85... |
\documentclass{article}
\usepackage{graphicx} % Provides graphics utilities
\graphicspath{ {figures/} } % Sets graphics path
\usepackage{pdfpages} % Allows pdfs to be inserte into this document
\usepackage[hyphens]{url} % Breaks long URLs across lines
% Load last
\usepackage{hyperref} % Makes hyperlinks in ... | {"hexsha": "a778bdbf3d5c9bb1735e1758a3496b5c2f904933", "size": 17220, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "BranchStrategy.tex", "max_stars_repo_name": "MatthewHeun/DevelopmentStrategies", "max_stars_repo_head_hexsha": "2f45e2fed0b1e41e380d2486badc5f5c6838d729", "max_stars_repo_licenses": ["MIT"], "max_s... |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | {"hexsha": "d73a373fd11bd9024f12a8bf2cf1d267d646c97a", "size": 1999, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils.py", "max_stars_repo_name": "salvatoretrimarchi/handwritten-tf-1.0", "max_stars_repo_head_hexsha": "bf85dfbcfcfa8624bb1ab38c6dc33d75e4771bb1", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
// Copyright 2017 Peter Dimov.
//
// 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
#include <boost/variant2/variant.hpp>
#include <boost/config.hpp>
using namespace boost::variant2;
#define STATIC_ASSERT(...)... | {"hexsha": "0f9a40c511258700feda5a64054d0f814b42c4ea", "size": 2045, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "3rdParty/boost/1.71.0/libs/variant2/test/variant_get_by_type_cx.cpp", "max_stars_repo_name": "rajeev02101987/arangodb", "max_stars_repo_head_hexsha": "817e6c04cb82777d266f3b444494140676da98e2", "max... |
#pragma once
/**
* \see https://www.boost.org/doc/libs/1_71_0/libs/beast/example/advanced/server-flex/advanced_server_flex.cpp
**/
#include "algo/CallbackManager.hpp"
#include "algo/NetworkOperation.hpp"
#include <algorithm>
#include <boost/asio/bind_executor.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/as... | {"hexsha": "2126016421916f0f4e871f3ee31dc11e4552ad82", "size": 1818, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/net/ws/WsNetworkOperation.hpp", "max_stars_repo_name": "lineCode/webrtc-datachannels", "max_stars_repo_head_hexsha": "0f814632361c829c3aff1764cb662bd6290d54d9", "max_stars_repo_licenses": ["Apac... |
import cv2
import time
import numpy as np
from .utils import format_boxes
class OpenCVYOLO(object):
"""OpenCVYOLO class - inference class for YOLO model in OpenCV"""
def __init__(self, model_path, cfg_file, input_size, iou_threshold, score_threshold, opencv_dnn_target='CPU'):
self.cfg_file = cfg_file... | {"hexsha": "61a40c4e05000ea6c3ed93f4c65783720e529d29", "size": 2134, "ext": "py", "lang": "Python", "max_stars_repo_path": "detectors/yolo_opencv.py", "max_stars_repo_name": "RitwickGhosh/DeepSORT-YOLOv4-TensorRT-OpenVINO", "max_stars_repo_head_hexsha": "104e0433c56cebb7db503e23aaec9e7f1d7fdd3a", "max_stars_repo_licens... |
program test
integer :: i,k
real,pointer :: x(:)
logical ::FLAG
allocate(x(10))
k=0
FLAG=TRUE
!$omp target parallel do if(target:FLAG)
do i=1, 10
x(i)=1
enddo
!$omp end target parallel do
end program test
| {"hexsha": "49234723a421f18413f96eefd7764a569abe28e7", "size": 207, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "test/smoke/flang-275194-1/flang-275194.f90", "max_stars_repo_name": "saiislam/aomp", "max_stars_repo_head_hexsha": "e7dd8a459ba689429ad057b4a650fdcdcc7ce5ff", "max_stars_repo_licenses": ["Apache-... |
#================================================
AbstractSkipList API definition, typedefs, and
shared code for child types.
=================================================#
#===========================
Typedefs
===========================#
"""
SkipList{T,M} <: AbstractSkipList{T,M}
A non-concurrent skip li... | {"hexsha": "486c7c0a7adf25c24660bbed1e92b835de231c38", "size": 3006, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/list.jl", "max_stars_repo_name": "kernelmethod/SkipLists.jl", "max_stars_repo_head_hexsha": "563bbec8c453e38f7ec0e9fa66c2883b29699df5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
"""
Lambdata: A collection of Data Science helper functions
"""
import pandas as pd
import numpy as np
TEST = pd.DataFrame()
## Train/test split function for a dataframe
# Inherit from panda's DataFrame
# class MyDataFrame(pd.DataFrame):
# def num_cells(self):
# return self.shape[0] * self.shape[1]
def ... | {"hexsha": "39320a4e76dc5c2fe25e28dc80cea9c2fc4df16d", "size": 1012, "ext": "py", "lang": "Python", "max_stars_repo_path": "lambdata.py", "max_stars_repo_name": "trevorwjames/lambdata-1", "max_stars_repo_head_hexsha": "4e71ee44c1b58b27e9fc9e42a7fe718674715b66", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
const UIntOrChar = Union{Unsigned, AbstractChar}
struct StaticString{N, T<:Unsigned} <: AbstractString
data::NTuple{N, T}
function StaticString{N, T}(t::NTuple{M, <:UIntOrChar}) where {N, T, M}
N == M || throw(DimensionMismatch(
"cannot construct StaticString{$N, $T} from input of length $M... | {"hexsha": "b8e476fadbacfb128fff74c8d8019fa224325f0b", "size": 1535, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/static.jl", "max_stars_repo_name": "Luapulu/StaticStrings.jl", "max_stars_repo_head_hexsha": "fe05a6f68ed792aa9b3b47407e3e15e19084e78c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
using Test, StatsModels
using DataFrames
using StatsBase
using unfold
include("test_utilities.jl")
data,evts = loadtestdata("testCase1") #
data_e,times = unfold.epoch(data=data_r,tbl=evts,τ=(-1.,1.1),sfreq=10) # cut the data into epochs
basisfunction = firbasis(τ=(-1,1),sfreq=10,name="A")
f = @formula 0~1 # 1
m_tu... | {"hexsha": "2e1dc0e1a5cf5f81ea414d5b1f8f5a3ecc75fc7f", "size": 912, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/predict.jl", "max_stars_repo_name": "ReneSkukies/unfold.jl", "max_stars_repo_head_hexsha": "bb2430f7262dd15ef869da4a65d3cf4ab4c7f0b4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
import numpy as np
from astropy import units as u
from astropy.coordinates import Distance
import os
import logging
from flarestack.shared import catalogue_dir
from flarestack.utils.prepare_catalogue import cat_dtype
from flarestack.cosmo.neutrino_cosmology import define_cosmology_functions, \
integrate_over_z, cum... | {"hexsha": "eb1821a9392ae88529c0b4fa8bada11fb694164e", "size": 6071, "ext": "py", "lang": "Python", "max_stars_repo_path": "flarestack/cosmo/simulate_catalogue.py", "max_stars_repo_name": "grburgess/flarestack", "max_stars_repo_head_hexsha": "6f94b9493d5470539e2705e473c84683720122cc", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
import matplotlib.pyplot as plt
def softmax_overflow(a):
''' Thissoftmax will cause overflow
'''
#輸入訊號的指數
exp = np.exp(a)
#輸入訊號的指數函數和
sum_exp = np.sum(exp)
y = exp/sum_exp
return y
def softmax(a):
#1. Set a constantant, which is the max value from input valu... | {"hexsha": "27af745132862e7071883fc94985b81c61b1df12", "size": 678, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/DeepLearn/venv/Lab/softmax.py", "max_stars_repo_name": "KarateJB/Python.Practice", "max_stars_repo_head_hexsha": "a5f00f669dc4b815601c093ce0753a0a82b4328a", "max_stars_repo_licenses": ["MIT"], ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import subprocess
import cv2
import numpy as np
import glob
from sklearn.utils import shuffle
from dataset import DataSet
def find_images(path):
"""
Returns an array with all image paths found dir.
Following extensions are used to filter ... | {"hexsha": "f169dd7770490b11d16ae32b7a34f9958bf7f847", "size": 3682, "ext": "py", "lang": "Python", "max_stars_repo_path": "plant_disease_classification/datagenerator.py", "max_stars_repo_name": "abdullahselek/plant-disease-detection", "max_stars_repo_head_hexsha": "8d4dabdfd47eb1969d2d2963b6946d9a514ae7aa", "max_stars... |
import argparse
import numpy as np
import matplotlib.pyplot as plt
from sklearn import decomposition
from sklearn import linear_model
from sklearn.ensemble import RandomForestRegressor
from sklearn import svm
from sklearn import gaussian_process
parser = argparse.ArgumentParser()
parser.add_argument('-model', type=st... | {"hexsha": "45522705c4a00e5d752d69bf224a09299fdc263e", "size": 1991, "ext": "py", "lang": "Python", "max_stars_repo_path": "source/machine_learning/trainModel.py", "max_stars_repo_name": "HuyTu7/face_rating", "max_stars_repo_head_hexsha": "a7d689c6cab3cee9f445c40c0267525641090c5a", "max_stars_repo_licenses": ["MIT"], "... |
import numpy as np
import math
num = 143
if num > 1 :
for i in range(2,num):
if num % i == 0 :
print(num,"is not a prime number")
print(i,"times",num//i,"is",num)
break
else :
print(num,"is a prime number")
else :
print(num,"is not a prime number") | {"hexsha": "f90c0fcf6f0fecd511883c0a4b99674c990ad866", "size": 268, "ext": "py", "lang": "Python", "max_stars_repo_path": "Number Theory/check_prime_number.py", "max_stars_repo_name": "Dheer08/Algorithms", "max_stars_repo_head_hexsha": "6731a5896ab338b6123280275fab5f36bdd52b4d", "max_stars_repo_licenses": ["MIT"], "max... |
!------------------------------------------------------------------------------------------
! File: S3M_Module_Data_Restart_Gridded.f90
! Author(s): Fabio Delogu, Francesco Silvestro, Simone Gabellani, Francesco Avanzi.
!
! Created on May 7, 2015, 1:27 PM
! Last update on October 26, 2020 11:25 AM
!
! Module to r... | {"hexsha": "7742fa6fa1e10ea762d19d6d9d479ac21519cb8b", "size": 33540, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "S3M_Module_Data_Restart_Gridded.f90", "max_stars_repo_name": "c-hydro/s3m-dev", "max_stars_repo_head_hexsha": "643dd6a329110db3cb83d3b9b844a3436fc8df23", "max_stars_repo_licenses": ["BSD-3-Clau... |
"""
Tketris
Tetris using tkinter
Author: Anshul Kharbanda
Created: 10 - 11 - 2018
"""
import numpy as np
from .bounds import BoardBounds, BoardRotateBounds, TileSetBound
from .tileset import BoardTileSet
from .controller import Controller
from .mino import Mino
class GameLogic(Controller):
"""
MIXIN
Ma... | {"hexsha": "b2f2ba56c97aff5cb1a048818feb879ae008748f", "size": 4094, "ext": "py", "lang": "Python", "max_stars_repo_path": "tketris/game/__init__.py", "max_stars_repo_name": "andydevs/tketris", "max_stars_repo_head_hexsha": "054914a9ad815b009b6792067bd689e36095e8de", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import logging
import numpy as np
from abc import abstractmethod
from typing import Set, Sequence, Hashable, Mapping, TypeVar
from msdm.core.problemclasses.mdp import MarkovDecisionProcess
from msdm.core.utils.funcutils import method_cache, cached_property
from msdm.core.distributions import FiniteDistribution, DictDis... | {"hexsha": "1ae3d9a28b6453afc102cbaa520241a8bb90aa43", "size": 8614, "ext": "py", "lang": "Python", "max_stars_repo_path": "msdm/core/problemclasses/mdp/tabularmdp.py", "max_stars_repo_name": "markkho/msdm", "max_stars_repo_head_hexsha": "f2e07cdf1a16f7a0564a4822caed89a758e14bf1", "max_stars_repo_licenses": ["MIT"], "m... |
\graphicspath{{./lab04/Images/}}
\maketitlepage{App Development}{in Android Studio}{Lab 4: Using Web APIs}
\maketocpage
\section{JSON}
JSON stands for JavaScript Object Notation. It is a human readable data format storing its data in key-value pairs. All its keys must be strings but the values can be strings, numeri... | {"hexsha": "c570a1cb9bf4b080bbda0818f560d7d3b783e9ff", "size": 8841, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/lab04/lab04.tex", "max_stars_repo_name": "JonSteinn/AndroidDevelopment", "max_stars_repo_head_hexsha": "2d4920d044b552ca1180ca11dfee7456cfc6218c", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_... |
{"mathlib_filename": "Mathlib.Tactic.NormNum", "llama_tokens": 0} | |
from xevo.evo import evo
import numpy as np
import time
class morthoevo(evo):
"""orthoevo, but using highdimensional definition of similarity. Does not neccesarily produce better results than orthoevo, since orthoevo seems to produce similar groups in higher dimensions (if d1 is 3 than d3=9)"""
... | {"hexsha": "2be532fcdf155aff91680fa313d0c63a4dc2445c", "size": 936, "ext": "py", "lang": "Python", "max_stars_repo_path": "xevo/optimizers/morthoevo.py", "max_stars_repo_name": "psorus/xevo", "max_stars_repo_head_hexsha": "49cf9f27dea26135d442e393248e47daf2d99f8b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
#include <iostream>
#include <memory>
#include <thread>
#include <chrono>
#include <unordered_map>
#include <Eigen/Geometry>
#include <lcm/lcm-cpp.hpp>
#include <lcmtypes/maps/data_request_list_t.hpp>
#include <lcmtypes/maps/request_t.hpp>
#include <lcmtypes/maps/shaper_data_request_t.hpp>
#include <ConciseArgs>
#in... | {"hexsha": "cb1863bbafdd087af9e3ee1396da2b085eadb872", "size": 22938, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/apps/DataRequestServer.cpp", "max_stars_repo_name": "mcamurri/maps_server", "max_stars_repo_head_hexsha": "0c6083913032ac9094ef4db216be17a6b936bb10", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
import numpy as np
import numpy.polynomial as P
import scipy as sp
from sklearn.preprocessing import PolynomialFeatures
from samplers import ULA_light
from potentials import GaussPotential,GaussMixture,GausMixtureIdent,GausMixtureSame
import copy
from baselines import set_function
import time
def H(k, x):
if k==0:... | {"hexsha": "2af9342521eff1fa33a2c1852f32d947d737b8ac", "size": 10449, "ext": "py", "lang": "Python", "max_stars_repo_path": "Code/martingale.py", "max_stars_repo_name": "svsamsonov/VR-MCMC", "max_stars_repo_head_hexsha": "335ffb0835917b1cdce633877099c8452e3aeb78", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma valid_insert_both_member_options_pres: "invar_vebt t n \<Longrightarrow> x<2^n \<Longrightarrow> y < 2^n \<Longrightarrow> both_member_options t x
\<Longrightarrow> both_member_options (vebt_insert t y) x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>invar_vebt t n; x < 2... | {"llama_tokens": 63280, "file": "Van_Emde_Boas_Trees_VEBT_Insert", "length": 310} |
#redirect Remote Printing
| {"hexsha": "33b06492ce37e52d466ff9f6c049ddfd4bd9c5ca", "size": 27, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Wireless_Printing.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma list_all3_cons[intro]: "list_all3 P xs ys zs \<Longrightarrow> P x y z \<Longrightarrow> list_all3 P (x # xs) (y # ys) (z # zs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>list_all3 P xs ys zs; P x y z\<rbrakk> \<Longrightarrow> list_all3 P (x # xs) (y # ys) (z # zs)
[PROOF STEP]
by si... | {"llama_tokens": 143, "file": "CakeML_Codegen_Utils_Compiler_Utils", "length": 1} |
#-------------------------------------------------------------------------------------------------
#--
#-- Ususal libraries
#--
using CSV, Dates
using DataFrames, DataFramesMeta
using Plots, PyPlot
using DifferentialEquations
#--------------------------------------------------------------------------------------------... | {"hexsha": "041ede8d9a2964e3bc38580f0f4e372896604891", "size": 10456, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "COVID-19-model.jl", "max_stars_repo_name": "lbenet/COVID-19-Julia", "max_stars_repo_head_hexsha": "97301f5061e9de35f95c4d00169bd49b489f9974", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
'''
Target: Compute structure similarity (SSIM) between two 3D volumes
Created on Jan, 22th 2018
Author: Dong Nie
reference from: http://simpleitk-prototype.readthedocs.io/en/latest/user_guide/plot_image.html
'''
import SimpleITK as sitk
from multiprocessing import Pool
import os
import h5py
import numpy as np
impo... | {"hexsha": "d0ab2f0f837567c4a952f2a3107389c26a1c4ef0", "size": 3710, "ext": "py", "lang": "Python", "max_stars_repo_path": "compute3DSSIM.py", "max_stars_repo_name": "andry900/NN-Project", "max_stars_repo_head_hexsha": "e04a83029f5990d9b65216ab0648a8826a8ebca7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16... |
import os
import sys
from glob import glob
import numpy as np
import subprocess
import getopt
def export_inference_graph(PATH_TO_EXPORT_INF_PY, model_name, config_path, checkpoint):
P_MODEL_DIR = f"/home/GerminationPrediction/workspace/{model_name}/ckpt/"
P_INF_GRAPH = f"/home/GerminationPrediction/workspace/... | {"hexsha": "341a192e63d0b34af5921b7c32902b9882e41b6d", "size": 1616, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/export_inference_graph.py", "max_stars_repo_name": "grimmlab/GerminationPrediction", "max_stars_repo_head_hexsha": "7421705918a17f6ebf2ee5c3fefb46856e2e0a42", "max_stars_repo_licenses": ["... |
"""Contains the functions used to print the trajectories and read input
configurations with xyz formatting.
Copyright (C) 2013, Joshua More and Michele Ceriotti
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software F... | {"hexsha": "e5fe3e93b71c22121b8be623c408a4956d1ede14", "size": 4676, "ext": "py", "lang": "Python", "max_stars_repo_path": "lammps-master/tools/i-pi/ipi/utils/io/io_xyz.py", "max_stars_repo_name": "rajkubp020/helloword", "max_stars_repo_head_hexsha": "4bd22691de24b30a0f5b73821c35a7ac0666b034", "max_stars_repo_licenses"... |
using MCIntegrals
const P = MCIntegrals
using Test
using StaticArrays
using LinearAlgebra
using Random
using Setfield
using Cuba: vegas
using HCubature
function isconsistent(truth, est; nstd=6, kw_approx...)
val = est.value
Δ = nstd * est.std
if ≈(val, truth; kw_approx...)
true
else
tru... | {"hexsha": "a6bd7b8eabae11c9dbc1549ccca9543c679307b8", "size": 4966, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "jw3126/MCIntegrals.jl", "max_stars_repo_head_hexsha": "fc0a71fc72fca1d71258794874390689f8d512bb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
using Test
import BinaryTrees
bt = BinaryTrees
| {"hexsha": "592973a081f1a6b80acf4a585a59d1be890716d2", "size": 47, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "control13/BinaryTrees.jl", "max_stars_repo_head_hexsha": "1cf3cb14953ad86e63ae27222a344b347a016078", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import numpy as np
class Wave:
"""This class represents a wind wave.
In order to create a `Wave` instance you need to provide time and water
level data as NumPy arrays. It implements methods to perform tidal
correction and signal characterization, and to estimate parameters for the
statistical dis... | {"hexsha": "925ac12df7f8ce8fea3a6b86ef00091fc4f799f2", "size": 5068, "ext": "py", "lang": "Python", "max_stars_repo_path": "coastal_engineering/wave.py", "max_stars_repo_name": "dact221/coastal-engineering", "max_stars_repo_head_hexsha": "654e277372af8df4853c4515fd00c910f89f0aa4", "max_stars_repo_licenses": ["MIT"], "m... |
program plotforce
real rplot(0:200),zplot(0:200),vc(0:200),
: vd(0:200),vh(0:200),vb(0:200),fz(0:200)
character*60 toplbl,filename
integer*4 ibuf1(15)
character ans
open(20,file='scales',status='old',err=5)
read(20,*) rscale
write(*,*) 'Will normalize model so ... | {"hexsha": "b45bd6f0cbc3ebb5f23f052c486de716cc46f567", "size": 3849, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/amuse/community/galactics/gas_src/src/plotforce.f", "max_stars_repo_name": "rknop/amuse", "max_stars_repo_head_hexsha": "85d5bdcc29cfc87dc69d91c264101fafd6658aec", "max_stars_repo_licenses": [... |
//
// Created by Dado on 2019-04-15.
//
#pragma once
#include <memory>
#include <unordered_map>
#include <functional>
#include <boost/signals2.hpp>
#include <core/resources/resource_utils.hpp>
#include <core/resources/resource_types.hpp>
using NodeVariantsSP = GeomSP;
using NodeGraphContainer = std::unordered_map<R... | {"hexsha": "29f146fff82911578eb1b80aa2610484f36f0c70", "size": 5564, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "native/poly/node_graph.hpp", "max_stars_repo_name": "49View/event_horizon", "max_stars_repo_head_hexsha": "9b78c9318e1a785384ab01eb4d90e79f0192c6ad", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
%% TMP
addpath('./libqp/matlab/');
%%
% Example: Training two-class SVM classifier with L2-regularized bias term.
% load training and testing data
load('riply_dataset','trn_X','trn_y','tst_X','tst_y');
% ensure that the labels are +1/-1
trn_y(find(trn_y~=1)) = -1;
tst_y(find(tst_y~=1)) = -1;
% input arguments
lamb... | {"author": "uricamic", "repo": "flandmark", "sha": "ecf122f93f73504fe7d8faccca525c6b1e98fdcd", "save_path": "github-repos/MATLAB/uricamic-flandmark", "path": "github-repos/MATLAB/uricamic-flandmark/flandmark-ecf122f93f73504fe7d8faccca525c6b1e98fdcd/learning/bmrm/parbmrm_svm_example.m"} |
import numpy as np
import matplotlib.pyplot as plt
from fenics import File
from pipeline.dolfin_adjoint.elasticity_solver import elasticity_solver
from marmousi.marmousi2_tools import read_data
config_path = 'play_run_marmousi_model_solver_config.yaml'
# mask = np.ones(shape=(128,128))
# la = mask * 1.0e+10
# mu = m... | {"hexsha": "4b54f7e4c6a35bb540a91f4b0d25f45c767a993a", "size": 1411, "ext": "py", "lang": "Python", "max_stars_repo_path": "marmousi/play_run_marmousi_model.py", "max_stars_repo_name": "HSE-LAMBDA/RheologyReconstruction", "max_stars_repo_head_hexsha": "fe89dea28ab0873d075e69c51e9ae2aeb07fe8e2", "max_stars_repo_licenses... |
import numpy as np
from matplotlib import cm, pyplot as plt
from torch.utils.data import Dataset
from utils import plane as sharedplane
class PlaneDataset(Dataset):
def __init__(self, n):
self.n = n
self.data = None
self.create_data()
def __getitem__(self, item):
return self... | {"hexsha": "4bbcec0670371c74e6720bd1705fe56610c0b30f", "size": 2748, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch/data_/plane.py", "max_stars_repo_name": "NunoEdgarGFlowHub/autoregressive-energy-machines", "max_stars_repo_head_hexsha": "eb5517a513cf4e99db674fa41170f018e212f1e2", "max_stars_repo_licens... |
import math
import control as ctrl
import numpy as np
import pylab as pl
import matplotlib.patches as mpatches
import random
from math import exp
from scipy.integrate import odeint
from GlycemicControlpoly import Glycemic, Glycemic1,Glycemic2, Glycemic3, Glycemic4,Glycemic5, Glycemic6, Glycemic7, Glycemic8
import slyco... | {"hexsha": "5f428cd9dc1048f4d0540203848a73c74efadc10", "size": 26894, "ext": "py", "lang": "Python", "max_stars_repo_path": "estimate_switched.py", "max_stars_repo_name": "HusseinSibai/SwitchedSystemsStateEstimation", "max_stars_repo_head_hexsha": "d9d4dbb5a5c34ec4b317e0825dd9fe5da5d50c5b", "max_stars_repo_licenses": [... |
#include "TcpTransport.h"
#include <iostream>
#include <boost/bind/bind.hpp>
#include <boost/thread.hpp>
#include <boost/make_shared.hpp>
using namespace boost::placeholders;
TcpTransport::TcpTransport(boost::shared_ptr<boost::asio::io_context> ioc, boost::shared_ptr<boost::asio::ip::tcp::socket> socket, time_t tim... | {"hexsha": "b172e73b87595f43ce345da274d73f6eef9bde1b", "size": 7498, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "transport/TcpTransport.cpp", "max_stars_repo_name": "zouxiaoliang/flex", "max_stars_repo_head_hexsha": "b91bafd5e13e24b17d399d1c99dcce6ad770b3ca", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
'''
TREC question-type classification
'''
from __future__ import absolute_import, division, unicode_literals
import os
import... | {"hexsha": "962aad945cad823b288ea17d0c6ff4cf744a1f0b", "size": 3550, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/senteval/trec.py", "max_stars_repo_name": "BinWang28/EvalRank-Embedding-Evaluation", "max_stars_repo_head_hexsha": "454dac5c7345f01993688f33375f637129c285e3", "max_stars_repo_licenses": ["BSD-... |
import collections
import torch
import numpy as np
from continuum.metrics.metrics import accuracy, \
get_model_size_efficiency, \
get_model_size, \
forgetting, \
accuracy_A, \
remembering, \
positive_backward_transfer, \
forward_transfer, \
backward_transfer
def require_subset(subset)... | {"hexsha": "99d96f43fc62777be102176175c0a2f1fb3e20ff", "size": 6317, "ext": "py", "lang": "Python", "max_stars_repo_path": "continuum/metrics/logger.py", "max_stars_repo_name": "prlz77/continuum", "max_stars_repo_head_hexsha": "61b59a7c68c8874b5bbf12636d903d2c08688121", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import os
import argparse
import cv2
import numpy as np
import sys
import time
from threading import Thread
import importlib.util
# Define and parse input arguments
# Define and parse input arguments
parser = argparse.ArgumentParser()
parser.add_argument('--modeldir', help='Folder the .tflite file is located in',
... | {"hexsha": "2b892e31fd2e789942f9d413dee8c5e1e393595e", "size": 6299, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/RaspberryPi/Kayakcounter_Video.py", "max_stars_repo_name": "trirop/Kayakcounter", "max_stars_repo_head_hexsha": "974fa2a030e839ffc1fdd777359adb8cbb7e1ec4", "max_stars_repo_licenses": ["Xnet",... |
cross(x::Vector{XFloat16}, y::Vector{XFloat16}) = reinterpret(XFloat16, cross(reinterpret(Float32, x), reinterpret(Float32, y)))
(*)(x::Vector{XFloat16}, y::Vector{XFloat16}) = reinterpret(XFloat16, (*)(reinterpret(Float32, x), reinterpret(Float32, y)))
dot(x::Vector{XFloat16}, y::Vector{XFloat16}) = reinterpret(XFloa... | {"hexsha": "c76c8fb154e56d1de23078a6c52607d146a07844", "size": 2728, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/dispatch/linearalgebra.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/XFloats.jl-ad7b0a5e-d6ee-550c-835e-59a288c14bf3", "max_stars_repo_head_hexsha": "d85fcae7f702e0f51ed6bc63d1075... |
# Copyright 2021, The TensorFlow Federated Authors. #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | {"hexsha": "c4d68abe8854e64181d9c81d461e83520c8c793d", "size": 19114, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow_federated/python/learning/models/functional_test.py", "max_stars_repo_name": "ahmedopolis/federated", "max_stars_repo_head_hexsha": "690142b52be272c465c18111aa55763bb381b7f5", "max_sta... |
#
# NumpyArray class
#
import numpy as np
import pybamm
from scipy.sparse import issparse, csr_matrix
class Array(pybamm.Symbol):
"""node in the expression tree that holds an tensor type variable
(e.g. :class:`numpy.array`)
Parameters
----------
entries : numpy.array
the array associated... | {"hexsha": "6acdd07950fb60135e217e49e4053683d2afa597", "size": 3132, "ext": "py", "lang": "Python", "max_stars_repo_path": "pybamm/expression_tree/array.py", "max_stars_repo_name": "gyouhoc/PyBaMM", "max_stars_repo_head_hexsha": "6852e0e518157e6802ce83a2549562e7d0ed4b9f", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
/**
* @file gradient_visitor.hpp
* @author Marcus Edel
*
* This file provides an abstraction for the Gradient() function for different
* layers and automatically directs any parameter to the right layer type.
*
* mlpack is free software; you may redistribute it and/or modify it under the
* terms of the 3-clause... | {"hexsha": "f5583e740a98c94aab49236940d1ecd3ac35b7c0", "size": 2656, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/mlpack/methods/ann/visitor/gradient_visitor.hpp", "max_stars_repo_name": "RMaron/mlpack", "max_stars_repo_head_hexsha": "a179a2708d9555ab7ee4b1e90e0c290092edad2e", "max_stars_repo_licenses": ["B... |
import math
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
from collections import OrderedDict, Iterable
from torchvision import transforms
__all__ = [
"defuse_model",
"normalize_image",
"convert_image_tensor",
"combine_images",
"assert_numpy_image",
"ins... | {"hexsha": "ba432ef95d0f8bd7ca487b60e52e91ea65e785a5", "size": 5802, "ext": "py", "lang": "Python", "max_stars_repo_path": "viztools/util.py", "max_stars_repo_name": "andrijdavid/viztools-pytorch", "max_stars_repo_head_hexsha": "47e9567f38a0a60c778d4d77de067edaaa07b8c0", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
[STATEMENT]
lemma unlr_inf: "unlr (inf x y) = unlr x \<inter> unlr y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. unlr (inf x y) = unlr x \<inter> unlr y
[PROOF STEP]
unfolding inf_admS_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. unlr (mklr (unlr x \<inter> unlr y)) = unlr x \<inter> unlr y
[PROOF STEP]... | {"llama_tokens": 160, "file": "PCF_Logical_Relations", "length": 2} |
import tensorflow.compat.v1 as tf
from tensorflow.contrib import slim
import numpy as np
from sklearn.metrics import accuracy_score
from models.utils import sparse_dropout
spdot = tf.sparse_tensor_dense_matmul
dot = tf.matmul
tf.set_random_seed(15)
flags = tf.app.flags
FLAGS = flags.FLAGS
class LATGCN:
def __ini... | {"hexsha": "d7a61c2ef5dca8d18386e87d1ea4bfaa37c4ba4b", "size": 11814, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/latgcn.py", "max_stars_repo_name": "cshjin/LATGCN", "max_stars_repo_head_hexsha": "27a2ff9385f5c3c48a21662bb6fe0722cc78c68d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max... |
import time
import numpy as np
from hipose.data.trial_parsing.extract_ergowear import extract_ergowear_raw_data, default_ergowear_imus_manual_alignment
from hipose.data.dataset_parsing.parse_cip_ergowear_dataset import map_segs_xsens2ergowear
from hipose.data.trial_parsing.extract_xsens_analyse import extract_xsens_a... | {"hexsha": "e0cc5dc1741c42d04cea8a60b548edb9433d5527", "size": 4871, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/visualize_evaluate_inertial_pose.py", "max_stars_repo_name": "ManuelPalermo/HumanInertialPose", "max_stars_repo_head_hexsha": "3e966ddbab76345f915e16056efa7e433d0cb70e", "max_stars_repo_l... |
module Mod_caseDoiter
use Mod_GeneralCase
use Mod_DistributedContainer
use Mod_DriverInterface
use Mod_DCHashCharSize
use Mod_caseVariables
use Mod_DC_Driver
implicit none
type(caseVariables), pointer :: c => NULL()
contains
subroutine LoopDoIter(myDC)
class(DistributedContainer... | {"hexsha": "d23fce5402d0b5da98dd56eb9c46a1b87db6e4a6", "size": 929, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "Sources/master/GeneralCase/case_Doiter.f90", "max_stars_repo_name": "ciaid-colombia/InsFEM", "max_stars_repo_head_hexsha": "be7eb35baa75c31e3b175e95286549ccd84f8d40", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma terminates_flatten_raw:
assumes "terminates g''" "terminates g"
shows "terminates flatten_raw"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. terminates local.flatten_raw
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. \<And>s. s \<in> terminates_on local.flatten_raw
[PROO... | {"llama_tokens": 2344, "file": "Stream_Fusion_Code_Stream_Fusion_List", "length": 25} |
"""
Head motion correction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. autofunction:: init_dwi_hmc_wf
.. autofunction:: init_dwi_model_hmc_wf
"""
import nipype.pipeline.engine as pe
from pkg_resources import resource_filename as pkgrf
from nipype.interfaces import ants, afni, utility as niu
from ...engine import... | {"hexsha": "4bf0a2c69554db9dc246eb771965ff73ba4942b4", "size": 31370, "ext": "py", "lang": "Python", "max_stars_repo_path": "qsiprep/workflows/dwi/hmc.py", "max_stars_repo_name": "arokem/qsiprep", "max_stars_repo_head_hexsha": "f0a12fa002ea99cad97f2b5e40c1517d0569e14c", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
import numpy as np
import lmdb
import sys
sys.path.append("/home/lancy/caffe/python")
from PIL import Image
import os
import caffe
from copy import deepcopy
HEIGHT = 500
WIDTH = 500
TRAIN_FILE_LIST = open("/data/VOC/VOCdevkit/VOC2012/ImageSets/Segmentation/train.txt", "r").read().strip().split("\n")[:-1]
TEST_FILE_L... | {"hexsha": "613ecca6275bc2295ef4f46d9b7b05fc92fbe2e1", "size": 2294, "ext": "py", "lang": "Python", "max_stars_repo_path": "gen_lmdb.py", "max_stars_repo_name": "voidrank/FCN-VOC2012-Training-Config", "max_stars_repo_head_hexsha": "e6a43153a73ad00f084d3927dc5e56633579d357", "max_stars_repo_licenses": ["MIT"], "max_star... |
function [y, Sigma_y] = GMR(Priors, Mu, Sigma, x, in, out)
%
% Gaussian Mixture Regression.
% This source code is the implementation of the algorithms described in
% Section 2.4, p.38 of the book "Robot Programming by Demonstration: A
% Probabilistic Approach".
%
% Author: Sylvain Calinon, 2009
% http://programming... | {"author": "epfl-lasa", "repo": "ML_toolbox", "sha": "61cc1245a2abe0c86a737d7b48bd645b28ffebee", "save_path": "github-repos/MATLAB/epfl-lasa-ML_toolbox", "path": "github-repos/MATLAB/epfl-lasa-ML_toolbox/ML_toolbox-61cc1245a2abe0c86a737d7b48bd645b28ffebee/methods/toolboxes/gmmbox/GMMfunctions/GMM-GMR-v2.0/GMR.m"} |
[STATEMENT]
lemma HaddP_subst [simp]: "(HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (HaddP x y z)(i::=t) = HaddP (subst i t x) (subst i t y) (subst i t z)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. (HaddP x y z)(i::... | {"llama_tokens": 552, "file": "Goedel_HFSet_Semanticless_II_Prelims", "length": 6} |
"""Script to compute the HCQT on a list of filepaths
"""
from __future__ import print_function
import argparse
import csv
from joblib import Parallel, delayed
import librosa
import numpy as np
import sys
def get_hcqt_params():
"""Static function to store HCQT parameters.
Returns
-------
bins_per... | {"hexsha": "6f05efb98d51f2ab5aa55f701fc02b53f845cb9b", "size": 3877, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepsalience/compute_hcqts.py", "max_stars_repo_name": "jollyjonson/multitask-f0", "max_stars_repo_head_hexsha": "0f33475599bd69acce8cd9a1a96f20fc1c8b7701", "max_stars_repo_licenses": ["MIT"], "ma... |
"""Very simple example using a pair of Lennard-Jones particles.
Requires the package `openmmtools` which can be installed from
anaconda: `conda install -c omnia openmmtools`
Openmmtools just provides a ready-made system for the lennard jones
particles.
This script is broken up into several parts:
1. Importing the p... | {"hexsha": "f7b9b3619b2be69617fdf2d94180ec31c06d8258", "size": 8946, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/Lennard_Jones_Pair/we.py", "max_stars_repo_name": "fabian-paul/wepy", "max_stars_repo_head_hexsha": "3a470f364a5ffbefcdb5d17a12cd08d90f4944e4", "max_stars_repo_licenses": ["MIT"], "max_st... |
'''
File Created: Monday, 25th November 2019 1:35:30 pm
Author: Dave Zhenyu Chen (zhenyu.chen@tum.de)
'''
import os
import sys
import time
import torch
import numpy as np
from tqdm import tqdm
from tensorboardX import SummaryWriter
from torch.optim.lr_scheduler import StepLR, MultiStepLR, CosineAnnealingLR
from lib.c... | {"hexsha": "d62c4757ea6f0027efb24728f9ff5b82d66d9cd0", "size": 29616, "ext": "py", "lang": "Python", "max_stars_repo_path": "openks/models/pytorch/mmd_modules/ThreeDJCG/lib/visual_grounding/solver.py", "max_stars_repo_name": "vivym/OpenKS", "max_stars_repo_head_hexsha": "ea380782162de2e4c1a413f37ad12b85ccb7048a", "max_... |
import numpy as np
from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils.multiclass import unique_labels
from sklearn.utils.validation import check_array, check_is_fitted, check_X_y
from optim import hmc, sghmc
class BayesianLogisticRegression(ClassifierMixin, BaseEstimator):
"""
Bayesia... | {"hexsha": "6ca1a612fd260697d77b9f704b4018a3698c64af", "size": 2683, "ext": "py", "lang": "Python", "max_stars_repo_path": "build/lib/blr-sghmc/classifier.py", "max_stars_repo_name": "tienyuliu/blr-dev", "max_stars_repo_head_hexsha": "6ec6cd334d5c69df56abf345a84805c4d2bc96bf", "max_stars_repo_licenses": ["MIT"], "max_s... |
# This file was generated by JuDoc, do not modify it. # hide
vv = inverse_transform(stand, w)
@show sum(abs.(vv .- v))
| {"hexsha": "5673f5190c61a322f9fcdbe05b32c9e9a5b46b57", "size": 119, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "_assets/pages/getting-started/fit-and-predict/code/ex13.jl", "max_stars_repo_name": "giordano/DataScienceTutorials.jl", "max_stars_repo_head_hexsha": "8284298842e0d77061cf8ee767d0899fb7d051ff", "max... |
(* -*- mode: coq; mode: visual-line -*- *)
(** * HPropositions *)
Require Import HoTT.Basics HoTT.Types.
Local Open Scope path_scope.
Generalizable Variables A B.
(** ** Truncatedness is an hprop *)
(** If a type is contractible, then so is its type of contractions.
Using [issig_contr] and the [equiv_intro] t... | {"author": "CPP21-Universal-Algebra-in-HoTT", "repo": "Universal-Algebra-in-HoTT", "sha": "7228b5b88684abff3c26a7eed07e1222b04fd8de", "save_path": "github-repos/coq/CPP21-Universal-Algebra-in-HoTT-Universal-Algebra-in-HoTT", "path": "github-repos/coq/CPP21-Universal-Algebra-in-HoTT-Universal-Algebra-in-HoTT/Universal-A... |
[STATEMENT]
lemma psubst_forget:
"(supp (map fst \<theta>)::name set) \<sharp>* t \<Longrightarrow> \<theta>\<lparr>t\<rparr> = t"
"(supp (map fst \<theta>)::name set) \<sharp>* t' \<Longrightarrow> \<theta>\<lparr>t'\<rparr>\<^sub>b = t'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (supp (map fst \<theta>) \... | {"llama_tokens": 5373, "file": null, "length": 17} |
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from gridnet import GridNet
from flow_reversal import FlowReversal
from collections import OrderedDict
from gridnet3d import Grid3DNet
import sys
import cv2
import torchvision
sys.path.insert(1,'/media/data/saikat/irr/')
from m... | {"hexsha": "e67dfa7ad0731821aaeb0d04d5dfb8048640dc1f", "size": 5360, "ext": "py", "lang": "Python", "max_stars_repo_path": "model.py", "max_stars_repo_name": "saikatdutta/NME-VFI", "max_stars_repo_head_hexsha": "5915e2336ea3ed7113a9c6a91bbc7f6b5deaac17", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 1, ... |
// Copyright (c) 2001-2009 Hartmut Kaiser
//
// 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)
#if !defined(BOOST_SPIRIT_KARMA_TEST_FEB_23_2007_1221PM)
#define BOOST_SPIRIT_KARMA_TEST_FEB_23_2007_1221PM
#includ... | {"hexsha": "0b4a55f1d7c85a883744b4773d4f06e9379b8177", "size": 9377, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "libs/spirit/test/karma/test.hpp", "max_stars_repo_name": "mike-code/boost_1_38_0", "max_stars_repo_head_hexsha": "7ff8b2069344ea6b0b757aa1f0778dfb8526df3c", "max_stars_repo_licenses": ["BSL-1.0"], "... |
"""Runs the Quantum Approximate Optimization Algorithm on Max-Cut.
=== EXAMPLE OUTPUT ===
Example QAOA circuit:
0 1 2
│ │ │
H H H
│ │ │
ZZ────────ZZ^0.974 │
│ │ │
Rx(0.51π) ZZ────────ZZ^0.974
│ │ │
│ Rx(0.51π) Rx(... | {"hexsha": "b6e2eefb4a6d268bf6e33661fe7abbf9157fc9b8", "size": 8351, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/2020_672_qaoa.py", "max_stars_repo_name": "yipenghuang0302/Cirq", "max_stars_repo_head_hexsha": "676440f2d5c82878c6627b4d7d87638baf70083d", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
import sympy as sym
from sympy.utilities.lambdify import lambdify
import numpy as np
import math
#%%
n = sym.Symbol('n')
#n=1 #Descomentar para obtener el caso n=1
lamb = sym.Symbol('lamb')
n=1
c1 = sym.Symbol('c1')
c2 = sym.Symbol('c2')
lamb=c1/(c2**(0.5))
Rs = sym.Symbol('Rs')
r = sym.Symbol('r') #R/Rs
R = Rs*r
... | {"hexsha": "976a27a451612dce256a1ed7621b69860764e692", "size": 557, "ext": "py", "lang": "Python", "max_stars_repo_path": "Software/Sandbox/Calculo simbolico/ST_gamma.py", "max_stars_repo_name": "matiasleize/tesis_licenciatura", "max_stars_repo_head_hexsha": "5df6e341314583702b466b8ed7977d410f0ee457", "max_stars_repo_l... |
from typing import Union
import numpy as np
import pandas as pd
from ..MetaModel import MetaModel
pd.options.mode.chained_assignment = None # default='warn'
class _AvailableIfDescriptor:
"""Implements a conditional property using the descriptor protocol.
Using this class to create a decorator will raise a... | {"hexsha": "a18f42c8d55391882c351eb9a4871648b29508e8", "size": 4472, "ext": "py", "lang": "Python", "max_stars_repo_path": "TinyAutoML/Models/MetaModels/DemocraticModel.py", "max_stars_repo_name": "g0bel1n/TinyAutoML", "max_stars_repo_head_hexsha": "d77dad525b00daf243fe335fabdddac563bc133a", "max_stars_repo_licenses": ... |
[STATEMENT]
lemma evaluate_clock_monotone:
\<open>clock (fst (evaluate env s e)) \<le> clock s\<close>
if \<open>evaluate_dom (env, s, e)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. clock (fst (Evaluate_Single.evaluate env s e)) \<le> clock s
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 su... | {"llama_tokens": 618, "file": "CakeML_Evaluate_Single", "length": 7} |
[STATEMENT]
lemma Domain_nodes_connected: "Domain {(x, y) |x y. nodes_connected G x y} = V"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. Domain {(x, y) |x y. nodes_connected G x y} = V
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>x. x \<in> V \<Longrightarrow> \<exists>y. nodes_... | {"llama_tokens": 357, "file": "Kruskal_Graph_Definition_Aux", "length": 6} |
from sklearn import linear_model
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import accuracy_score
node1 = pd.read_csv("../Data/Node1.csv", index_col="AbsT")
node1.index = pd.to_datetime(node1.index)
humidity = node1.RelH
k = 700
K = 100
plt.plot(humidity.values[k-K:k+K... | {"hexsha": "73e62107a00a5c020e329509d668a5a099ff42fb", "size": 1302, "ext": "py", "lang": "Python", "max_stars_repo_path": "EventDetection/OccupancyChangeDetection.py", "max_stars_repo_name": "teerasitk/DataAnalyticsIOTBootCamp", "max_stars_repo_head_hexsha": "7b0c6d008fc83136878c56b2bff496e61d5656cb", "max_stars_repo_... |
import logging
from itertools import combinations, permutations
from typing import Any, Callable, Dict, List, Set, Tuple, Union
import networkx as nx
import numpy as np
import pandas as pd
from causal_networkx import ADMG, PAG
from causal_networkx.algorithms.pag import discriminating_path, uncovered_pd_path
from caus... | {"hexsha": "2136a853556222523db88d9a2d657c6beb8d64e6", "size": 24171, "ext": "py", "lang": "Python", "max_stars_repo_path": "causal_networkx/discovery/fcialg.py", "max_stars_repo_name": "adam2392/causal-networkx", "max_stars_repo_head_hexsha": "aba5355d2e900b30dd3d99916981674f3c0074e9", "max_stars_repo_licenses": ["BSD... |
Address(Villaverde Lane) is a residential street in East Davis.
Intersecting Streets
Prado Lane
Ponteverde Lane
Ponteverde Lane again
Prado Lane again
| {"hexsha": "ec50516d6292282ae63574afd117e45452a49d5e", "size": 164, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Villaverde_Lane.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma (in Group) ZassenhausTr2_4:"\<lbrakk>G \<guillemotright> H; G \<guillemotright> H1; Gp G H \<triangleright> H1; h \<in> H;
h1 \<in> H1\<rbrakk> \<Longrightarrow> h \<cdot> h1 \<cdot> (\<rho> h) \<in> H1"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>G \<guillemotright> H ;... | {"llama_tokens": 1154, "file": "Group-Ring-Module_Algebra3", "length": 6} |
#include "statswindow.hpp"
#include <boost/lexical_cast.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/player.hpp"
#include "../mwmechanics/npcstats.hpp"
#include "tooltips.hpp"
namespace MWGui
{
... | {"hexsha": "baa779c1c4b0d57843f5d9c984849e51d12d66f6", "size": 25446, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "apps/openmw/mwgui/statswindow.cpp", "max_stars_repo_name": "Bodillium/openmw", "max_stars_repo_head_hexsha": "5fdd264d0704e33b44b1ccf17ab4fb721f362e34", "max_stars_repo_licenses": ["Unlicense"], "m... |
#ifndef __NODE_MAPNIK_MEM_DATASOURCE_H__
#define __NODE_MAPNIK_MEM_DATASOURCE_H__
#include <v8.h>
#include <node.h>
#include <node_object_wrap.h>
using namespace v8;
// mapnik
#include <mapnik/box2d.hpp>
#include <mapnik/query.hpp>
#include <mapnik/params.hpp>
#include <mapnik/sql_utils.hpp>
#include <mapnik/datasou... | {"hexsha": "662fcd4bc7ee63a550178422787435d8cf592569", "size": 7290, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/mem_datasource.hpp", "max_stars_repo_name": "calvinmetcalf/node-mapnik", "max_stars_repo_head_hexsha": "3d26f2089dee3cfc901965f6646d50004a0e0e56", "max_stars_repo_licenses": ["BSD-3-Clause"], "m... |
#!/usr/bin/env python3
# trunc8 did this
import json
import numpy as np
import time
from helper import Helper
class Game:
def __init__(self):
# Declaring Member variables
self.grid = None
self.UPDATE_RATE = None
self.NUM_OF_GENERATIONS = None
# Helper class contains some handy utilities
s... | {"hexsha": "e74985a466248e7ced099195862f9a098e05986a", "size": 3311, "ext": "py", "lang": "Python", "max_stars_repo_path": "game_core.py", "max_stars_repo_name": "trunc8/conways-game-of-life", "max_stars_repo_head_hexsha": "318e80a31d64d6784fbbe92d7345dab243a00126", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#ifndef BOOST_GIL_IO_UNIT_TEST_SUBIMAGE_TEST_HPP
#define BOOST_GIL_IO_UNIT_TEST_SUBIMAGE_TEST_HPP
#include <boost/gil/gil_all.hpp>
using namespace std;
using namespace boost;
using namespace gil;
template< typename Image
, typename Format
>
void run_subimage_test( string filename
... | {"hexsha": "60bd1eb101a54756acecf25bdd7f98e50e82ede3", "size": 1179, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "libs/gil/io/test/subimage_test.hpp", "max_stars_repo_name": "smart-make/boost", "max_stars_repo_head_hexsha": "46509a094f8a844eefd5bb8a0030b739a04d79e1", "max_stars_repo_licenses": ["BSL-1.0"], "max... |
classdef TopOptTestsSuite < handle
methods
function obj = TopOptTestsSuite()
warning('off', 'MATLAB:structOnObject')
% testFastDisplacement, testMacro, testMicro
results = runtests("TopOptTests","ProcedureName","testFastDisplacement", 'Debug', true);
% r... | {"author": "SwanLab", "repo": "Swan", "sha": "f8355f3561bb1a1603f56b3676873147d22a511e", "save_path": "github-repos/MATLAB/SwanLab-Swan", "path": "github-repos/MATLAB/SwanLab-Swan/Swan-f8355f3561bb1a1603f56b3676873147d22a511e/tests/Source/TopOptTests/TopOptTestsSuite.m"} |
[STATEMENT]
lemma emeasure_dens_ctxt_measure_insert':
fixes t f \<rho>
defines "M \<equiv> dens_ctxt_measure (shift_var_set V, Suc`V', case_nat t \<Gamma>, insert_dens V V' f \<delta>) \<rho>"
assumes dens: "has_parametrized_subprob_density (state_measure (V\<union>V') \<Gamma>) F (stock_measure t) f"
assumes \... | {"llama_tokens": 25788, "file": "Density_Compiler_PDF_Density_Contexts", "length": 76} |
import h5py
import numpy as np
from . import log
def groups(h5_file_path):
h5_file = h5py.File(h5_file_path, mode='r')
for h5_key in h5_file.keys():
group_candidate = h5_file[h5_key]
if not isinstance(group_candidate, h5py.Group):
log.warn('Current value for key \'{}\' in .h5 file... | {"hexsha": "3a3889d27ee8c63bad41ec87a129cbb31d5488c2", "size": 655, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/davil/h5.py", "max_stars_repo_name": "Treiblesschorle/davil", "max_stars_repo_head_hexsha": "0f7faa96db3d9ef48dd3263a339f822b75c47e6b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
from models import CNN2
from core.Optimizers import sgd, bgd
from core.Functions import one_hot_f
import numpy as np
from tensorflow import keras
from core.Dataloader import batch_iterator
def test(model, test_inputs, test_labels):
num_of_sample = test_inputs.shape[0]
cnt_correct, cnt_tot = 0, 0
for i in ... | {"hexsha": "35bab12417c4373aebc38aafe989aa81515e824e", "size": 1139, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test38_neo_numpy_cnn_cuda.py", "max_stars_repo_name": "davidliyutong/Flint", "max_stars_repo_head_hexsha": "4e2552dac8d781c21e8998ad68bbf1b986b09258", "max_stars_repo_licenses": ["MIT"], "max... |
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import pearsonr
import pdb
def show_signal(signal,
screen_width=1920 / 15,
screen_height=1080 / 15,
resolution_magnifier=10,
title=""):
"""
Args:
signal: 2D signal
scr... | {"hexsha": "a8aec8ba042abceec67d5c18c42006818309583a", "size": 6263, "ext": "py", "lang": "Python", "max_stars_repo_path": "obf/utils/signal_visualization.py", "max_stars_repo_name": "BeibinLi/OBF", "max_stars_repo_head_hexsha": "deb30d742edef5dcb82e8ff3377948b53f956da9", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
function uiwaitvec(h)
while ~isempty(h)
uiwait(h(1));
h = h(ishandle(h));
end | {"author": "kristinbranson", "repo": "JAABA", "sha": "5d778a23e3e7cf272df9a89a72b1b66d94f535d7", "save_path": "github-repos/MATLAB/kristinbranson-JAABA", "path": "github-repos/MATLAB/kristinbranson-JAABA/JAABA-5d778a23e3e7cf272df9a89a72b1b66d94f535d7/misc/uiwaitvec.m"} |
import numpy as np
from random import randint
import logging
import torch
import torch.utils.data
logger = logging.getLogger(__name__)
def get_random_word(vocab_words):
i = randint(0, len(vocab_words)-1)
return vocab_words[i]
def batch_list_to_batch_tensors(batch):
batch_tensors = []
for x in zip... | {"hexsha": "7cf2c9d5c366dc2c16714f5a19fb5580adf6a3fd", "size": 5277, "ext": "py", "lang": "Python", "max_stars_repo_path": "speedy_mind/models/tnlrv3/s2s_loader.py", "max_stars_repo_name": "microsoft/SpeedyRec", "max_stars_repo_head_hexsha": "1186120f8c5ee8c904676bb2f19892d064c984e6", "max_stars_repo_licenses": ["MIT"]... |
using GPR
function experimentVarInt(config, id, eid, mechanism, varargs...)
testdfs = config["datasets"][2] # Each thread operates on its own dataset -> no races
testdf = testdfs.df[id][shuffle(1:nrow(testdfs.df[id]))[1:config["testsamples"]], :]
xtest_future_true = [CState(x) for x in testdf.sfuture]
... | {"hexsha": "b85c848c6ddaf96af9f5dd6452c3e77f5db6342b", "size": 1668, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/baseline.jl", "max_stars_repo_name": "amacati/GPR.jl", "max_stars_repo_head_hexsha": "3b0db8be6a1081066205e1da7f9a81a5d6c26e3a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
#-------------------------------------------
# import
#-------------------------------------------
import os
import cv2
import numpy as np
import matplotlib.pyplot as plt
import keras.backend as K
from keras.preprocessing import image
import json
from model_utils import get_model, get_model_inputsize
#-----------------... | {"hexsha": "1f55f53da69b60329a212fe923bc7abeeb8ad710", "size": 4467, "ext": "py", "lang": "Python", "max_stars_repo_path": "grad_cam.py", "max_stars_repo_name": "takurooo/Keras-GradCAM", "max_stars_repo_head_hexsha": "3d20e1acf61f2d6e4fb8697eab3ced09f3ed9e23", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Semigroup where
open import Cubical.Algebra.Semigroup.Base public
| {"hexsha": "67a79e4e755e8e3e36b9ee1a468a3112ed235214", "size": 145, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Cubical/Algebra/Semigroup.agda", "max_stars_repo_name": "dan-iel-lee/cubical", "max_stars_repo_head_hexsha": "fd8059ec3eed03f8280b4233753d00ad123ffce8", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""Unit tests for the Olsson Loader class.
Authors: John Lambert
"""
import unittest
from pathlib import Path
import dask
import numpy as np
from gtsam import Cal3Bundler, Rot3, Pose3
import gtsfm.utils.io as io_utils
from gtsfm.loader.olsson_loader import OlssonLoader
DATA_ROOT_PATH = Path(__file__).resolve().pare... | {"hexsha": "e16dc4cf6356cbe601b0236cbdfe068fbc1ebc1a", "size": 5685, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/loader/test_olsson_loader.py", "max_stars_repo_name": "yuancaimaiyi/gtsfm", "max_stars_repo_head_hexsha": "cc5781c35af23498d45cd96a1818e4786c5cca80", "max_stars_repo_licenses": ["Apache-2.0"... |
from openchem.models.Smiles2Label import Smiles2Label
from openchem.modules.embeddings.basic_embedding import Embedding
from openchem.modules.encoders.cnn_encoder import CNNEncoder
from openchem.modules.mlp.openchem_mlp import OpenChemMLP
from openchem.data.smiles_data_layer import SmilesDataset
from openchem.crit... | {"hexsha": "30e8f6d04d2eef93cd46097a07b53fb522b46a86", "size": 4024, "ext": "py", "lang": "Python", "max_stars_repo_path": "example_configs/melt_temp_cnn_config.py", "max_stars_repo_name": "jmhayesesq/Open-Chem", "max_stars_repo_head_hexsha": "e612d5cd471079c64e61ceda946c3dc7cf095bd8", "max_stars_repo_licenses": ["MIT"... |
from numba.experimental.jitclass.decorators import jitclass
from numba.experimental.jitclass import boxing # Has import-time side effect
| {"hexsha": "97c1903496b8ed1b7c131a4942173d4c3198f44a", "size": 138, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba/experimental/jitclass/__init__.py", "max_stars_repo_name": "auderson/numba", "max_stars_repo_head_hexsha": "3d67c9850ab56457f418cf40af6245fd9c337705", "max_stars_repo_licenses": ["BSD-2-Claus... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.