text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
% Modified based on Xiaoming Sun's template
\documentclass{article}
\usepackage{amsmath,amsfonts,amsthm,amssymb}
\usepackage{setspace}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{extramarks}
\usepackage{chngpage}
\usepackage{soul,color}
\usepackage{graphicx,float,wrapfig}
\usepackage{fontspec}
... | {"hexsha": "cc297bc370fad57230d21645331434c0b2c7fa2a", "size": 10159, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "_site/assets/mcs/hw7/hw7_2015010697.tex", "max_stars_repo_name": "SuXY15/SuXY15.github.io", "max_stars_repo_head_hexsha": "2bc3747fbc4567ac4999ae3ba80ff074b543d602", "max_stars_repo_licenses": ["MI... |
# -*- coding: utf-8 -*-
import sys
import io
import os
import time
import pickle
import pandas as pd
import multiprocessing
import logging
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import plotly.graph_objects as go
from flask import ... | {"hexsha": "78048131bcb553f1e501c7307cee1212ac2c100c", "size": 9704, "ext": "py", "lang": "Python", "max_stars_repo_path": "ddf_library/bases/monitor/monitor.py", "max_stars_repo_name": "eubr-bigsea/Compss-Python", "max_stars_repo_head_hexsha": "09ab7c474c8badc9932de3e1148f62ffba16b0b2", "max_stars_repo_licenses": ["Ap... |
"""
tests desispec.io.fibermap.assemble_fibermap
"""
import os
import unittest
import tempfile
import numpy as np
from desispec.emlinefit import get_emlines
#- some tests require data only available at NERSC
_everest = '/global/cfs/cdirs/desi/spectro/redux/everest'
at_nersc = ('NERSC_HOST' in os.environ) and (os.pat... | {"hexsha": "3b5e2ad4008407304c32c2ab3c07ebf614e2ae7a", "size": 2377, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/desispec/test/test_emlinefit.py", "max_stars_repo_name": "echaussidon/desispec", "max_stars_repo_head_hexsha": "8a8bd59653861509dd630ffc8e1cd6c67f6cdd51", "max_stars_repo_licenses": ["BSD-3-Cla... |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
@author lichuan89@126.com
@date 2016/09/12
@note 梯度下降训练线性模型
"""
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
def collect_train_data_1x1y():
"""
data: y = x * 2 + noise
"""
def f(x): return x * 2
np.random.s... | {"hexsha": "ef91115396bcd5c40c008024a7bac85cb3f3056f", "size": 2896, "ext": "py", "lang": "Python", "max_stars_repo_path": "linear_model.py", "max_stars_repo_name": "lichuan89/neural_network_note", "max_stars_repo_head_hexsha": "e8c51dfc2c0dae53311c24899c874bafe0ff8c88", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import os
import matplotlib.pyplot as plt
import numpy as np
import astropy.units as u
from astropy.table import Table, Column
from gammapy.spectrum.models import PowerLaw
from gammapy.stats import significance_on_off
from .utils import save_obj, load_obj, plot_hist
__all__ = ["CutsOptimisation", "CutsDiagnostic", "C... | {"hexsha": "ff73cc588503395a6c8ebe2541c58d09507021b6", "size": 33601, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyirf/perf/cut_optimisation.py", "max_stars_repo_name": "hugovk/pyirf", "max_stars_repo_head_hexsha": "12afef58a27862abfe2a6c049b68f6d05f6fe31d", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
program rKm_budget
implicit none
!|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
!
! this script calculates various quantities from the original POP output files
! and the LEC files created with LEC.f90
!
! calculated quantities:
! 1. vertical integrals of cPKm/cPKe
! 2. Eulerian ... | {"hexsha": "2dfd2a598bea2b985dd7e4271f38c0eb76497d87", "size": 32547, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/f90/rKm_budget.f90", "max_stars_repo_name": "AJueling/LEC", "max_stars_repo_head_hexsha": "f720aa8cec147d8f9acab00c1d1de3bd8fc40b6e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars... |
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import bs4 as bs
import requests
import yfinance as yf
import datetime
import io
import cv2
import skimage
import datetime
import os.path as path
from PIL import Image
from pandas_datareader import data as pdr
from skimage import measure
from skimag... | {"hexsha": "223e8b2420a0a5862d54aea937f88f744f838a2d", "size": 17393, "ext": "py", "lang": "Python", "max_stars_repo_path": "newversion/setup.py", "max_stars_repo_name": "imiled/DL_Tools_For_Finance", "max_stars_repo_head_hexsha": "7b1d3246a4271170af0a99a7ab6790b7377249fd", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
[STATEMENT]
lemma in_annotate_rlen: "(a,x) \<in> set (annotate_rlen l) \<Longrightarrow> x \<in> set l"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (a, x) \<in> set (annotate_rlen l) \<Longrightarrow> x \<in> set l
[PROOF STEP]
by(induction l) (simp_all, blast) | {"llama_tokens": 114, "file": "LOFT_LinuxRouter_OpenFlow_Translation", "length": 1} |
from __future__ import absolute_import, division, print_function
import os
import numpy as np
import pandas as pd
from gensim.models import KeyedVectors
from string import ascii_lowercase, punctuation
# Dataset
PROJECT_NAME = "Quora Question Pairs"
PROJECT_FOLDER_PATH = os.path.join(os.path.expanduser("~"), "Document... | {"hexsha": "d919c2a98d425c1aee7667398756fd0f11479bef", "size": 5038, "ext": "py", "lang": "Python", "max_stars_repo_path": "Quora Question Pairs/text_cleaning.py", "max_stars_repo_name": "nixingyang/Kaggle-Face-Verification", "max_stars_repo_head_hexsha": "b5f9908f4c23dc78b3e6b647c7add8f2b0d84663", "max_stars_repo_lice... |
C Copyright(C) 2014-2017 National Technology & Engineering Solutions of
C 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 Redistribution and use in source and binary forms, with or without
C modification, are pe... | {"hexsha": "273d0695e77cc4d50d2766185e197cf2c1fca1ff", "size": 6759, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/fastq/getm3.f", "max_stars_repo_name": "smukher/seacas", "max_stars_repo_head_hexsha": "c22b84ba3c91ade161b7695da11ee1de80ee8e3a", "max_stars_repo_licenses": ["Python-... |
[STATEMENT]
lemma restrict_assignment: "val_ifex b (ass(var := val)) \<longleftrightarrow> val_ifex (restrict b var val) ass"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. val_ifex b (ass(var := val)) = val_ifex (restrict b var val) ass
[PROOF STEP]
by (induction b) auto | {"llama_tokens": 107, "file": "ROBDD_BDT", "length": 1} |
\subsection{Polearms}
\begin{longtable}{|C{2cm} L{2cm} L{2cm} L{8cm}|}
\hline
\large{\textbf{Name}} &
\large{\textbf{Cost}} &
\large{\textbf{Handedness}} &
\large{\textbf{Damage}}
\\ \hline
\WeaponRow{Quarterstaff}{50 m}{Two}{
\textit{Crushing:} $\frac{2d8 \pm modifiers}{5}*Strength$
}{Nothing more than long sticks, \... | {"hexsha": "b70c7d77fcb8116aeb506b35ca518e3c224384c9", "size": 2288, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "chapters.d.tex/06-items.d.tex/02-weapons.d.tex/03-polearms.tex", "max_stars_repo_name": "Metalhead33-Foundation/Ways-of-Darkness-Tabletop", "max_stars_repo_head_hexsha": "1c832ec305794e60d998213cdea... |
type Legend
label::String
end
type DataGroup
data::DataFrame
markerScale::Vector{Float64}
markerLineWidth::Float64
errorLineWidth::Float64
lineColor::Union{String, RGBA{Float64}}
lineStyle::String
markerColor::Union{String, RGBA{Float64}}
markerType::String
legend::Legend
plotPoints::Bool
end
DataGroup(xva... | {"hexsha": "e947e07f44442c76fc315f071016079d2cede5c0", "size": 791, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/datagroup.jl", "max_stars_repo_name": "tkelman/Sparrow.jl", "max_stars_repo_head_hexsha": "f81d31de1e26856f4c8bb1924260fc4e36edd4e7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
function R = p2p_optimum(a, n_vals, eps)
% Compute the achievable sum rate (at the symmetrical rate point) based on the point-to-point optimal code
% for the joint source distribution: [a 1/3*(1-a); 1/3*(1-a) 1/3*(1-a)].
% Input:
% a: parameter to define the joint source distribution, should be in range [0.25, 1)
% n... | {"author": "yp-mit", "repo": "spectre", "sha": "57af76799e4eb43aa707cc13c4c5220d281e0b78", "save_path": "github-repos/MATLAB/yp-mit-spectre", "path": "github-repos/MATLAB/yp-mit-spectre/spectre-57af76799e4eb43aa707cc13c4c5220d281e0b78/lossless-sc/p2p_optimum.m"} |
run(`qmake --version`)
run(`qmlscene $(joinpath(dirname(@__FILE__), "imports.qml"))`)
| {"hexsha": "6d668aba55d0dca79b670c672416ee31028f348f", "size": 86, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "deps/build.jl", "max_stars_repo_name": "barche/TravisExperiments.jl", "max_stars_repo_head_hexsha": "4c1e1a906fca6bf484e356a0ca7c1a73127422e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import pickle
import numpy as np
from rdkit import Chem
from rdkit.Chem import Crippen
from rdkit.Chem import QED
from rdkit.Chem.Fingerprints import FingerprintMols
from rdkit import DataStructs
train_smiles_path = "data/zinc_250k_train_smiles.pkl"
generated_smiles_path = "data/zinc_250k_generated_smiles.pkl"
# Com... | {"hexsha": "612cfb0af0f6ad02da72f6a3c0225012707cb5d6", "size": 3166, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluate.py", "max_stars_repo_name": "abdouskamel/Molecular-Graph-Generation", "max_stars_repo_head_hexsha": "a589399fb967101d71df1ab3a75e9cd16333bf48", "max_stars_repo_licenses": ["MIT"], "max_st... |
[STATEMENT]
lemma fixp_spmf_parametric:
assumes f: "\<And>x. mono_spmf (\<lambda>f. F f x)"
and g: "\<And>x. mono_spmf (\<lambda>f. G f x)"
and param: "((A ===> rel_spmf R) ===> A ===> rel_spmf R) F G"
shows "(A ===> rel_spmf R) (spmf.fixp_fun F) (spmf.fixp_fun G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
... | {"llama_tokens": 2233, "file": null, "length": 16} |
#include <boost/process/async_system.hpp>
| {"hexsha": "dd4cabae13c3ec3a53396f30a79dce02bd3f3225", "size": 42, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_process_async_system.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"... |
# encoding: UTF-8
import sys
import json
from pymongo import MongoClient
from vnpy.trader.app.ctaStrategy.ctaBase import DATABASE_NAMES
import pandas as pd
import numpy as np
import datetime as dt
import talib as ta
from interval import Interval
import time
#方向
M_TO_UP = True
M_TO_DOWN = False
#节点或中枢是否正式形成
M... | {"hexsha": "4fb18e62aeed55e9dd71ae0378a16c9175f58f89", "size": 64258, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/DataAnalysis/CentralBase.py", "max_stars_repo_name": "myjoying/vnpy", "max_stars_repo_head_hexsha": "80f380fa4402a33f66fd2ebcfdb2f5ddc32e78f9", "max_stars_repo_licenses": ["MIT"], "max_s... |
function x = norm_ball( x, varargin ) %#ok
%NORM_BALL Norm ball.
% NORM_BALL( sz, ... ) returns a variable of size sz, say 'x', that is
% constrained to satisfy NORM( x, ... ) <= 1. Any syntactically valid
% and _convex_ use of the NORM() function has a direct analog in
% NORM_BALL. The convex requirement sp... | {"author": "yu-jiang", "repo": "radpbook", "sha": "88b9fa7d0a541099cdd1ac29383c89e087d1d895", "save_path": "github-repos/MATLAB/yu-jiang-radpbook", "path": "github-repos/MATLAB/yu-jiang-radpbook/radpbook-88b9fa7d0a541099cdd1ac29383c89e087d1d895/tools/cvx-w64/cvx/sets/norm_ball.m"} |
\chapter{Event Detection}
In this chapter, we will introduce the mechanism of event detection in this project. First for the audio clips we have downloaded, we need to extract relevant features from them. After getting features, a Gaussian Mixture Model is built on those features. Then for the new testing audio, we wou... | {"hexsha": "9c04760c98ee91ae024cdfa5052cf6e2805bf31c", "size": 4331, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/chapter03.tex", "max_stars_repo_name": "findslowly/thesis", "max_stars_repo_head_hexsha": "177115f287b00d81434a13b00dd449ed9944607d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import numpy as np
def assert_model(true_model, created_model, rtol=1.e-4, atol=1.e-6):
assert len(true_model['model']) == len(created_model['model'])
for i in range(len(true_model['model'])):
true_tree = true_model['model'][i]
created_tree = created_model['model'][i]
assert np.allclos... | {"hexsha": "25e1fa8f508e4f64b1a8ce48ae2fa59721962738", "size": 541, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/py/utils.py", "max_stars_repo_name": "sh1ng/arboretum", "max_stars_repo_head_hexsha": "f3dbc4c2fc2b6ff86d9ede21082e4116dcd26e12", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count":... |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
get_ipython().system('pip install emoji')
# ### Working with emoji package
# In[2]:
import emoji as emoji
# In[3]:
# emoji.EMOJI_UNICODE --> to see all thr emojis
# In[4]:
emoji_dictionary = {"0": "\u2764\uFE0F",
"1": ":baseball:",
... | {"hexsha": "669e20303fe18e266469ade704741c52b822f32d", "size": 3522, "ext": "py", "lang": "Python", "max_stars_repo_path": "source.py", "max_stars_repo_name": "amanraj2999/Emoji-Prediction-using-NLP-", "max_stars_repo_head_hexsha": "de87389b18de8ffc318ac8fa289659f40a7af6a6", "max_stars_repo_licenses": ["MIT"], "max_sta... |
using DyadicKDE
using Test
using Random
using Suppressor
function trapezium_integrate(f::Vector{Float64}, x::Vector{Float64})
@assert length(f) == length(x)
n_areas = length(x) - 1
areas = fill(NaN, n_areas)
for i in 1:n_areas
areas[i] = 0.5 * (f[i+1] + f[i]) * (x[i+1] - x[i])
end
... | {"hexsha": "049513967cd7c7c266d9fb43ebbbbd9adeb7b020", "size": 3485, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "WGUNDERWOOD/DyadicKDE.jl", "max_stars_repo_head_hexsha": "0250184973f6514576f0a3500ab2a29b0ab128fd", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
module FVW_VortexTools
! Contains Typical Tools for vortex methods
! Should be *independent* of the Framework and any derived type
! Only low level functions !
use NWTC_LIBRARY
implicit none
! Tree parameters
integer, parameter :: IK1 = selected_int_kind(1) ! to store particle branch number ... | {"hexsha": "dc97783624d8b1484b666c5327fa0831c49c35f0", "size": 42182, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "modules/aerodyn/src/FVW_VortexTools.f90", "max_stars_repo_name": "rcorniglion/openfast", "max_stars_repo_head_hexsha": "ebff1b46c802c0839b43d5f83aa296c19a8a9c14", "max_stars_repo_licenses": ["A... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import sys
import os
import glob
import shutil
import argparse
import numpy as np
import pandas as pd
from obj.arg_formatter import arg_metav_formatter
def iter_temporal_find(direct):
"""
Function to recursively find all log files that are temporally r... | {"hexsha": "312c75f6bc3db9a20600b5c94852213979b118e9", "size": 9228, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/combine_prune_logs.py", "max_stars_repo_name": "atreyasha/lfw-faces-rgan", "max_stars_repo_head_hexsha": "428f68586d772e072c2a10259ec69d7515f4d86c", "max_stars_repo_licenses": ["MIT"], "max_st... |
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 29 13:40:26 2019
@author: qde
"""
import unittest
import numpy as np
from abc import ABC, abstractmethod
from filterpy.kalman import IMMEstimator
from fdia_simulation.models import Radar
from fdia_simulation.filters import RadarF... | {"hexsha": "fda48691269df7f1af371413a294d85252e4d940", "size": 4150, "ext": "py", "lang": "Python", "max_stars_repo_path": "fdia_simulation/tests/benchmarks/test_noise_finder_1radar.py", "max_stars_repo_name": "QDucasse/FDIA_simulation", "max_stars_repo_head_hexsha": "bdd0cb072f07b9a96fd82df581c9c7493ae66cbc", "max_sta... |
# *****************************************************************************
# Copyright 2017 Karl Einar Nelson
#
# 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://... | {"hexsha": "ab5179290f8fc00f4dc05c8334c2cc4b7febec2d", "size": 3668, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/jpypetest/test_conversionDouble.py", "max_stars_repo_name": "fuz-woo/jpype", "max_stars_repo_head_hexsha": "3ffb1e7a75402545c1d669f4bc5836b08b76b6ae", "max_stars_repo_licenses": ["Apache-2.0"... |
#include <iostream>
#include <fstream>
#include <algorithm>
#include <complex>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/algorithm/minmax.hpp>
#include "../include/TriMesh.h"
#include "../include/utils.h"
#include "../include/lagrange.h"
#include "../include... | {"hexsha": "92b24f5a44205abd637000b0e87eee3b53b1769f", "size": 4659, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/main.cpp", "max_stars_repo_name": "xtwang1996/DG_Euler_2D", "max_stars_repo_head_hexsha": "1218ef7af9a85db48c84386e0fc396d09286be33", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
"""tests for ctapipe.utils.quantities"""
import pytest
import numpy as np
import astropy.units as u
from ctapipe.utils.quantities import all_to_value
def test_all_to_value():
"""test all_to_value"""
x_m = np.arange(5) * u.m
y_mm = np.arange(5) * 1000 * u.mm
z_km = np.arange(5) * 1e-3 * u.km
nono_... | {"hexsha": "6713580e7dde4f92664e2b970c715e426ba15d85", "size": 890, "ext": "py", "lang": "Python", "max_stars_repo_path": "ctapipe/utils/tests/test_quantities.py", "max_stars_repo_name": "chaimain/ctapipe", "max_stars_repo_head_hexsha": "ff80cff2daaf56e1d05ea6501c68fd83a9cf79d5", "max_stars_repo_licenses": ["BSD-3-Clau... |
import numpy as np
from scipy import signal
from Pygor_new.measurement_functions import measurement_funcs as meas
from Last_score import final_score_cls
import time
do_scale = False
def scaler(data):
return (data*3.2) - 1.7E-10
def find_peaks(trace,prominence):
#norm settings
offset = -1.866e-10
... | {"hexsha": "f32adffc818976654acd04447f58d901d2d37f41", "size": 3980, "ext": "py", "lang": "Python", "max_stars_repo_path": "Investigation/scoring/score_driver.py", "max_stars_repo_name": "josephhic/AutoDot", "max_stars_repo_head_hexsha": "9acd0ddab9191b8a90afc6f1f6373cf711b40b89", "max_stars_repo_licenses": ["MIT"], "m... |
import ophyd.sim as sim
import numpy as np
import functools
def build_beamline():
def work_function(mtr):
v = mtr.get().readback
return np.exp(-(v * v) / 15)
x = sim.SynAxis(name="x")
det = sim.SynSignal(name="det", func=functools.partial(work_function, x))
det.kind = "hinted"
ret... | {"hexsha": "e8ea76c96aab4add8e363c50595f58292b0242ee", "size": 360, "ext": "py", "lang": "Python", "max_stars_repo_path": "simulated_pdf/beamline.py", "max_stars_repo_name": "NSLS-II-PDF/simuplated-pdf", "max_stars_repo_head_hexsha": "177d6522e35d049c37dd497cf6d26692d88c504a", "max_stars_repo_licenses": ["BSD-3-Clause"... |
import pandas as pd
import numpy as np
import gpxpy
import math
import urllib.error
from sharingMobilityAPI import sharingMobilityAroundLocation
from stadtRadApi import amountStadtRadAvailable
class HVVCoordinateMapper:
def __init__(self):
self.df = None
self.stop_to_index = {}
self.lat_lo... | {"hexsha": "8311138b3bcc282ab269ab6fff480fb9a15146c9", "size": 5754, "ext": "py", "lang": "Python", "max_stars_repo_path": "route_coordinate_mapping.py", "max_stars_repo_name": "BlueHC/TTHack-2018--Traffic-Guide-1", "max_stars_repo_head_hexsha": "6a720e268d18c8e090c12b874336d17e89a183bb", "max_stars_repo_licenses": ["M... |
from sklearn import datasets
from scipy import sparse
import numpy as np
def get_data():
digits = datasets.load_digits()
X_digits = digits.data[10:,:]
y_digits = digits.target[10:]
return { "X" : X_digits, "y" : y_digits }
| {"hexsha": "3739dbd468fdc9808d5b354ad6eb57e69e433819", "size": 247, "ext": "py", "lang": "Python", "max_stars_repo_path": "automl/get_data.py", "max_stars_repo_name": "yamamoto-kazuki-fixer/decode2019-Azure-MLOps", "max_stars_repo_head_hexsha": "bae4db710b889b529332c27f68bbbfda13ae1689", "max_stars_repo_licenses": ["MI... |
import math
import numpy as np
from numba import jit
from ..util.derivatives import numerical_gradients as ng
@jit
def sigmoid_prob(x, A, B):
return 1./(1+math.exp(A*x+B))
@jit
def label(f, threshold=0.):
if f == threshold:
return 0
else:
return 1 if f > threshold else -1
@jit
... | {"hexsha": "5a4735549a9b3074fe1163b44316c8633aaea63a", "size": 1534, "ext": "py", "lang": "Python", "max_stars_repo_path": "mogu/fit/sigmoid_fit.py", "max_stars_repo_name": "vishalbelsare/MoguNumerics", "max_stars_repo_head_hexsha": "4b6b55b562c3fe318552dd48f6b630d618bbbfc2", "max_stars_repo_licenses": ["MIT"], "max_st... |
from abc import ABC as _ABC, abstractmethod as _abstractmethod
from collections import deque as _deque
from inspect import getfullargspec as _getfullargspec
from itertools import cycle as _cycle
import numpy as _np
class Synchronization(_ABC):
_signal_seq = None
@_abstractmethod
def signal(self):
... | {"hexsha": "74c1215eff813ce723b2a823e4fc909c01e2286f", "size": 2008, "ext": "py", "lang": "Python", "max_stars_repo_path": "hundun/systems/_sync.py", "max_stars_repo_name": "llbxg/hundun", "max_stars_repo_head_hexsha": "a063ba4cf42665a3b7861aaccd1e9e31719eef8d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4,... |
% --- [ Recovery of 2-way Conditionals ] ---------------------------------------
\subsection{Recovery of 2-way Conditionals}
\label{sec:recovery_of_2way_conditionals}
The control flow recovery results of the Hammock method, the Interval method, and for comparison the theoretical optimum when recovering \textit{2-way ... | {"hexsha": "12af39ddfa6c577eb3f3dfde19cd5a89a7c20c4d", "size": 1988, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "report/control_flow_analysis/sections/5_results/3_recovery_of_2way_conditionals.tex", "max_stars_repo_name": "decomp/doc", "max_stars_repo_head_hexsha": "fb82b6a5074aa8721afb24a5537bf1964ed20467", "... |
using ChebyExp, MatrixDepot
# random 10x10
n = 1000
R = Matrix{Float64}(n,2)
A = Matrix{Float64}(10,10)
for i in 1:n
rand!(A)
R[i,1] = norm(expm(A)*expm(-A)-I,2)/norm(expm(A),2)
R[i,2] = norm(chebyexp(A)*chebyexp(-A)-I,2)/norm(chebyexp(A),2)
end
a,b = mean(R,1), std(R,1)
@printf("""
Random 10x10 matrices:
... | {"hexsha": "e54c27b7159fb01144e608f3f6b566bddaedc092", "size": 1339, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test.jl", "max_stars_repo_name": "jebej/ChebyExp", "max_stars_repo_head_hexsha": "2a79b116dd056eb6fbe59479c2d53939fa8ff61c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_star... |
------------------------------------------------------------------------
-- Semi-heterogeneous vector equality
------------------------------------------------------------------------
module Data.Vec.Equality where
open import Data.Vec
open import Data.Nat using (suc)
open import Data.Function
open import Relation.Bi... | {"hexsha": "174907047a161fd236757c0c3214199e4bc016e0", "size": 3023, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "vendor/stdlib/src/Data/Vec/Equality.agda", "max_stars_repo_name": "isabella232/Lemmachine", "max_stars_repo_head_hexsha": "8ef786b40e4a9ab274c6103dc697dcb658cf3db3", "max_stars_repo_licenses": ["M... |
[STATEMENT]
lemma igba_type[autoref_itype]:
"igba_L ::\<^sub>i i_igba Ie Iv Il \<rightarrow>\<^sub>i (Iv \<rightarrow>\<^sub>i Il \<rightarrow>\<^sub>i i_bool)"
"igba_rec_ext ::\<^sub>i (Iv \<rightarrow>\<^sub>i Il \<rightarrow>\<^sub>i i_bool) \<rightarrow>\<^sub>i Ie \<rightarrow>\<^sub>i \<langle>Ie,Iv,Il\<rangl... | {"llama_tokens": 291, "file": "CAVA_Automata_Automata_Impl", "length": 1} |
# -*- coding: utf-8 -*-
# Spearmint
#
# Academic and Non-Commercial Research Use Software License and Terms
# of Use
#
# Spearmint is a software package to perform Bayesian optimization
# according to specific algorithms (the “Software”). The Software is
# designed to automatically run experiments (thus the code name
... | {"hexsha": "be249659b2d9e19a97117f8108e183f8bdef33a9", "size": 16915, "ext": "py", "lang": "Python", "max_stars_repo_path": "spearmint/launcher.py", "max_stars_repo_name": "ascripter/Spearmint", "max_stars_repo_head_hexsha": "81b8cf5fa1462c09569bf323630cbee356c5897b", "max_stars_repo_licenses": ["RSA-MD"], "max_stars_c... |
@testset "Active Set Methods" begin
# Test active
N = 10
p = 3
model = UnicycleGame(p=p)
probsize = ProblemSize(N,model)
game_con = GameConstraintValues(probsize)
T = Float64
radius = 1.0
add_collision_avoidance!(game_con, radius)
s0 = stampify(:v, :col, 1, 2, 12)
@test act... | {"hexsha": "41502fee3229cc0d790cba89455225d0c50eaef1", "size": 3576, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/active_set/active_set_methods.jl", "max_stars_repo_name": "rejuvyesh/Algames.jl", "max_stars_repo_head_hexsha": "b860ba43eb104ef950fb00c9b68d43192832929a", "max_stars_repo_licenses": ["MIT"], ... |
# Copyright (c) 2020 Max Planck Gesellschaft
'''
Class which implements an agent, based on an "optimal" LQR policy
This LQR agent stabilizes the pendulum on top!
'''
import numpy as np
class LQR_state_trigger_agent:
# This is the implementation of a standart LQR agent -> always communicates
def __init__(self... | {"hexsha": "7cd806b20b7d37776810dc65a7c32f95c9d5affc", "size": 1135, "ext": "py", "lang": "Python", "max_stars_repo_path": "nfunk/LQR/LQR_state_trigger_agent.py", "max_stars_repo_name": "DDTR/learning_task2", "max_stars_repo_head_hexsha": "3a235edb6515d1c83dee996d90df7da11661fb61", "max_stars_repo_licenses": ["CNRI-Pyt... |
from __future__ import print_function
import torch.utils.data as data
from torch.utils.data import DataLoader
from PIL import Image
import os
import os.path
import errno
import torch
import codecs
import math
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.nn.functional as F
import tor... | {"hexsha": "76aba9bab3752e90075d40ec3e89eac2fb88fa00", "size": 12492, "ext": "py", "lang": "Python", "max_stars_repo_path": "Add_Code.py", "max_stars_repo_name": "iceshade000/MMCGAN", "max_stars_repo_head_hexsha": "addd41a8c19d9e898804bd34cafcb644cd7a87cf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "max... |
import matplotlib.pyplot as plt
import sys
import numpy as np
import crazyflie_param as P
# from signal_generator import signal_generator
# from crazyflie_animation import crazyflie_animation
from data_plotter import DataPlotter
from crazyflie_dynamics import CrazyflieDynamics
# from crazyflie_controller import RateCo... | {"hexsha": "95cf523c304e461e7f6ddc49ef4d6678c0131e3f", "size": 1615, "ext": "py", "lang": "Python", "max_stars_repo_path": "crazyflie_demo/model/crazyflie_sim.py", "max_stars_repo_name": "CooperDrones/VIP_Crazyswarm", "max_stars_repo_head_hexsha": "331c8018efa8972d6f115798ea1dfda0dcb095b5", "max_stars_repo_licenses": [... |
# -*- coding: utf-8 -*-
"""Helper classes to process outputs of models."""
from __future__ import division
__authors__ = 'Matt Graham'
__license__ = 'MIT'
import math
import numpy as np
class ConcentrationValueCalculator(object):
"""Calculates odour concentration values in simulation region."""
def __init... | {"hexsha": "13909cc4ed679986faab623ba64b84f8b0bd7fb7", "size": 15171, "ext": "py", "lang": "Python", "max_stars_repo_path": "pompy/processors.py", "max_stars_repo_name": "alexliberzonlab/pompy", "max_stars_repo_head_hexsha": "8bba8138c43800e22ddc23107f10b06e5df69860", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | {"hexsha": "6276b45454c395d2e118cb1c6af3dbd5f5b8d320", "size": 5134, "ext": "py", "lang": "Python", "max_stars_repo_path": "keras/integration_test/custom_object_saving_test.py", "max_stars_repo_name": "tsheaff/keras", "max_stars_repo_head_hexsha": "ee227dda766d769b7499a5549e8ed77b5e88105b", "max_stars_repo_licenses": [... |
import matplotlib as mpl
mpl.use('Agg')
from matplotlib import pyplot as plt
import argparse
import mxnet as mx
from mxnet import gluon
from mxnet.gluon import nn
from mxnet import autograd
from data import cifar10_iterator
import numpy as np
import logging
import cv2
from datetime import datetime
import os
import tim... | {"hexsha": "17d02e7fbede96c35c5560f857ce0f04509b3825", "size": 8283, "ext": "py", "lang": "Python", "max_stars_repo_path": "example/gluon/dcgan.py", "max_stars_repo_name": "viper7882/mxnet_win32", "max_stars_repo_head_hexsha": "8b05c0cf83026147efd70a21abb3ac25ca6099f1", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
# Copyright (C) 2020 GreenWaves Technologies, SAS
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# This progr... | {"hexsha": "00eb69f0c7ba5fee339adf3333636ad475b31d35", "size": 3656, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/nntool/expressions/symbolic/float_quantization/float_quantization.py", "max_stars_repo_name": "00-01/gap_sdk", "max_stars_repo_head_hexsha": "25444d752b26ccf0b848301c381692d77172852c", "max_... |
isdefined(Base, :__precompile__) && __precompile__(false)
module RiskAdjustedLinearizations
import Base: show, getindex
import DiffEqBase: get_tmp
using ArrayInterface, FastGaussQuadrature, FiniteDiff, ForwardDiff, LinearAlgebra, Printf
using SparseArrays, SparseDiffTools, SparsityDetection, UnPack
using BandedMatric... | {"hexsha": "95bf787c3241cc3b83348baca76ac2448efd9a36", "size": 1538, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/RiskAdjustedLinearizations.jl", "max_stars_repo_name": "chenwilliam77/RiskAdjustedLinearizations", "max_stars_repo_head_hexsha": "24d95b555882bc5336fe9fb456e9364c6f8f0f3f", "max_stars_repo_lice... |
[STATEMENT]
lemma finite_imp_card_of_natLeq_on:
assumes "finite A"
shows "|A| =o natLeq_on (card A)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. |A| =o natLeq_on (card A)
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. |A| =o natLeq_on (card A)
[PROOF STEP]
obtain h where "bij_betw h A {0 ..... | {"llama_tokens": 723, "file": null, "length": 8} |
import os
import warnings
from typing import List
import numpy as np
import pandas as pd
from pandas import read_sql_query
from sqlalchemy import create_engine
from zipline.data.bundles import ingest, register
from zipline.utils.cli import maybe_show_progress
from app.models import Database
warnings.filterwarnings("... | {"hexsha": "ce91ed68c91b3c775e9b4c7935ece9cefcc6c193", "size": 3626, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/data_bundles/foreverbull.py", "max_stars_repo_name": "quantfamily/zipline-foreverbull", "max_stars_repo_head_hexsha": "b759624116dc3a1b2354289e1fa3ce9d1a3d27a1", "max_stars_repo_licenses": ["A... |
#from Tkinter import *
import random
from copy import deepcopy
#import tkFileDialog
import itertools
from multiprocessing import Pool
import string
import tkinter.ttk
import shelve
import time
import sys
import pickle as pickle
from collections import defaultdict
import numpy as np
import re
from sklearn import metrics... | {"hexsha": "12d668ea4ff9d63c0d98d8cdd6e6a0c27ff5d640", "size": 7289, "ext": "py", "lang": "Python", "max_stars_repo_path": "test.py", "max_stars_repo_name": "Zoewang2557/anchorExplorer", "max_stars_repo_head_hexsha": "e53d417691c79586ffd44140e8b5d24b237b140d", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_cou... |
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
from ros_rover.msg import Rover
from SimpleUDPServer import SimpleUDPServer
from numpy import interp
server=SimpleUDPServer("",5005)
def talker():
#pub = rospy.Publisher('chatter', String, queue_size=0)
pub = rospy.Publisher('chatter', Rover,... | {"hexsha": "7f8e0fc9e0e520258ad6611e83b81cfb85365921", "size": 1356, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/scripts/talker.py", "max_stars_repo_name": "Veilkrand/ros_rover", "max_stars_repo_head_hexsha": "d0c612dea36c2ec11ebdd2ed03ceeb8e50521de7", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
# -*- coding: utf-8 -*-
"""Implements the SimpleHCN model."""
import math
from collections import defaultdict
from typing import Dict, Optional, Sequence, Union
import numpy as np
import torch
from jsonargparse import Namespace
from jsonargparse.typing import (
ClosedUnitInterval,
NonNegativeInt,
OpenUni... | {"hexsha": "26d3cc3876c31f59fe73340d129e998c6924bd2d", "size": 17481, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/simple_hgn.py", "max_stars_repo_name": "zhangch9/kg_rec", "max_stars_repo_head_hexsha": "4775a2d3479c6099c6521c2e64e78835063f516a", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_katex
import numpy as np
import plotly.express as px
from scipy import stats
from app import app
layout = html.Div([
dash_katex.DashKatex(
expression=r'f_X(x) = {n \choose x} p^x... | {"hexsha": "19bd17e1161a1ceaeafce10f31f8876dafe1ccf4", "size": 1256, "ext": "py", "lang": "Python", "max_stars_repo_path": "distributions/binomial.py", "max_stars_repo_name": "leotappe/distributions", "max_stars_repo_head_hexsha": "8377288864a44969cbb140d7b4cd91e2639ac3f1", "max_stars_repo_licenses": ["MIT"], "max_star... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.transforms as transforms
import torchvision.datasets as dsets
from models.LeNet5 import LeNet5
from optimizers.dist_SGLD import dsgld
import matplotlib.pyplot as plt
from utils.getlaplacian import getlaplacian
import numpy as np
impor... | {"hexsha": "22e986ed0892f753c31a0fb3edba6c720c85308c", "size": 9572, "ext": "py", "lang": "Python", "max_stars_repo_path": "mnist_dist_sgld_svhn_plot_pred_scores.py", "max_stars_repo_name": "AParayil/AParayil-Distribued-Learning-via-Bayesian-Inferencing", "max_stars_repo_head_hexsha": "68b52863a0f38ddd6ee1d77b3fffb0faf... |
[STATEMENT]
lemma has_integral_neg_iff: "((\<lambda>x. - f x) has_integral k) S \<longleftrightarrow> (f has_integral - k) S"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ((\<lambda>x. - f x) has_integral k) S = (f has_integral - k) S
[PROOF STEP]
using has_integral_neg[of f "- k"] has_integral_neg[of "\<lambda>x.... | {"llama_tokens": 292, "file": null, "length": 2} |
import numpy as np
import copy
import pywt
def sign(abs_var, sign_var):
return abs(abs_var) * (1 - np.where(sign_var < 0, 2*sign_var, sign_var))
def hfilter(diff_image, var_image, threshold=1, ndamp=10):
"""
This code was inspired from: https://github.com/spacetelescope/sprint_notebooks/blob/master/l... | {"hexsha": "9599cd1f23584d8db62dd09958d0d7ec913bf901", "size": 1567, "ext": "py", "lang": "Python", "max_stars_repo_path": "pySPM/utils/haar.py", "max_stars_repo_name": "BBarbara-fr/pySPM", "max_stars_repo_head_hexsha": "6dfd59b0e873173c455b1085e091495cf775f852", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co... |
# Constrained Shock Alignment for Multiblock Structured Grids
## Preamble
* Define "vec" command for LaTeX $\newcommand{vec}[1]{\boldsymbol{#1}}$
```python
# Configure python
%matplotlib notebook
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from scipy.linalg import solve_banded
# Defa... | {"hexsha": "2d4a4f3ff3c6fa22e92502b6bafa1a9622e6ec76", "size": 589960, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Theory.ipynb", "max_stars_repo_name": "flying-tiger/shock_tailor", "max_stars_repo_head_hexsha": "2253d396f92436426a0a613f14afe44ef5dacfa6", "max_stars_repo_licenses": ["MIT"], "max... |
//
// main.cpp
// MangaFrameExtraction
//
// Created by 山田 祐雅 on 2015/10/19.
// Copyright (c) 2015年 山田 祐雅 . All rights reserved.
//
#include <iostream>
#include <sstream>
#include <dirent.h>
#include <boost/regex.hpp>
#include <boost/program_options.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/core/core... | {"hexsha": "edafb2e5ccc78b0baaac356a76c4555e79d9be69", "size": 4985, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "MangaFrameExtraction/main.cpp", "max_stars_repo_name": "rachmadaniHaryono/manga_frame_extraction", "max_stars_repo_head_hexsha": "5b51094ac36914ba615f4d6eb7ad92a0d78cd5dd", "max_stars_repo_licenses"... |
# Copyright 2021 portfolio-robustfpm-framework Authors
# Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
# http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
# http://opensource.org/licenses/MIT>, at your option. This file may not be
# copied, modified, or distributed except ... | {"hexsha": "5b9517a1faeb34b12dc392f1709c7ee649bf3bcc", "size": 13819, "ext": "py", "lang": "Python", "max_stars_repo_path": "robustfpm/pricing/set_handler.py", "max_stars_repo_name": "andreevnick/robust-financial-portfolio-management-framework", "max_stars_repo_head_hexsha": "9450a00c8d0e78a621afc08f29b17e20fbcb3592", ... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
import math
import os
import copy
def clones(module, N):
return nn.ModuleList([copy.deepcopy(module) for _ in range(N)])
class Encoder(nn.Module):
def __init__(self, layer, N):
sup... | {"hexsha": "6b03d4869ab447f9465e78791b9321462c4f0e7e", "size": 4191, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/block/vanilla_transformer_encoder.py", "max_stars_repo_name": "paTRICK-swk/P-STMO", "max_stars_repo_head_hexsha": "def1bff3fcc4f1e3b1dd69c8d3c2d77f412e3b75", "max_stars_repo_licenses": ["MIT... |
module CommunalHelperConnectedSwapBlock
using ..Ahorn, Maple
using Ahorn.CommunalHelper
function swapFinalizer(entity)
x, y = Ahorn.position(entity)
width = Int(get(entity.data, "width", 8))
entity.data["nodes"] = [(x + width, y)]
end
@mapdef Entity "CommunalHelper/ConnectedSwapBlock" ConnectedSwapBlock... | {"hexsha": "0c13c4e02858e934e9541a5aa9765994901a615e", "size": 8355, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "Ahorn/entities/connectedBlocks/ConnectedSwapBlock.jl", "max_stars_repo_name": "microlith57/CommunalHelper", "max_stars_repo_head_hexsha": "3b928d0114f432b1df53de93857578355e7e53aa", "max_stars_repo... |
[STATEMENT]
lemma not_coll_ordered_lexI:
assumes "l \<noteq> x0"
and "lex x1 r"
and "lex x1 l"
and "lex r x0"
and "lex l x0"
and "ccw' x0 l x1"
and "ccw' x0 x1 r"
shows "det3 x0 l r \<noteq> 0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. det3 x0 l r \<noteq> 0
[PROOF STEP]
proof
[PROOF... | {"llama_tokens": 5454, "file": "Affine_Arithmetic_Counterclockwise_2D_Arbitrary", "length": 60} |
#!/usr/bin/python
from simulator.environment import Environment
from policy.dqn import DQN
from simulator.simulator import multiple_run
import numpy as np
import timeit
import random
np.set_printoptions(threshold=np.inf, linewidth=200)
# Run several simulations and assesss the policy's performance
class Trainer:
... | {"hexsha": "fb2b6f1604a7bb893a2cb85ae2b2c3790e988473", "size": 2412, "ext": "py", "lang": "Python", "max_stars_repo_path": "airl/main_test.py", "max_stars_repo_name": "malkayo/AiRL", "max_stars_repo_head_hexsha": "7db8c6c7fa8c93783a18d7180c3e24fb6792c10a", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":... |
# -*- coding: utf-8 -*-
import warnings
import numpy as np
from nose.tools import assert_raises
from numpy.testing import assert_array_equal
from genz.static.expyfun import parallel_func, _check_n_jobs
from genz.static.expyfun import requires_lib
warnings.simplefilter('always')
def fun(x):
return x
@require... | {"hexsha": "8597dc2e6a3c3491741ffa58fb6d32632ad0c257", "size": 676, "ext": "py", "lang": "Python", "max_stars_repo_path": "genz/static/expyfun/tests/test_parallel.py", "max_stars_repo_name": "larsoner/genz-1", "max_stars_repo_head_hexsha": "dc7a73b4597f976c0274d696c2610c79b7a1f7c1", "max_stars_repo_licenses": ["MIT"], ... |
# Copyright 2018/2019 The RLgraph authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | {"hexsha": "805c6cd09767116b6a3bfe97c825d9d0d78bee58", "size": 4543, "ext": "py", "lang": "Python", "max_stars_repo_path": "rlgraph/tests/test_util.py", "max_stars_repo_name": "samialabed/rlgraph", "max_stars_repo_head_hexsha": "f5fa632a385e67295a2939f54cbaa4c47a007728", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
// std
#include <iostream>
#include <exception>
// Boost
#include <boost/program_options.hpp>
#include <boost/filesystem.hpp>
// OpenCV
#include <opencv2/core.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui.hpp>
// face_seg
#include <face_seg/face_seg.h>
#include <face_seg/utilities.h>
using std::cou... | {"hexsha": "2b40bbb0572aa65db8e6eb12d380d04b16dff14a", "size": 3434, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "face_seg_image/face_seg_image.cpp", "max_stars_repo_name": "clks-wzz/face_segmentation", "max_stars_repo_head_hexsha": "b9624545acd39d04ca349d9e99cf2a5d6b80f8c2", "max_stars_repo_licenses": ["Apache... |
#redirect ASUCD StudentPolice Relations Committee
| {"hexsha": "b4d0e1d3d6256ddc986ac69b43a80534aba96c5e", "size": 50, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Student-Police_Relations_Committee.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT... |
import gc
import argparse
import numpy as np
import time
from train_val_generate_split_movie import data_generate, augment_data, preprocess_input, preprocess_output
import os.path
from tensorflow.keras import backend as K
import gc
import math
import psutil
import sys
sys.path.append('..')
from UserParams import UserPa... | {"hexsha": "e4416aae15eaa57e8fb611d0a8a28a0cacfbc66f", "size": 4549, "ext": "py", "lang": "Python", "max_stars_repo_path": "crop/crop_augment_split_movie.py", "max_stars_repo_name": "norton-chris/MARS-Net", "max_stars_repo_head_hexsha": "6f671837d0629422680c78adf9b643894debae70", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma prod_casesK[to_hfref_post]: "case_prod (\<lambda>_ _. k) = (\<lambda>_. k)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (\<lambda>(uu_, uu_). k) = (\<lambda>_. k)
[PROOF STEP]
by auto | {"llama_tokens": 92, "file": "Refine_Imperative_HOL_Sepref_Rules", "length": 1} |
import numpy as np
import torch
from torch import nn
import copy
import util
class DimLinearManual(nn.Linear):
"""
This module is simply a linear layer that is applied to an arbritrary dimension rather than the last dimension.
"""
def __init__(self, in_features, out_features=None, bias=True, shape=No... | {"hexsha": "c8e6c45db5116cd9aecff95bcfeec852f28d8bfc", "size": 4509, "ext": "py", "lang": "Python", "max_stars_repo_path": "dim_models.py", "max_stars_repo_name": "akarshkumar0101/timm-mlp-shaker", "max_stars_repo_head_hexsha": "ab211dd137b790ac57f5ed924c2ada148d54a194", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
import plotly
from IMLearn.learners import UnivariateGaussian, MultivariateGaussian
import numpy as np
import plotly.graph_objects as go
import plotly.io as pio
pio.templates.default = "simple_white"
def test_univariate_gaussian():
# Question 1 - Draw samples and print fitted model
mu = 10
var = 1
n_... | {"hexsha": "e57338b9300d155b43f8e0c47826bf77843c6f5f", "size": 2970, "ext": "py", "lang": "Python", "max_stars_repo_path": "exercises/fit_gaussian_estimators.py", "max_stars_repo_name": "morturr/IML.HUJI", "max_stars_repo_head_hexsha": "7f50bda65904ad6c900b3a8e5cd85a788f5eff2e", "max_stars_repo_licenses": ["MIT"], "max... |
import Statistics: mean, cov
import Random.rand
import LinearAlgebra.logdet
"""
Gaussian{(:μ,:Σ)}
Gaussian{(:F,:Γ)}
Mitosis provides the measure `Gaussian` based on MeasureTheory.jl,
with a mean `μ` and covariance `Σ` parametrization,
or parametrised by natural parameters `F = Γ μ`, `Γ = Σ⁻¹`.
# Usage:
... | {"hexsha": "5e8a7b7eb354926d4c11092224d37cc14e6faedd", "size": 4166, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/gauss.jl", "max_stars_repo_name": "cscherrer/Mitosis.jl", "max_stars_repo_head_hexsha": "e11113d392a9ac9c884212acaf177bc4dbb619c5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 33, "m... |
import numpy as np
from copy import copy, deepcopy
from contextlib import contextmanager
from ...util.event import Event
from ...util.misc import ensure_iterable
from ..base import Layer
from vispy.scene.visuals import Mesh, Markers, Compound
from vispy.scene.visuals import Line as VispyLine
from vispy.color import ge... | {"hexsha": "6cbfacf0b09b5f45ad94fe3e44b1219684ef3979", "size": 79825, "ext": "py", "lang": "Python", "max_stars_repo_path": "napari/layers/shapes/shapes.py", "max_stars_repo_name": "marshuang80/napari", "max_stars_repo_head_hexsha": "10f1d0f39fe9ccd42456c95458e2f23b59450f02", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
from __future__ import (absolute_import, division,
print_function, unicode_literals)
"""
onedim_utils
==========
Module with various functions for MPS/MPOs.
"""
__all__ = ['init_mps_random', 'init_mps_allzero', 'init_mps_logical',
'onebody_sum_mpo', 'expvals_mps', 'ptrace_mps']
im... | {"hexsha": "7a3c2db14a405310c9c86bf748e994514de8ab82", "size": 10246, "ext": "py", "lang": "Python", "max_stars_repo_path": "tncontract/onedim/onedim_utils.py", "max_stars_repo_name": "space-cadet/tncontract", "max_stars_repo_head_hexsha": "a5503951e218a91e9ba03e11c601b95b6bfcb72a", "max_stars_repo_licenses": ["MIT"], ... |
#!/usr/bin/env python
import argparse
import logging
import sys
import os
import time
import json
import glob
from tf_pose import common
import cv2
import numpy as np
from tf_pose.estimator import TfPoseEstimator
from tf_pose.networks import get_graph_path, model_wh
import math
from numpy import dot
from numpy.linalg ... | {"hexsha": "3e1be3016a63c6b748073a01b41a31adf8696f71", "size": 24521, "ext": "py", "lang": "Python", "max_stars_repo_path": "run_mod.py", "max_stars_repo_name": "PintuBeast/openPoseTF2", "max_stars_repo_head_hexsha": "9660b9bc75b5a98fed339c5fce57c2bd90c0dd37", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count... |
# To add a new cell, type '# %%'
# To add a new markdown cell, type '# %% [markdown]'
# %%
import numpy as np
def get_default_gpio_cfg():
return {
"VREF": 3300,
"ADC_MAX_VALUE": 4095,
"R1": 10000
}
def convert_to_resistance(ADC_Value):
cfg = get_default_gpio_cfg()
return ((cfg... | {"hexsha": "5fc9ed8a157c59b17a349688e680aa116ca0475c", "size": 608, "ext": "py", "lang": "Python", "max_stars_repo_path": "openefi_common.py", "max_stars_repo_name": "openefi/Jupyter-Calcs", "max_stars_repo_head_hexsha": "35e0e70a1f7c6693623af1e9ea3ff2e9defc349f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
% Signal Processing Toolbox check
% axs Nov 2020
function SigProcT_here = SignalProcessingToolboxCheck
% Get Toolbox list from ver
tbxs = ver;
[a, tbxs_n] = size(tbxs);
tbx_cell = cell(1,tbxs_n);
tbx_cell = {tbxs.Name};
SigProcT_here = any(ismember(tbx_cell,'Signal Processing Toolbox'));
if SigProcT_here == 0
% ... | {"author": "ucdavis", "repo": "erplab", "sha": "e4f66f7a512c4dee2f7596982318e44bb1b72644", "save_path": "github-repos/MATLAB/ucdavis-erplab", "path": "github-repos/MATLAB/ucdavis-erplab/erplab-dd2f60aa41b01c866fcec342efafc48323523cc2/functions/SignalProcessingToolboxCheck.m"} |
[STATEMENT]
lemma fconverse_small[simp]: "small {[b, a]\<^sub>\<circ> | a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. small {[b, a]\<^sub>\<circ> |a b. [a, b]\<^sub>\<circ> \<in>\<^sub>\<circ> r}
[PROOF STEP]
proof-
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. ... | {"llama_tokens": 2895, "file": "CZH_Foundations_czh_sets_CZH_Sets_FBRelations", "length": 16} |
###############################################################################
##### MAIN PROGRAM #####
###############################################################################
import sys
sys.path.append("./libs_v0")
# Python libs
import numpy as np
impor... | {"hexsha": "7770e52a1a65b3939795ed80163a694aa615b863", "size": 766, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/main1D.py", "max_stars_repo_name": "JordiManyer/bddc", "max_stars_repo_head_hexsha": "4e2f09a17d47399724336f6df502f47a772d3030", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
import tensorflow
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
print("Tensorflow Imported")
plt.plot(np.arange(100))
plt.show() | {"hexsha": "2c579d4adb76198e5d87b649cc742fb78c3bb886", "size": 152, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/test.py", "max_stars_repo_name": "JonnyTran/lncrna-melanoma-immunoresponse", "max_stars_repo_head_hexsha": "cc61fdd9c53e581e6d3ad7308728e45a77a10e62", "max_stars_repo_licenses": ["FTL"], "max_s... |
'''
This file is originally from "Sports With AI" https://github.com/Furkan-Gulsen/Sport-With-AI/blob/main/types_of_exercise.py
'''
import numpy as np
from body_part_angle import BodyPartAngle
from utils import *
import math
# import autopy
import pyautogui
class TypeOfControl(BodyPartAngle):
def __in... | {"hexsha": "ebd9323ea04dd7657b00e72e1975186eafd52ca5", "size": 3280, "ext": "py", "lang": "Python", "max_stars_repo_path": "interface/interface.py", "max_stars_repo_name": "liuzihau/OutdoorAtHome", "max_stars_repo_head_hexsha": "aaf928c8e8e347b5ed9809e20b4536250236eca5", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
import numpy as np
import xarray as xr
from ..utils.jaggedarray import flatten_jagged_array
_MESH_ATTRS = {
"cf_role": "mesh_topology",
"long_name": "Topology data of 2D unstructured mesh",
"topology_dimension": 2,
"node_coordinates": "x_of_node y_of_node",
"face_node_connectivity": "nodes_at_patc... | {"hexsha": "99cc2c66e80e00576a23645564cd89ef865f0166", "size": 2487, "ext": "py", "lang": "Python", "max_stars_repo_path": "landlab/graph/ugrid.py", "max_stars_repo_name": "prakritichauhanpuresoftware/landlab", "max_stars_repo_head_hexsha": "0ae7a91fd3d625ca9e1266f4a49013c354772dff", "max_stars_repo_licenses": ["MIT"],... |
import numpy as np
import scipy.stats
import matplotlib.pyplot as plt
# plt.style.use('seaborn-colorblind')
# plt.style.use('grayscale')
from tqdm import tqdm
def gauss(x, mu=0, sigma=1):
return (
1 / np.sqrt(2 * np.pi * sigma ** 2) * np.exp(-0.5 * (x - mu) ** 2 / sigma ** 2)
)
def f(x):
return... | {"hexsha": "8180cc03d3ca3971cb951320581f854942c8d188", "size": 1526, "ext": "py", "lang": "Python", "max_stars_repo_path": "writing/scripts/monte_carlo_int_example.py", "max_stars_repo_name": "johanere/qflow", "max_stars_repo_head_hexsha": "5453cd5c3230ad7f082adf9ec1aea63ab0a4312a", "max_stars_repo_licenses": ["MIT"], ... |
from time import time, sleep
from numpy import zeros, right_shift, array
import PySpin
from PySpin import System
from matplotlib import pyplot as plt
plt.ion()
class FLIR_SL():
def __init__(self):
self.recording_dir = self.get_tempdir()
def init(self):
pass
def start(self):
"""
... | {"hexsha": "40ac4465028a69e1a33aaf8176e7ca09a2ac6fbd", "size": 3250, "ext": "py", "lang": "Python", "max_stars_repo_path": "lcp_video/flir_camera/flir_camera_SL.py", "max_stars_repo_name": "vstadnytskyi/lcp-video", "max_stars_repo_head_hexsha": "a65f9c8ecd370d975128af67427f3dd8141bf667", "max_stars_repo_licenses": ["BS... |
Describe Users/MatthewLocke here.
| {"hexsha": "db8b659ca6329925632f9b8d5beba64dc3eb3aa9", "size": 34, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/MatthewLocke.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import numpy as np
from Auto_diff import FD, Jacobian
def test_function_jacobian():
x = Jacobian([1, 3, 4])
fun = np.sin(3*x[0] + 2*x[1] - x[2])
assert isinstance(fun[0], FD), AssertionError('Not an instance of AD.')
assert isinstance(fun[0].val, int) or isinstance(fun[0].val, float), AssertionError('V... | {"hexsha": "1c1e5f61eb7615402b5c370f421e423b5b0e6968", "size": 1938, "ext": "py", "lang": "Python", "max_stars_repo_path": "Auto_diff/tests/test_jacobian.py", "max_stars_repo_name": "AutoDiff-Dream-Team/cs107-FinalProject", "max_stars_repo_head_hexsha": "4c3b0f6945acfe6fd3fe2757858538ec3cceb819", "max_stars_repo_licens... |
# Command Line Components
import Base: show
export AbstractOption, Option, ShortOption
"""
AbstractOption{T}
"""
abstract type AbstractOption{T} end
isoption(s::AbstractString) = startswith(s, "-")
islong(s::AbstractString) = startswith(s, "--")
isoption(::Void) = false
islong(::Void) = false
import Base: ==, in... | {"hexsha": "1953658b08164251f18597b566a27108eb207172", "size": 4378, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Elements.jl", "max_stars_repo_name": "Roger-luo/CLI.jl", "max_stars_repo_head_hexsha": "a3e01694eaca5e4374e4e30c2ebc69b15d7d691f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 13, "ma... |
# from numpy import *
'''
# 生成对角矩阵
print(eye(4))
# a = np.array([1,2,3])
a = np.array([[1,2],[3,4]])
#ndmin生成最小维度 一个[ ] 就是一个维度
b = np.array([1, 2, 3,4,5], ndmin=2)
# dtype可以设置数组的数据类型 如bool 、int 、 float 、complex
c = np.array([1,2,3,4], dtype = bool)
# dt = np.dtype('i8')
dt = np.dtype([('age', np.int32)])
d = np.a... | {"hexsha": "d53980b95fd555be87de5b8c0ba9852a23d1879b", "size": 1890, "ext": "py", "lang": "Python", "max_stars_repo_path": "Numpy_Pandas/study_pandas/numpy_test.py", "max_stars_repo_name": "yjyn01/-", "max_stars_repo_head_hexsha": "cf14642d776bc23ae70f4c9ea310e08a41743e15", "max_stars_repo_licenses": ["MIT"], "max_star... |
from .base import GreeksFDM, Option
import numpy as _np
from scipy.optimize import root_scalar as _root_scalar
from scipy.optimize import root as _root
import sys as _sys
import warnings as _warnings
from .utils import docstring_from
class GBSOption(Option):
"""
Calculate the Generalized Black-Scholes option ... | {"hexsha": "047987216f371482102fe9c5c32f241298a79bb4", "size": 27865, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/finoptions/vanillaoptions.py", "max_stars_repo_name": "bbcho/finoptions-dev", "max_stars_repo_head_hexsha": "81365b6d93693b0b546be92448db858ccce44d5a", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
from scipy import linalg
from numpy import matmul
import time
import torch
def LU_solver(A,b):
P,L,U = linalg.lu(A)
y = linalg.solve(L,matmul(P,b))
x = linalg.solve(U,y)
return x
def Simulation_LU_solver(A,b,x):
P,L,U = linalg.lu(A)
y = linalg.solve(L,matmul(P,b))
x = li... | {"hexsha": "874b3fd0edbc331cb1b04f1e71335a3bd2519536", "size": 897, "ext": "py", "lang": "Python", "max_stars_repo_path": "Simulation Python/Solver.py", "max_stars_repo_name": "nmerovingian/dissociativeCE-Simulation-MachineLearning", "max_stars_repo_head_hexsha": "cfbc8b8e6c9e3f2efc994fcf1d207c6266eedf2e", "max_stars_r... |
import pandas as pd
from rdkit import Chem
import numpy as np
import json
from gensim.models import Word2Vec
from gensim.test.utils import get_tmpfile
from gensim.models import KeyedVectors
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
import seaborn as sns
import networkx as nx
import re
""" Load ... | {"hexsha": "62d4d3f11d7fb9f310b495ad9da5bf93b049abbe", "size": 8792, "ext": "py", "lang": "Python", "max_stars_repo_path": "Word2Vect/DEGREES/find_degrees.py", "max_stars_repo_name": "jfmalloy1/ChemAsLanguage", "max_stars_repo_head_hexsha": "1236408e0b01f16a6b160b2fb08896c66066fade", "max_stars_repo_licenses": ["MIT"],... |
import os
import numpy as np
from matplotlib.pyplot import *
from mpl_toolkits.mplot3d import axes3d, Axes3D
from matplotlib import cm
import itertools
import scipy.optimize as op
import collections
FOLDER = os.path.dirname(os.path.realpath(__file__))
def load_data():
datafile = FOLDER + '/ex2data1.txt'
dat... | {"hexsha": "a9278d23ff4c9d9e00c51a668514c450e4833147", "size": 2857, "ext": "py", "lang": "Python", "max_stars_repo_path": "andrew_exercises/mlex2/ex2.py", "max_stars_repo_name": "tonylampada/octaveplay", "max_stars_repo_head_hexsha": "9c5de1898a359f178d92de0ad09e74f004cab315", "max_stars_repo_licenses": ["MIT"], "max_... |
from collections import defaultdict
import random
import logging
import itertools as it
import numpy as np
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import KFold
from joblib import Parallel, delayed
from .fastaparse import get_junction_seqs
log = logging.getLogger('2passtool... | {"hexsha": "affffea1f525f1f3fbf3567456bd9e37d4bf1a14", "size": 3433, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib2pass/seqlr.py", "max_stars_repo_name": "btrspg/2passtools", "max_stars_repo_head_hexsha": "725a9eaff3c7ffa89fd715f46535db0351d117f3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16,... |
import joblib
import pandas as pd
import numpy as np
from sklearn.preprocessing import LabelEncoder #
from server.ml.income_classifier.random_forest import MultiColumnLabelEncoder
class ExtraTreesClassifier:
def __init__(self):
path_to_artifacts = "E:/JavaProgra/ML_and_DC/Project - Machine Learning/researc... | {"hexsha": "e4de4e32eb2a7d29d216017ed5f00ca2dd48ced7", "size": 1731, "ext": "py", "lang": "Python", "max_stars_repo_path": "backend/src/server/ml/income_classifier/extra_trees.py", "max_stars_repo_name": "Kumar021/ml_web_services", "max_stars_repo_head_hexsha": "fde06b1163606cbba0fafe09000efac7868ab75c", "max_stars_rep... |
\chapter{Safety proof and formal specification}
\label{appendix:correctness}
This appendix includes a formal specification and a proof of safety for
the basic Raft algorithm presented in Chapter~\ref{basicraft}. The
specification and proof are introduced in Chapter~\ref{correctness}.
The formal specification makes th... | {"hexsha": "244be85f35f8651cb4c4c5337b297c844c49d885", "size": 31289, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "proof/proof.tex", "max_stars_repo_name": "ahrtr/dissertation", "max_stars_repo_head_hexsha": "7ad82c250a28c4a4d2406f43756ab2f8837292b3", "max_stars_repo_licenses": ["CC-BY-3.0", "CC-BY-4.0"], "max_... |
import numpy as np
from trig_functions import sin
class TestSin(object):
def test_sin(self):
my_sin = sin(6, 10000)
assert np.isclose(my_sin, np.sin(6), atol=1e-12)
| {"hexsha": "4aa67f5987167d7a1745819f1c83655ac2ac8f49", "size": 190, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_trig_functions.py", "max_stars_repo_name": "acse-va220/ci_acse1", "max_stars_repo_head_hexsha": "6f3d21499df2aae81a37e88781e77ad1cfce98c0", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Dispatchable and non-dispatchable generators
## Expressions
"Curtailed power of a non-dispatchable generator as the difference between its reference power and the generated power."
function expression_gen_curtailment(pm::_PM.AbstractPowerModel; nw::Int=_PM.nw_id_default, report::Bool=true)
pgcurt = _PM.var(pm,... | {"hexsha": "0322a7d1116ca9785576fc2fafa23c71b6206157", "size": 659, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/core/gen.jl", "max_stars_repo_name": "Electa-Git/FlexPlan.jl", "max_stars_repo_head_hexsha": "bedaa248f3abdfeb72882f3ae4015ca0e742550c", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.