text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import math
import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
from chainer import cuda, Variable
from chainer.initializers import Normal
class text_encoder(chainer.Chain):
def __init__(self, latent_size=64, num_objects=10, num_descriptions=10):
super(text_encoder, se... | {"hexsha": "9f2c41832424ecd8ef5b935f3fc0aede8a7e08e0", "size": 44920, "ext": "py", "lang": "Python", "max_stars_repo_path": "autoencoders/tower.py", "max_stars_repo_name": "pouyaAB/Accept_Synthetic_Objects_as_Real", "max_stars_repo_head_hexsha": "127172fbfbac0af01184eff8cabba3d6afd2ac0b", "max_stars_repo_licenses": ["M... |
import numpy
import scipy.signal
from generate import *
def generate():
def process(factor, x):
x_interp = numpy.array([type(x[0])()] * (len(x) * factor))
for i in range(0, len(x)):
x_interp[i * factor] = factor * x[i]
b = scipy.signal.firwin(128, 1 / factor)
return [sc... | {"hexsha": "beb991450bad9fe6187add4fd1f76e8da90ccf6b", "size": 1409, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/composites/interpolator_spec.py", "max_stars_repo_name": "konsumer/luaradio", "max_stars_repo_head_hexsha": "d349b82f992bb0e95fd68b8c2867399aa68a40ea", "max_stars_repo_licenses": ["MIT"], "m... |
\section{Introduction}
As deep learning is becoming an increasingly big influence in everyday applications, more and more focus is put into increasing its distribution to different platforms.\\
During the winter semester 2016/2017 a project seminar emerged, that laid focus on developing a mobile phone application for G... | {"hexsha": "316ad36ae325054920af86a0c0e34a24d7237ad9", "size": 1000, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Documentation/Introduction.tex", "max_stars_repo_name": "HPI-DeepLearning/PlaceRecognizer", "max_stars_repo_head_hexsha": "7eca391e92f33812dad94df232662658e676528f", "max_stars_repo_licenses": ["MIT... |
"""
Main function for setting up a Zygo interferometer as a remote server.
Not tested at this time. Module is not working!
Author: James Johnson
License: MIT
"""
import socket
import numpy as np
import time
import os
import logging
import threading
# setup logging for debug
logging.basicConfig(format='%(asctime)s ... | {"hexsha": "4cd468f5f22e71e7e1753b57c8a21f4ebbefba0b", "size": 8069, "ext": "py", "lang": "Python", "max_stars_repo_path": "interferometer/connectzygo.py", "max_stars_repo_name": "opticsdev/interferometer-connect", "max_stars_repo_head_hexsha": "81cdee698214307ba2d7be3afe422eb74f51b9b9", "max_stars_repo_licenses": ["MI... |
#include <boost/fusion/mpl/back.hpp>
| {"hexsha": "153b9fac751bdc6ff9946c95a3010fe8d92299fd", "size": 37, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_fusion_mpl_back.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1.0"], "m... |
# import numpy as np
# import pandas as pd
# from datetime import datetime
# import matplotlib.pyplot as plt
# from os.path import join as pjoin
# import util.vis as V
# import util.helpers as H
# import data_analysis
# import csv
# import random
# import gc
# from glob import glob
# import sklearn as sk
# from sklear... | {"hexsha": "fbf4592ad762f5f38aba26ca4fd24a7fdbaad368", "size": 16983, "ext": "py", "lang": "Python", "max_stars_repo_path": "feature_selection_plots.py", "max_stars_repo_name": "ashu-vyas-github/Flemish_Sign_Language_Openpose", "max_stars_repo_head_hexsha": "6a7365b9d06a822ea6ece280031c193f582da4c3", "max_stars_repo_li... |
using Test
using WebIO
@testset "JSString Interpolations" begin
@testset "Interpolations into JSStrings" begin
text = "Hello, world!"
js_text = js"console.log($text);"
@test js_text.s == """console.log("Hello, world!");"""
dict = Dict("foo" => "bar")
js_dict = js"console.lo... | {"hexsha": "8e1cffc84e25f4a89db332be4b3f76c5fac4cf5e", "size": 1471, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/syntax.jl", "max_stars_repo_name": "UnofficialJuliaMirror/WebIO.jl-0f1e0344-ec1d-5b48-a673-e5cf874b6c29", "max_stars_repo_head_hexsha": "289ac08b2d64e0f4dd3d6fc33beabf63c3ce43a5", "max_stars_r... |
type TDPrimes{T<:Integer}
plim::T
end
function Base.start{T<:Integer}(pl::TDPrimes{T})
2ones(T, 1)
end
function Base.done{T<:Integer}(pl::TDPrimes{T}, p::Array{T,1})
p[end] > pl.plim
end
function Base.next{T<:Integer}(pl::TDPrimes{T}, p::Array{T,1})
pr = p[end]
for i in (pr+1):(pl.plim)
i... | {"hexsha": "f85b21bd6e83be16e67b4ea72e0a56d190acdccf", "size": 693, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "lang/Julia/sequence-of-primes-by-trial-division.jl", "max_stars_repo_name": "ethansaxenian/RosettaDecode", "max_stars_repo_head_hexsha": "8ea1a42a5f792280b50193ad47545d14ee371fb7", "max_stars_repo_l... |
##
# \brief C-Vine structure.
# At each level in the C-vine, the tree structure is
# selected by searching for the parent node which maximizes
# the sum of all edge-weights. The edge weights are taken to
# be abs(empirical kendall's tau) correlation coefficients in this
# implementation.
#
from starvine.vine.base_vine... | {"hexsha": "48da769f8b5bd8e83f2523ea834fbf46560fc545", "size": 10310, "ext": "py", "lang": "Python", "max_stars_repo_path": "starvine/vine/C_vine.py", "max_stars_repo_name": "wgurecky/StarVine", "max_stars_repo_head_hexsha": "b952a88eeaff476484ba6a26420cfe4ef575d162", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
#!/usr/bin/env python3
import sys
import os
import numpy as np
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell as m
mod... | {"hexsha": "51dc43fcc8df78fae0302f1e54819bb23469d82e", "size": 746, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/pymcell4_positive/0090_numpy_array_as_release_location/model.py", "max_stars_repo_name": "mcellteam/mcell-tests", "max_stars_repo_head_hexsha": "34d2d967b75d56edbae999bf0090641850f4f4fe", "ma... |
[STATEMENT]
lemma valid_path_offset[simp]:
shows "valid_path (\<lambda>t. g t - z) \<longleftrightarrow> valid_path g"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. valid_path (\<lambda>t. g t - z) = valid_path g
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. valid_path (\<lambda>t. g t - z... | {"llama_tokens": 699, "file": null, "length": 8} |
'''
Created on Apr 3, 2019
@author: Leo Lo
'''
from NearFieldOptics.Materials.material_types import *
from NearFieldOptics.Materials.TransferMatrixMedia import MatrixBuilder as mb
import sympy
import copy
import numpy as np
from common.baseclasses import ArrayWithAxes as AWA
class Calculator():
"""Calculator cla... | {"hexsha": "778ff70e18205469f8af8a4786b56ccf99093cfc", "size": 45578, "ext": "py", "lang": "Python", "max_stars_repo_path": "Calculator.py", "max_stars_repo_name": "Leo-Lo/TransferMatrixMedia", "max_stars_repo_head_hexsha": "dbce6f69ba794cf469884a0357d903293cf288ed", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
if ~exist('n_ima'),
fprintf(1,'No data to process.\n');
return;
end;
if n_ima == 0,
fprintf(1,'No image data available\n');
return;
end;
if ~exist('active_images'),
active_images = ones(1,n_ima);
end;
n_act = length(active_images);
if n_act < n_ima,
active_images = [active_images ones(1,n_ima-n_act... | {"author": "JzHuai0108", "repo": "ekfmonoslam", "sha": "443f6be744732453cdb90679abcaf5c962a6295e", "save_path": "github-repos/MATLAB/JzHuai0108-ekfmonoslam", "path": "github-repos/MATLAB/JzHuai0108-ekfmonoslam/ekfmonoslam-443f6be744732453cdb90679abcaf5c962a6295e/EKF_monoSLAM_1pRANSAC/matlab_code/matlabcalibration2ourca... |
import theano
import lasagne
import numpy as np
from six import integer_types
from six.moves import xrange
import six.moves.builtins as builtins
from theano import Op, tensor, Variable, Apply
from theano.tensor.signal.pool import PoolGrad, Pool
try: # Theano-1.0.2
from theano.gpuarray.opt import register_opt
exc... | {"hexsha": "997296350b0bcc98f8c9290879bf742de613f564", "size": 16630, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/utils/patches.py", "max_stars_repo_name": "shoaibahmed/pl-cnn", "max_stars_repo_head_hexsha": "e41bb0c4e36907d33c2701d53d6fff0ac308d031", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
class CNN():
# @todo
pass | {"hexsha": "9f829d2cfd437597c71c3d3da78b31b0ea930bc4", "size": 47, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/cnn.py", "max_stars_repo_name": "minqi/basicnn", "max_stars_repo_head_hexsha": "62231edfa67fdff1378849f988de8f4c42d4a48a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_st... |
'''
Record Linkage Testing Script for CORA dataset using ECM Classifier method.
'''
import numpy as np
import pandas as pd
import re
import recordlinkage
import unittest
import xml.etree.ElementTree
from common import get_logger, log_quality_results, InformationRetrievalMetrics
from data.cora import Cora
from data... | {"hexsha": "6d63ef503c792fc1bafd56f2b3c8eb124da8a1ce", "size": 5537, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/fs/test_ecm_classifier.py", "max_stars_repo_name": "bhaskargautam/record-linkage", "max_stars_repo_head_hexsha": "01eb29f8b7fb4dd1625187232f2dafe47f24cddf", "max_stars_repo_licenses": ["MIT"... |
from numpy import genfromtxt
import numpy as np
from sklearn import datasets, linear_model
dataPath = r"all.txt"
deliverData = genfromtxt(dataPath, delimiter=',')
print("data")
print(deliverData)
X = list(deliverData[:, 1:])
Y = list(deliverData[:, 0])
print("X:")
print(X)
print("Y")
print(Y)
regression = linear_... | {"hexsha": "fc780057af108a3ac9a71086e5d3ddb4eb837d47", "size": 709, "ext": "py", "lang": "Python", "max_stars_repo_path": "regression/multipleRegression.py", "max_stars_repo_name": "MeetXinZhang/HelloML", "max_stars_repo_head_hexsha": "93e9f190333d06fe93c4fdba64aa89fb403f29f8", "max_stars_repo_licenses": ["Apache-2.0"]... |
import librosa
import librosa.display
import matplotlib.pyplot as plt
import numpy as np
import math
import os
def audioToSlicedSpecto(input_file, output_stub):
chunk_length_sec = 5
# Set some of the values we use for the Spectrogram
n_fft = 2048
n_mels = 256
hop_length = 256 # This is basically... | {"hexsha": "e49c6f52a7a5f781bf3e63a009ad153df941d0c9", "size": 4199, "ext": "py", "lang": "Python", "max_stars_repo_path": "soundscapes/soundscape_splitter.py", "max_stars_repo_name": "thesteve0/birdclef21", "max_stars_repo_head_hexsha": "9c8748edbd6febe88191736406d838787e3c7a71", "max_stars_repo_licenses": ["Apache-2.... |
SUBROUTINE jima(i,xs,xe,incx,n,oct,mu,tsxs)
!-------------------------------------------------------------
!
! Jacobian Iteration MAtrix
! Directs the equations to set up the matrices that work
! with the phi and source vectors. takes in parameters from
! matsweep and solves for the updates to jmat and jpsi
!
!... | {"hexsha": "0f3da71c5b2aa1be6bdd94a47a088f61bc2c8fde", "size": 3093, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "variations-old/anisdd-1d/jima.f90", "max_stars_repo_name": "lanl/pidots", "max_stars_repo_head_hexsha": "9b1bf717337ce84ea20b82cfb358eadb04532d6c", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
import numpy as np
from scipy import interpolate
import fileinput
#####Extract the price value
i=-1
prices = []
for line in fileinput.input():
if i==-1:
n=int(line)
i=i+1
else:
prices.append(line.split("\t")[1])
#####Extract the training and testing data
training_feature = []
... | {"hexsha": "e1de963ed32961536ec51ece9f3b2831df3b270a", "size": 767, "ext": "py", "lang": "Python", "max_stars_repo_path": "HackerRank/Solutions/ml_hackerrank/missing_stock_prices.py", "max_stars_repo_name": "fakecoinbase/sweetpandslashAlgorithms", "max_stars_repo_head_hexsha": "9641e31320f17c6393b7746312c4b030a7faf015"... |
{-# OPTIONS --safe #-}
module Cubical.HITs.TypeQuotients where
open import Cubical.HITs.TypeQuotients.Base public
open import Cubical.HITs.TypeQuotients.Properties public
| {"hexsha": "0059b89aad88427f7905daf7ada60c4f391a7c57", "size": 172, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Cubical/HITs/TypeQuotients.agda", "max_stars_repo_name": "marcinjangrzybowski/cubical", "max_stars_repo_head_hexsha": "53e159ec2e43d981b8fcb199e9db788e006af237", "max_stars_repo_licenses": ["MIT"],... |
% $Id: SolarSystem.tex,v 1.1 2008/01/31 18:04:17 dconway Exp $
\chapter{\label{chapter:SolarSystem}The Space Environment}
\chapauthor{Darrel J. Conway}{Thinking Systems, Inc.}
The core purpose of GMAT is to perform flight dynamics simulations for spacecraft flying in the
solar system. There are many different compone... | {"hexsha": "1e772eb383db085740cdd8b329b56f2b2e957c98", "size": 8217, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/SystemDocs/ArchitecturalSpecification/SolarSystem.tex", "max_stars_repo_name": "Randl/GMAT", "max_stars_repo_head_hexsha": "d6a5b1fed68c33b0c4b1cfbd1e25a71cdfb8f8f5", "max_stars_repo_licenses": ... |
import tensorflow as tf
import pandas as pd
from collections import Counter
from imblearn.combine import SMOTEENN
from imblearn.combine import SMOTETomek
from imblearn.under_sampling import NearMiss
import numpy as np
def scale(df, column):
df[column] = (df[column] - df[column].min()) / (df[column].max() - df[col... | {"hexsha": "eef6d1f7eec74c11c77a214faa56354d2aa404c0", "size": 2661, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_utils.py", "max_stars_repo_name": "camille1874/ads_classify", "max_stars_repo_head_hexsha": "5db809634c1a1bae0a84ec71bcc6407d763075ab", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
[STATEMENT]
lemma aligned_shift':
"\<lbrakk>x < 2 ^ n; is_aligned (y :: 'a :: len word) n;n \<le> LENGTH('a)\<rbrakk>
\<Longrightarrow> (y + x) >> n = y >> n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>x < 2 ^ n; is_aligned y n; n \<le> LENGTH('a)\<rbrakk> \<Longrightarrow> y + x >> n = y >> n
[PRO... | {"llama_tokens": 723, "file": "Word_Lib_Aligned", "length": 5} |
#!/usr/bin/python
import numpy as np
from scipy.linalg import expm
class IMU(object):
"""
IMU Class - Contains the mean, covariance and the Inverse Pose of the IMU Matrix
"""
def __init__(self):
"""
Constructor for IMU Class
"""
# initialize the mean, covariance and t... | {"hexsha": "780b6f8d7d0d75480c175bfc7ccad6dfb9a074dc", "size": 10756, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/imu.py", "max_stars_repo_name": "Anirudh-Swaminathan/visual_inertial_slam", "max_stars_repo_head_hexsha": "3cf797a757648f7d8bc588cd715ea0a2807fd6fb", "max_stars_repo_licenses": ["MIT"], "max_... |
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0,1,2,3"
import numpy as np
from keras.models import *
from keras.layers import *
from tensorflow.python.keras import losses
from keras.applications.vgg16 import VGG16
from keras.preprocessing.image import ImageDataGenerator
from keras.optimizers import *
from keras.callb... | {"hexsha": "991ad5bf610b9dc000f0fb1569713c2f58b82c60", "size": 8154, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_Det.py", "max_stars_repo_name": "aparecidovieira/keras_segmentation", "max_stars_repo_head_hexsha": "9e80cb502378af6021dbfa565877adebbb4b674f", "max_stars_repo_licenses": ["Net-SNMP", "Xnet"... |
#############################################################################
# NOTICE #
# #
# This software (or technical data) was produced for the U.S. Government #
# under ... | {"hexsha": "8e181aa0660290c40f0ed6588ec3e76bd98e5aea", "size": 13658, "ext": "py", "lang": "Python", "max_stars_repo_path": "detection/component_util/mpf_component_util/frame_transformers/affine_frame_transformer.py", "max_stars_repo_name": "openmpf/openmpf-python-component-sdk", "max_stars_repo_head_hexsha": "83e433a8... |
import cv2
import numpy as np
from preprocess.config import *
import random
import matplotlib.pyplot as plt
class DecideRect(object):
def __init__(self, fn_video_index):
self.config = Configuration()
self.fn_video_index = fn_video_index
self.fn_video = self.config.crop_vFn[fn_video_index]
... | {"hexsha": "c0ecafac25749c5da52a4c1b1d25fd0e8a506e4a", "size": 11319, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocess/PrepareData.py", "max_stars_repo_name": "Yao-Shao/Basketball-Game-Goal-Detector", "max_stars_repo_head_hexsha": "a71b5fa2cbc16683dba8125e3c47eadaf6d5103d", "max_stars_repo_licenses": [... |
module M {
array A = [3] U32
constant a = 0
enum E { X, Y, Z }
type T
struct S { x: U32 }
port P
passive component C {
type T
array A = [3] U32
constant a = 0
enum E { X, Y, Z }
struct S { x: U32 }
}
instance c: C base id 0x100
topology T {
}
}
| {"hexsha": "8f7341e28399bc51ed1b8110e6addd19eb8e8a1f", "size": 298, "ext": "fpp", "lang": "FORTRAN", "max_stars_repo_path": "compiler/tools/fpp-locate-defs/test/defs/defs-2.fpp", "max_stars_repo_name": "kevin-f-ortega/fpp", "max_stars_repo_head_hexsha": "ee355fc99eb8040157c62e69f58ac6a8435cd981", "max_stars_repo_licens... |
# Copyright 2020-2022 OpenDR European Project
#
# 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 agree... | {"hexsha": "221012aeb096810047b288949ff9901b07f79804", "size": 10279, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/sources/tools/perception/compressive_learning/multilinear_compressive_learning/test_multilinear_compressive_learner.py", "max_stars_repo_name": "ad-daniel/opendr", "max_stars_repo_head_hexs... |
"""
qrdelete!(Q, R, k)
Delete the left-most column of F = Q[:, 1:k] * R[1:k, 1:k] by updating Q and R.
Only Q[:, 1:(k-1)] and R[1:(k-1), 1:(k-1)] are valid on exit.
"""
function qrdelete!(Q::AbstractMatrix, R::AbstractMatrix, k::Int)
n, m = size(Q)
m == LinearAlgebra.checksquare(R) || throw(DimensionMismatch()... | {"hexsha": "31f3bb1da9f4ef13b4868819bfca86c2f25428d9", "size": 7249, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/nlsolve/utils.jl", "max_stars_repo_name": "miguelraz/OrdinaryDiffEq.jl", "max_stars_repo_head_hexsha": "c3ecac0f1b86750dc41ea5d00a3d740824955616", "max_stars_repo_licenses": ["MIT"], "max_stars... |
#!/usr/bin/env python3
"""
book-scanner.py
@author: Will Rhodes
"""
import argparse
from pathlib import Path
from fpdf import FPDF
import pytesseract
import cv2
import numpy as np
import re,shutil,imutils,os,time
def start():
parser = argparse.ArgumentParser(description='Take a directory of text/book photos and... | {"hexsha": "c2dbc8a0e317b7e0197b245eeeb744695aab91e1", "size": 9790, "ext": "py", "lang": "Python", "max_stars_repo_path": "book-scanner.py", "max_stars_repo_name": "whirledsol/book-scanner", "max_stars_repo_head_hexsha": "1b471500d6bc3138215b7ffdc26267ae4901d8df", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
c
c ===================================================================
function alpha2(rs,dz,sp,iexch,exchg)
c ===================================================================
c
implicit none
c
integer iexch
integer incof
integer i
c
real*8 alpha2
real*8 rs
... | {"hexsha": "7249ddfa77f6f4fe168a919901fa1d63dcfe0682", "size": 6501, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "src/Potential/alpha2_c.f", "max_stars_repo_name": "rdietric/lsms", "max_stars_repo_head_hexsha": "8d0d5f01186abf9a1cc54db3f97f9934b422cf92", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars... |
import numpy as np
import pandas as pd
from flight_fusion import ClientOptions, FusionServiceClient
from flight_fusion.ipc.v1alpha1 import SaveMode
np.random.seed(42)
df_example = pd.DataFrame(np.random.randn(5, 3), columns=["col1", "col2", "col3"])
# and create an instance of the service client
options = ClientOpti... | {"hexsha": "7f77473030bd7fb6e87171964136994b49766466", "size": 505, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/prepare_demo_data.py", "max_stars_repo_name": "roeap/flight-fusion", "max_stars_repo_head_hexsha": "14f73c99c5214277d0abcced633d83b37f1d5292", "max_stars_repo_licenses": ["Apache-2.0", "MIT... |
"""
This file stores a subclass of GreedySolver, the MaxCutSolver. This subclass
implements an inference procedure inspired by Snir and Rao (2006) that
approximates the max-cut problem on a connectivity graph generated from the
observed mutations on a group of samples. The connectivity graph represents a
supertree g... | {"hexsha": "a37ea941f2213c8f2c2d49cf0b36cab866202dbe", "size": 7142, "ext": "py", "lang": "Python", "max_stars_repo_path": "cassiopeia/solver/MaxCutSolver.py", "max_stars_repo_name": "YosefLab/SingleCellLineageTracing", "max_stars_repo_head_hexsha": "d9133fc80c8314e7935fde037dd86111cac47447", "max_stars_repo_licenses":... |
using DDF
using LinearAlgebra
using StaticArrays
@testset "Empty manifold D=$D" for D in 0:Dmax
S = Float64
mfd = empty_manifold(Val(D), S; optimize_mesh=false)
@test invariant(mfd)
for R in 0:D
@test nsimplices(mfd, R) == 0
end
@test get_lookup(mfd, 0, D) ≡ get_simplices(mfd, D)
f... | {"hexsha": "6a433aecb4bf680bbad2abf3b96699a8688eb2be", "size": 10809, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test-manifolds.jl", "max_stars_repo_name": "eschnett/DDF.jl", "max_stars_repo_head_hexsha": "e5a93eaef99e2143619ce81ec0e9e222f049f25b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import theano.tensor as T
from theano import scan
from keras.layers.recurrent import GRU, Recurrent, LSTM
from keras.utils.theano_utils import shared_zeros # , alloc_zeros_matrix
from ..utils import theano_rng
from ..regularizers import SimpleCost
class DRAW(Recurrent):
'''DRAW
Parameters:
===========... | {"hexsha": "9566cf2513eb4fd6ccdab52bc9adbdc36737b2d2", "size": 13288, "ext": "py", "lang": "Python", "max_stars_repo_path": "drugresnet/seya/layers/draw.py", "max_stars_repo_name": "Naghipourfar/CCLE", "max_stars_repo_head_hexsha": "cd557928a003200c683861b29c607942029bffb1", "max_stars_repo_licenses": ["MIT"], "max_sta... |
from pathlib import Path
import numpy
from PyQt5.QtWidgets import QFileDialog
from app.logs import logger
def resize_to_height(wh, target_h):
w, h = wh
k = target_h / h
return int(w * k) // 2 * 2, target_h
def pick_save_file(self, title='Render As', pre_path='', suffix: str = None) -> Path:
pick_f... | {"hexsha": "a85ce869ee008482cdbc6bfbbf94853689ccd777", "size": 1561, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/funcs.py", "max_stars_repo_name": "JargeZ/NtscQT", "max_stars_repo_head_hexsha": "1f7790b6ae9af81c56f44fbd689f9b43b1007b21", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 43, "... |
getPerformance = function(pred , val) {
res = pred - val
MAE = sum(abs(res)) / length(val)
RSS = sum(res^2)
MSE = RSS / length(val)
RMSE = sqrt(MSE)
R2 = 1 - ( RSS/ ( sum((val-mean(val))^2) ) )
perf = data.frame(MAE,RSS,MSE,RMSE,R2)
}
################
# CAP 1
################
###########... | {"hexsha": "ef1f3dbe64b5054123b2ce0084e641e938464918", "size": 595, "ext": "r", "lang": "R", "max_stars_repo_path": "competitions/pakdd-cup-2014/time_series_sketch.r", "max_stars_repo_name": "gtesei/fast-furious", "max_stars_repo_head_hexsha": "b974e6b71be92ad8892864794af57631291ebac1", "max_stars_repo_licenses": ["MIT... |
# Copyright (c) 2018 The Harmonica Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
"""
Testing ICGEM gdf files loading.
"""
import os
import numpy as np
import numpy.testing ... | {"hexsha": "0e72205d5ddfdcad13315f46b7e212ac2a83247c", "size": 11344, "ext": "py", "lang": "Python", "max_stars_repo_path": "harmonica/tests/test_icgem.py", "max_stars_repo_name": "fatiando/harmonica", "max_stars_repo_head_hexsha": "ea7947eab99c1762a957758258e194a35a05585b", "max_stars_repo_licenses": ["BSD-3-Clause"],... |
[STATEMENT]
lemma Abs_finfun_inject_finite:
fixes x y :: "'a \<Rightarrow> 'b"
assumes fin: "finite (UNIV :: 'a set)"
shows "Abs_finfun x = Abs_finfun y \<longleftrightarrow> x = y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (Abs_finfun x = Abs_finfun y) = (x = y)
[PROOF STEP]
proof
[PROOF STATE]
proof (st... | {"llama_tokens": 845, "file": "FinFun_FinFun", "length": 10} |
import numpy as np
from stixcore.calibration.livetime import get_livetime_fraction
def test_get_livetime():
eta = 2.5e-6
tau = 12.5e-6
ph_in = np.arange(1000) * 1e3
# Simulate normal trigger process
trig1 = ph_in / (1 + ph_in * (tau + eta))
# Two photon contribution
trig2 = trig1 * np.ex... | {"hexsha": "2743bc3ecf005f34699bf69dc78c1b6c1ec6fed2", "size": 592, "ext": "py", "lang": "Python", "max_stars_repo_path": "stixcore/calibration/tests/test_livetime.py", "max_stars_repo_name": "nicHoch/STIXCore", "max_stars_repo_head_hexsha": "16822bbb37046f8e6c03be51909cfc91e9822cf7", "max_stars_repo_licenses": ["BSD-3... |
from flask import Flask
import flask_restful as restful
from flask_restful import reqparse
import requests
import pymongo
import redis
import os
import numpy as np
import pandas as pd
PRIVATE_PATH='../../../favor-movie-private/'
POOL = redis.ConnectionPool(host='127.0.0.1', port=6379, max_connections=100)
client_redi... | {"hexsha": "467a95ad396b98ab79ad9d0984cd5a782845531f", "size": 4706, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/server/server.py", "max_stars_repo_name": "aierwiki/favor-movies-public", "max_stars_repo_head_hexsha": "7254054c690e2674a3ddf4da5261e5275e7cf6df", "max_stars_repo_licenses": ["MIT"], "max_st... |
subroutine AsIq (y, x, shp,
& shgl, ien, xmudmi,
& qres, rmass )
c
c----------------------------------------------------------------------
c
c This routine computes and assembles the data corresponding to the
c interior elements for the glob... | {"hexsha": "087ab2411d6185663a3c5378b72e7b93a9b37de5", "size": 4143, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "phSolver/incompressible/asiq.f", "max_stars_repo_name": "yangf4/phasta", "max_stars_repo_head_hexsha": "a096094f33b98047de0a2e28225c4d74875a88d8", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
import numpy as np
from gym import spaces
class EpsilonWrapper(object):
def __init__(self, env, attrs=('distance_threshold', 'rotation_threshold'), compute_reward_with_internal=None):
"""Attrs is list of attributes (strings like "distance_threshold"). Only valid ones are used. """
self.env = env
... | {"hexsha": "735a53f1725193e9e78b173884704ecfa3bddb17", "size": 5895, "ext": "py", "lang": "Python", "max_stars_repo_path": "envs/customfetch/epsilon_wrapper.py", "max_stars_repo_name": "vincentlui/megae", "max_stars_repo_head_hexsha": "16b8d29377e3180447b03cb8f5120e9e086ad56d", "max_stars_repo_licenses": ["MIT"], "max_... |
from DEICODE import untangle
import sys
import pandas as pd
import numpy as np
import argparse
import os
'''
This file does three main things:
1. Filters entries with fewer than the specified number of non-zero entries
for each OTU.
2. Normalizes the data to account for sequencing bias.
3. Performs ... | {"hexsha": "90a5c57f1c10b96eb1e822cb08fe76a50357b10d", "size": 2796, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_preprocessing/filtering_normalization_completion.py", "max_stars_repo_name": "michaelwiest/microbiome_rnn", "max_stars_repo_head_hexsha": "6109da20c49e3027f746257aee90cadc423cc75b", "max_star... |
# -*- coding: utf-8 -*-
import ply.lex as lex
import ply.yacc as yacc
import re
import numpy
# This is a Lexer and Parser for LAS 1.2/2.0 files header
las_info = {}
gmnem_base = None
las_info['version'] = {}
las_info['well'] = {}
las_info['parameters'] = {}
las_info['logs'] = {}
las_info['curves... | {"hexsha": "1cdf48f5d730db4a27ca23ed9e8c2abd9a05bedf", "size": 4951, "ext": "py", "lang": "Python", "max_stars_repo_path": "pylasdev/las_lex_pars2.py", "max_stars_repo_name": "paceholder/pylasdev", "max_stars_repo_head_hexsha": "d63701d02d3a5f59de7f3ff33804d2f421f49402", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
import numpy as np
import argparse
from tensorflow.keras.layers import (
Input,
Flatten,
Dense,
Reshape,
Dropout,
Embedding,
Multiply,
Activation,
Conv2D,
ZeroPadding2D,
LocallyConnected2D,
Concatenate,
GRU,
Lambda,
)
from tensorflow.keras.layers import BatchNorm... | {"hexsha": "33758ef39c6b0f785f547ca8db3b062286fb2fd5", "size": 5162, "ext": "py", "lang": "Python", "max_stars_repo_path": "event_generation/INFERENCE_IPU_lagans.py", "max_stars_repo_name": "altanner/IPU4HEP", "max_stars_repo_head_hexsha": "264b86c57f7af9cada5761a5a2bbdb3d3ba1b902", "max_stars_repo_licenses": ["MIT"], ... |
[STATEMENT]
lemma all_acquired_append: "all_acquired (xs@ys) = all_acquired xs \<union> all_acquired ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. all_acquired (xs @ ys) = all_acquired xs \<union> all_acquired ys
[PROOF STEP]
apply (induct xs)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
1. all_acquired ([] ... | {"llama_tokens": 275, "file": "Store_Buffer_Reduction_ReduceStoreBuffer", "length": 3} |
Calvin Arthur Covell Jr. was born December 1, Davis Timeline/1870 1875 and served as mayor of Davis for a combined total of 16 years. CA Covell served on Davis first City Council from 4/20/1917 to 4/20/1918 and was elected mayor that same year. He was reelected in 1928, and from 19311947 47 served the citys longest ter... | {"hexsha": "0e00b88c26d96a0216076068b7c1ea50bc6cc8b0", "size": 1633, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Calvin_Arthur_Covell_Jr..f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max... |
\documentclass[12pt,letterpaper]{article}
\usepackage{fullpage}
\usepackage[top=2cm, bottom=4.5cm, left=2.5cm, right=2.5cm]{geometry}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage{hyperref}
% \usepackage{xcolor}
\usepackage[dvipsnames]{xcolor}
\usepackage{fancyhdr}
\usepackage{mathrsfs}
\usepackage{ams... | {"hexsha": "5ac2eaac4fcfe30f131f65cf74d2f24751718699", "size": 3027, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "homeworks/probability/hw16/master.tex", "max_stars_repo_name": "aipyth/notes", "max_stars_repo_head_hexsha": "59066a1110ea467b2aa43518da9295f23da89a32", "max_stars_repo_licenses": ["MIT"], "max_star... |
from collections import deque
from copy import deepcopy
from slm_lab.agent.memory.base import Memory
from slm_lab.lib import logger, math_util, util
from slm_lab.lib.decorator import lab_api
import numpy as np
import pydash as ps
logger = logger.get_logger(__name__)
class Replay(Memory):
'''
Stores agent exp... | {"hexsha": "c74166a423e8b430a38e28fb79156a136835d2f1", "size": 12123, "ext": "py", "lang": "Python", "max_stars_repo_path": "slm_lab/agent/memory/replay.py", "max_stars_repo_name": "raghu1121/SLM-Lab", "max_stars_repo_head_hexsha": "58e98b6521f581515d04ebacff5226105237ed9b", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import argparse
import os
import numpy as np
import collections
def parse_args(args) -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Make submission')
parser.add_argument(
'-i', '--input',
help='path to input file',
type=str,
required=True
)
parser.... | {"hexsha": "a700fe051085597d7dab836d575fd82e37522dc5", "size": 1574, "ext": "py", "lang": "Python", "max_stars_repo_path": "28/main.py", "max_stars_repo_name": "gosha20777/mipt-bioinfo-2021", "max_stars_repo_head_hexsha": "ed14975e9f597e7b2427bc589f12ac08d451c509", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: GPL-2.0-only
*)
theory ExampleSystemPolicyFlows
imports
Noninterference
"Access.ExampleSystem"
begin
subsection \<open>Example 1 -- similar to Sys1 in ../access-control/ExampleSystem.thy\<close>
subsubsection \<open>Definiti... | {"author": "NICTA", "repo": "l4v", "sha": "3c3514fe99082f7b6a6fb8445b8dfc592ff7f02b", "save_path": "github-repos/isabelle/NICTA-l4v", "path": "github-repos/isabelle/NICTA-l4v/l4v-3c3514fe99082f7b6a6fb8445b8dfc592ff7f02b/proof/infoflow/ExampleSystemPolicyFlows.thy"} |
import ctypes as ct
import sys
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np
import os
# Define the record header struct
class HEADER(ct.Structure):
_fields_ = [("RecordStatus", ct.c_ubyte),
("UserID", ct.c_ubyte),
("Channel", ct.... | {"hexsha": "e6937b80393b1a8b62f0935e28e27522160f1145", "size": 3712, "ext": "py", "lang": "Python", "max_stars_repo_path": "TOF/ADQAPI_python/modules/example_helpers.py", "max_stars_repo_name": "thomasbarillot/DAQ", "max_stars_repo_head_hexsha": "20126655f74194757d25380680af9429ff27784e", "max_stars_repo_licenses": ["M... |
"""
This module perform computation related to Hilber-Schmidt Independence
Criterion. Hilber-Schmidt Independence Criterion is short for HSIC.
HISC is defined as $HSIC=\frac{1}{m}Tr(KHLH)$, where $kMat$ and $lMat$
are the kernel matrices for the data and the labels respectively.
$H=I-\frac{1}{m}\delta_{ij}$, where $m$... | {"hexsha": "f056cd7fca08c814bfc937a73b2accdd7ae83b3e", "size": 5588, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/src/SEER/matching/bahsic/hsic.py", "max_stars_repo_name": "bellwethers-in-se/issueCloseTime", "max_stars_repo_head_hexsha": "e5e00c9625da0793dc8e7985fd88b0ca0b35f7d3", "max_stars_repo_licens... |
"""
Randomly select context then optimize.
"""
from argparse import Namespace
import numpy as np
from scipy.stats import norm as normal_distro
from cstrats.cts_opt import ContinuousOpt
from dragonfly.utils.option_handler import get_option_specs
from util.misc_util import sample_grid, uniform_draw, knowledge_gradient
... | {"hexsha": "4cc4ce58ea11ce053841d1cd9a032836cf44a521", "size": 2478, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/cstrats/agn_cts.py", "max_stars_repo_name": "fusion-ml/OCBO", "max_stars_repo_head_hexsha": "fb330ec4ac2ed0f6167eebd849c23fe61692c11c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 9... |
import copy
from pathlib import Path
import h5py
import numpy as np
from PySide2.QtCore import QTimer
from PySide2.QtWidgets import QFileDialog, QMessageBox
from hexrd.instrument import unwrap_dict_to_h5, unwrap_h5_to_dict
from hexrd.ui.constants import ViewType
from hexrd.ui.create_hedm_instrument import create_he... | {"hexsha": "477fa28132570515471b11498de10909159e3da5", "size": 6133, "ext": "py", "lang": "Python", "max_stars_repo_path": "hexrd/ui/calibration/picks_tree_view_dialog.py", "max_stars_repo_name": "HEXRD/hexrdgui", "max_stars_repo_head_hexsha": "d92915463f237e0521b5830655ae73bc5bcd9f80", "max_stars_repo_licenses": ["BSD... |
import unittest
import numpy as np
from scipy.spatial import distance_matrix
from tensorflow.python import keras as K
from tests.layers.simple_attention_layer import SimpleAttentionLayer
class TestAttentionOnGraph(unittest.TestCase):
def test_attention_learning(self):
exp1 = self.run_attention_learning("... | {"hexsha": "0c44c76fd60c5246a1c8892859ee0a84d0b8214d", "size": 4929, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/layers/test_attention_on_graph.py", "max_stars_repo_name": "icoxfog417/graph-convolution-nlp", "max_stars_repo_head_hexsha": "2f15da072e401528d9faf76985d05afce336798f", "max_stars_repo_licen... |
# 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": "1fb180d81698bf79112da9bae37ee8599f2744d6", "size": 21419, "ext": "py", "lang": "Python", "max_stars_repo_path": "codalab_competition_bundle/AutoDL_starting_kit/AutoDL_simple_baseline_models/3dcnn_noprepro/model.py", "max_stars_repo_name": "NehzUx/autodl", "max_stars_repo_head_hexsha": "c80fdc4b297ed1ec2b9e6... |
\documentclass[12pt]{article}
% REMOVE THIS
\usepackage[latin, english]{babel}
\usepackage{lipsum}
%% EDIT THIS: set \rightsidetrue for right side years,
%\rightsidefalse for left side
\newif\ifrightside
\rightsidetrue
% \rightsidefalse
%% EDIT THIS: to bold all mention of \citationboldauthor
\newcommand{\citatio... | {"hexsha": "7d1c83848fcb44394dd65feda0e5f7bc12bba023", "size": 4663, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "sample_two.tex", "max_stars_repo_name": "dangcpham/AcademiCV", "max_stars_repo_head_hexsha": "01d04268d89d8891d5c1675bbdbd4d1523081e47", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma... |
""" Run the myopic startegy and plot progress each time.
"""
import numpy as np
import torch
from meslas.means import LinearMean
from meslas.covariance.spatial_covariance_functions import Matern32
from meslas.covariance.cross_covariances import UniformMixing
from meslas.covariance.heterotopic import FactorCovariance
f... | {"hexsha": "5d62c67fbec38bd32b69f27c747b5a3b936cb195", "size": 3895, "ext": "py", "lang": "Python", "max_stars_repo_path": "reporting/make_animations/animate_myopic_radar_from_groundtruth.py", "max_stars_repo_name": "CedricTravelletti/MESLAS", "max_stars_repo_head_hexsha": "362c7f13c5f3d7261e7603920c22429275a4958b", "m... |
/*! \file breastMass.hxx
* \brief breastMass header file
* \author Christian G. Graff
* \version 1.0
* \date 2018
*
* \copyright To the extent possible under law, the author(s) have
* dedicated all copyright and related and neighboring rights to this
* software to the public domain worldwide. This soft... | {"hexsha": "fb3287f70ed624527763f978bdf770b0f20dabae", "size": 1365, "ext": "hxx", "lang": "C++", "max_stars_repo_path": "breastMass.hxx", "max_stars_repo_name": "DIDSR/breastMass", "max_stars_repo_head_hexsha": "65e646619086d8006fbe02efd2e115d61f7932f6", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": 4.0, ... |
# -*- coding: utf-8 -*-
# Copyright (c) 2016-2022 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import numpy as np
from numpy import complex128
from pandapower.pypower.idx_bus import VM, VA,BASE_KV
from pandapower.pyp... | {"hexsha": "86bf835cc726bfa7a0c57cb88849a1e91885d168", "size": 12219, "ext": "py", "lang": "Python", "max_stars_repo_path": "pandapower/results_gen.py", "max_stars_repo_name": "hmaschke/pandapower-1", "max_stars_repo_head_hexsha": "2e93969050d3d468ce57f73d358e97fabc6e5141", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
import os
import math as m
import numpy as np
from .list_and_dict import *
import openmc
def read_mass_lib(mass_lib_path):
mass_list = {}
with open(mass_lib_path, 'r') as atm_mass_file:
line = atm_mass_file.readlines()
for i in range(40, 3352):
if line[i][0] == ' ':
... | {"hexsha": "415ee8421137229fc8230bbdab4b762ca67c88d3", "size": 14490, "ext": "py", "lang": "Python", "max_stars_repo_path": "openbu/data/read_lib_functions.py", "max_stars_repo_name": "bam241/ONIX", "max_stars_repo_head_hexsha": "021c9da664eb4b85ede1c0993555341b87011c29", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import numpy as np
import warnings
import nept
def spike_counts(spikes, epochs, window=None):
"""Get spike counts for specific interval.
Parameters
----------
spikes : list
Containing nept.SpikeTrain for each neuron.
interval_times : nept.Epoch
window : float
When window is se... | {"hexsha": "7369358be4e71d07259bf20cdfcf9e66e45daba8", "size": 7572, "ext": "py", "lang": "Python", "max_stars_repo_path": "nept/co_occurrence.py", "max_stars_repo_name": "ssimonee/nept", "max_stars_repo_head_hexsha": "0b78d02f32adec2bc064d3f3637fd10ee5c04637", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
"""Definition for primitive take_grad_inp.
Internal primitive used to compute
gradient of primitive take wrt/ matrix input.
Inputs - the maximum number of indices n, a tensor of indices I with shape S,
and a tensor of values V with shape `(*S, r)`
Output - a matrix with shape (n, r), where each row i contains
the su... | {"hexsha": "f87795ca980cdacf06d770f10849004c5e00968f", "size": 2032, "ext": "py", "lang": "Python", "max_stars_repo_path": "myia/operations/prim_take_grad_inp.py", "max_stars_repo_name": "strint/myia", "max_stars_repo_head_hexsha": "3d00d3fb3df80ab7a264a724226c5f56c6ff1a8a", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""
plots.py
TODO:
* Create boxplots for each column
@author: Scott Campit
"""
import dash
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import dash_bootstrap_components as dbc
import plotly
import pandas as pd
import plotly.graph_objects as go
... | {"hexsha": "38cef84ba52c160da1d4fa3874e7d36a7f32b555", "size": 3563, "ext": "py", "lang": "Python", "max_stars_repo_path": "srv/python/EDA/plots.py", "max_stars_repo_name": "aaditis/egem", "max_stars_repo_head_hexsha": "89b4cbd8c623dc1826d65b55bb92527e68ebbcce", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import kMeans
import os
import sys
from numpy import *
project_path = os.path.abspath(os.path.dirname(__file__))
text_path = os.path.join(project_path, "../chapter10/testSet.txt")
datMat = mat(kMeans.loadDataSet(text_path))
print(min(datMat[:, 0]))
print(min(datMat[:, 1]))
print(max(datMat[:, 1]))
print(max(datMat[:, ... | {"hexsha": "9519d13d2bdd017e4057d20db5f8dc6d1ccdf193", "size": 407, "ext": "py", "lang": "Python", "max_stars_repo_path": "chapter10/10_1.py", "max_stars_repo_name": "kungbob/Machine_Learning_In_Action", "max_stars_repo_head_hexsha": "007db9d2a6c957d314ecd0b4322cad5b04da7113", "max_stars_repo_licenses": ["MIT"], "max_s... |
import sys,os
import numpy as np
import pandas as pd
import pyodbc
import pickle
from lung_cancer.connection_settings import get_connection_string, TABLE_GIF, TABLE_LABELS, TABLE_MODEL, TABLE_PATIENTS
import wget
import datetime
from config_preprocessing import STAGE1_LABELS, LIB_CNTK, BASE_URL
def create_table_gifs... | {"hexsha": "02931b4f2f21620cc53b127c9585cf77b37a36f3", "size": 5100, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessing/insert_other_items_in_sql_database.py", "max_stars_repo_name": "shayan-taheri/sql_python_deep_learning", "max_stars_repo_head_hexsha": "ceb2c41bcb1fed193080f64ba4da018d76166222", "ma... |
@testset "Partitioning" begin
setify(lists) = Set(Set.(lists))
d = CartesianGrid{T}(10,10)
p = partition(d, UniformPartition(100))
@test sprint(show, p) == "100 Partition{2,$T}"
@test sprint(show, MIME"text/plain"(), p) == "100 Partition{2,$T}\n └─1 View{10×10 CartesianGrid{2,$T}}\n └─1 View{10×10 Cartesia... | {"hexsha": "ab3330599c2152531c10c09eace59bd1eabb2b52", "size": 10471, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/partitioning.jl", "max_stars_repo_name": "VEZY/Meshes.jl", "max_stars_repo_head_hexsha": "2638794a4bab9e4e9544096788ec94d692626045", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
#
# Plot fitness distributions for various fitness functions
#
from pathlib import Path
import numpy as np
import matplotlib
matplotlib.use ('TKAgg', warn=False, force=True)
import matplotlib.pyplot as plt
import csv
import sys
sys.path.insert(0,'../include')
import sebcolour
col = sebcolour.Colour
from scipy import s... | {"hexsha": "5850b4152cf8681318484fcf95704b37fc6bb772", "size": 1429, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot/analysis/plot_fitness_dists.py", "max_stars_repo_name": "ABRG-Models/Wilson2018EvoGene", "max_stars_repo_head_hexsha": "cf198f162621e09f44cb96ee991ffe50cf9d96bc", "max_stars_repo_licenses": [... |
import numpy as np
from tqdm import tqdm
from abc import ABC
"""
For computationally expensive simulations or experiments it is crucial to get the most information out of every
training point. This is not the case in the standard procedure of randomly selecting the training points.
In order to get the most out of the ... | {"hexsha": "cb5d5d404ae013d121ecc753bc907180d5eaa333", "size": 8749, "ext": "py", "lang": "Python", "max_stars_repo_path": "profit/al/active_learning.py", "max_stars_repo_name": "Rykath/profit", "max_stars_repo_head_hexsha": "c71e96f93647af1a2ad659228401679b804980c1", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
module ZonalFlow
using OrdinaryDiffEq
using StochasticDiffEq
using DiffEqNoiseProcess
using DiffEqCallbacks
using RecursiveArrayTools
using FFTW
using LinearAlgebra
using Random
using Distributions
using NPZ
include("structures.jl")
include("ic.jl")
include("coeffs.jl")
include("solve.jl")
include("equations.jl")
# i... | {"hexsha": "0d908fa119907238f131b5d0c95b317436100405", "size": 645, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ZonalFlow.jl", "max_stars_repo_name": "gvn22/ZonalFlow.jl", "max_stars_repo_head_hexsha": "3ebfdd1d172f97321df13781239da28597137361", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "m... |
subroutine daxpy(n,da,dx,incx,dy,incy)
c
c constant times a vector plus a vector.
c uses unrolled loops for increments equal to one.
c jack dongarra, linpack, 3/11/78.
c
double precision dx(*), dy(*), da
integer i, incx, incy, ix, iy, m, mp1, n
c
if (n .le. 0) return
if (da .eq... | {"hexsha": "96a00e9979a0c49246afb29ebc1067f12a6b66b4", "size": 1211, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "legacy_fortran/hsl/icfs/icf/src/blas/daxpy.f", "max_stars_repo_name": "dynamics-of-stellar-systems/dynamite_release", "max_stars_repo_head_hexsha": "a921d8a1bde98f48daeea78213fb17b3edb223bb", "max... |
"""this module has functions to compute some stats about cells, such as ccmax"""
import os.path
import h5py
import numpy as np
from strflab.stats import cc_max
from tang_jcompneuro import dir_dictionary
from tang_jcompneuro.stimulus_classification import decompose_subset
from tang_jcompneuro.io import load_neural_data... | {"hexsha": "4b89befaec248753d9fa9483059cae863d5f6d37", "size": 2191, "ext": "py", "lang": "Python", "max_stars_repo_path": "tang_jcompneuro/cell_stats.py", "max_stars_repo_name": "leelabcnbc/tang_jcompneuro_revision", "max_stars_repo_head_hexsha": "58e9dbcbef7ca3f0c3976b24a4e4aa9c5efcdd3a", "max_stars_repo_licenses": [... |
from __future__ import print_function, absolute_import
import math
from collections import Counter, defaultdict
import numpy as np
from scipy.stats import binom, norm
from pandas import DataFrame
import sys
import random
from itertools import islice
from scipy.misc import comb
from . import GeminiQuery
def burden_b... | {"hexsha": "7f8949f7541221244d56feb42a60582411c5894e", "size": 9990, "ext": "py", "lang": "Python", "max_stars_repo_path": "gemini/tool_burden_tests.py", "max_stars_repo_name": "bgruening/gemini", "max_stars_repo_head_hexsha": "d393bf3d76a6ff91f711525cb00b6954d2193651", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from utilities.data_io import get_top_left_corner_coordinates_for_image
def visualize_bathy_xyz(lng, lat, z, title=None, show=True, vmax=50):
plt.figure(figsize=(8, 5))
plt.rcParams.update({'font.size':... | {"hexsha": "349d5de5f94fea88884bfab13c6a481b04bcd9f8", "size": 2576, "ext": "py", "lang": "Python", "max_stars_repo_path": "utilities/visualization.py", "max_stars_repo_name": "mahmoud-al-najar/DSPEB", "max_stars_repo_head_hexsha": "9eecb7d9bdef4ba2c3ec72a25fe6a159ecc75105", "max_stars_repo_licenses": ["Apache-2.0"], "... |
import os
import subprocess
from functools import partial
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Optional
import gemmi
import mrcfile
import numpy as np
import zarr
from dask import delayed, array as da
from dask.distributed import fire_and_forget, Client
from .data_model ... | {"hexsha": "cf8ec4dc12937d8239a8125fcea138af50d09760", "size": 5140, "ext": "py", "lang": "Python", "max_stars_repo_path": "spsim/simulation_functions.py", "max_stars_repo_name": "JatGreer/spsim", "max_stars_repo_head_hexsha": "5e33292e23a90c8fa6a0e85f47b35f8d7156bd0f", "max_stars_repo_licenses": ["BSD-3-Clause"], "max... |
\subsection{Purpose}
\hspace{\parindent}The purpose of this document is to serve as a Requirement Analysis and Specification Document (RASD) for the development of the CLup - Customer Line-up application.
It will clearly introduce the problem at hand, propose an adequate solution and explain it in detail. It will do s... | {"hexsha": "b54d3a318e8ca823f4550200413b52dd08ac34ca", "size": 12725, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Our_Latex/Files/introduction.tex", "max_stars_repo_name": "robertodavinci/Software_Engineering_2_Project_Medvedec_Sikora", "max_stars_repo_head_hexsha": "9385d689f30065e578cadb02ffd9ba24f258b51f", ... |
import pandas as pd
import numpy as np
import scipy.io
import bnpy
def read_list_of_str_from_mat_struct(struct_var):
return np.asarray([str(np.squeeze(s)) for s in np.squeeze(struct_var)], dtype='str')
if __name__ == '__main__':
Q = scipy.io.loadmat('/Users/mhughes/git/mocap6dataset/mocap6.mat')
file... | {"hexsha": "a008e55d73caaaa3bc72b9de0155abfb1afd5634", "size": 3276, "ext": "py", "lang": "Python", "max_stars_repo_path": "bnpy/datasets/mocap6/make_mocap6_dataset.py", "max_stars_repo_name": "raphael-group/bnpy", "max_stars_repo_head_hexsha": "b11dc6f5689b06fc967bab6dffe7e01551d84667", "max_stars_repo_licenses": ["BS... |
import matplotlib.pyplot as plt
import numpy as np
from numpy import max as maxium
from numpy import sum as summary
from numpy import arange, exp, ones_like, vstack
def softmax(x):
"""Compute softmax values for each sets of scores in x."""
exp_x = exp(x - maxium(x))
return exp_x / summary(exp_x, axis = 0)... | {"hexsha": "afb76e65efd7304fcac128ef2d5c3da1da25202d", "size": 508, "ext": "py", "lang": "Python", "max_stars_repo_path": "machine_learning/softmax.py", "max_stars_repo_name": "XinyueZ/some-python-codes", "max_stars_repo_head_hexsha": "2d7296a4deebb0cd086be34ad7d66f5042cdf6e6", "max_stars_repo_licenses": ["Unlicense"],... |
#!/usr/bin/env python
import rospy
import numpy as np
from sensor_msgs.msg import Image
from std_msgs.msg import String
import math
import tf
import sys
from localization.msg import Marker
from tf import transformations as t
class TF_marker_publisher():
def __init__(self):
rospy.init_node("TF_marker_publ... | {"hexsha": "f74853fbea4c1606929b10df6a0c750543284611", "size": 4039, "ext": "py", "lang": "Python", "max_stars_repo_path": "temp/src/TF_publisher.py", "max_stars_repo_name": "wvu-irl/smart-2", "max_stars_repo_head_hexsha": "b39b6d477b5259b3bf0d96180a154ee1dafae0ac", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
from scipy.ndimage.interpolation import map_coordinates
from .reslice import reslice3d
from .utils import convert_translation_to_homogeneous
def rotate3d(image, x_angle, y_angle, z_angle, pivot=None, order=1,
use_source_shape=True):
"""Rotates an 3D image around a point.
This... | {"hexsha": "55b90600106a09a35d10ed5c235cb9bed4c588a5", "size": 2975, "ext": "py", "lang": "Python", "max_stars_repo_path": "improc3d/rotate.py", "max_stars_repo_name": "shuohan/improc3d", "max_stars_repo_head_hexsha": "178b91a73a8bb2fabf73ea2a6e9562c39a8299ca", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
theory Linkrel_kauffman
imports computations
begin
lemma mat1_vert_wall_left:
assumes "is_tangle_diagram b"
shows
"rat_poly.matrix_mult (blockmat (make_vert_block (nat (domain_wall b)))) (kauff_mat b)
= (kauff_mat b)"
proof-
have "mat (2^(nat (domain_wall b))) (length (kauff_mat b)) (kauff_mat b)" ... | {"author": "prathamesh-t", "repo": "Tangle-Isabelle", "sha": "372f6b5ea473340405f0bb3f5e5502725b04e505", "save_path": "github-repos/isabelle/prathamesh-t-Tangle-Isabelle", "path": "github-repos/isabelle/prathamesh-t-Tangle-Isabelle/Tangle-Isabelle-372f6b5ea473340405f0bb3f5e5502725b04e505/Linkrel_kauffman.thy"} |
[STATEMENT]
lemma sign_lemma [simp]:
"rec_eval rec_sign [x] = (if x = 0 then 0 else 1)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. rec_eval rec_sign [x] = (if x = 0 then 0 else 1)
[PROOF STEP]
by (simp add: rec_sign_def) | {"llama_tokens": 105, "file": "Universal_Turing_Machine_Recs", "length": 1} |
import numpy as np
from mab import algs, ranked_algs
import random
class BernoulliArm:
"""
This class generates a reward value from an uniform distribution.
"""
def __init__(self, p):
"""
:param p: Probability to reward an arm.
"""
self.p = p
def draw(s... | {"hexsha": "58f7d8cd6143430d89fe941c8c85efb8cc0ea10e", "size": 7909, "ext": "py", "lang": "Python", "max_stars_repo_path": "mab/simulator.py", "max_stars_repo_name": "globocom/mabalgs", "max_stars_repo_head_hexsha": "50e520ba7461a8b7126aa308c2a6670422cc8fcf", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count"... |
[STATEMENT]
theorem select_rec_threeway_partition:
assumes "d > 0" "k < length xs"
shows "select k xs = (
let (ls, es, gs) = threeway_partition x xs;
nl = length ls; ne = length es
in
if k < nl then select k ls
else if k < nl + ne then x
e... | {"llama_tokens": 7348, "file": "Median_Of_Medians_Selection_Median_Of_Medians_Selection", "length": 62} |
# Copyright (c) 2021 Graphcore Ltd. 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 l... | {"hexsha": "38d96a5d8d418bbdffb6bfd636c5265e0d37242b", "size": 8119, "ext": "py", "lang": "Python", "max_stars_repo_path": "applications/tensorflow2/unet/unet.py", "max_stars_repo_name": "gglin001/ipu_examples", "max_stars_repo_head_hexsha": "03e95d47120433f8ec01371e5c79c060fa7c0b45", "max_stars_repo_licenses": ["MIT"]... |
# coding=utf-8
# Adapted from Ravens - Transporter Networks, Zeng et al., 2021
# https://github.com/google-research/ravens
"""Ravens main training script."""
import os
import numpy as np
import pickle
from absl import app, flags
from ravens_torch import agents, tasks
from ravens_torch.environments.environment import ... | {"hexsha": "75a022ad681b1572480d8c907f5c8134ab2e70e0", "size": 4238, "ext": "py", "lang": "Python", "max_stars_repo_path": "ravens_torch/test.py", "max_stars_repo_name": "jlandais/recvis", "max_stars_repo_head_hexsha": "da5edea491557061dd324aed7c55649a31e1da47", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
! ------------------------------ BEGIN ZEROPAD --------------------
subroutine ZEROPAD (Y,NIN,NPW2)
c Pads time-series array Y with (NPW2-NIN) zeroes.
* With this program
c the window of the data, which determines NIN, can be different
c for different time series, yet the overall length of
c the tim... | {"hexsha": "ae32e3980f865da9deeb396d46bb38aaaa102c66", "size": 910, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "bbp/src/usgs/fas/zeropad.for", "max_stars_repo_name": "ZhangHCFJEA/bbp", "max_stars_repo_head_hexsha": "33bd999cf8d719c49f9a904872c62f02eb5850d1", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
import scipy.stats as ss
import numpy as np
def read_data(path):
file = open(path)
lines = file.readlines()
file.close()
dic = {}
for line in lines[1:]:
sl = line.split(',')
pid = int(sl[0].split('_')[0])
data_len = float(sl[1])
dic[pid] = data_len
return dic
def main():
no_data = read_... | {"hexsha": "93673f07408b935a34d807f97d18cdf4686d2dcf", "size": 7006, "ext": "py", "lang": "Python", "max_stars_repo_path": "BCI/BCI/test.py", "max_stars_repo_name": "RichardLeeK/BCI", "max_stars_repo_head_hexsha": "8bbbf03cd5f958a9eff73d18b8c9c8923acdd7b5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
Predict Method for Testing
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import math
import os
import random
import sys
import time
import codecs
import numpy as np
from six.moves import xrange
import tens... | {"hexsha": "b5a654ab80a47bdad54a12e849ff6e6a7609f891", "size": 8523, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepnlp/textsum/predict_attn.py", "max_stars_repo_name": "zzbjpc/deepnlp", "max_stars_repo_head_hexsha": "9a5717e1c7dca3247af1c9e5ca221f374cf95220", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# For exporting the model:
import torch.onnx
import onnx
import onnxruntime
import os
import gym
import gym_schafkopf
import numpy as np
def test_onnx(path, state, env):
ort_session = onnxruntime.InferenceSession(path)
ort_inputs = {ort_session.get_inputs()[0].name: np.asarray(state, dtype=np.float32)}
or... | {"hexsha": "b0223f724a4b326b4579f5e11e4868b50c807731", "size": 1712, "ext": "py", "lang": "Python", "max_stars_repo_path": "01_Tutorials/07_AnalyseModel/train.py", "max_stars_repo_name": "CesMak/gym_schafkopf", "max_stars_repo_head_hexsha": "aa2b49ef264adefdea443ed57464653658e35fdf", "max_stars_repo_licenses": ["BSD-3-... |
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.utils.data as Data
import torchvision
import matplotlib.pyplot as plt
import numpy as np
import gym
env = gym.make("CartPole-v0")
N_S = env.observation_space.shape[0]
N_A = env.action_space.n
GAMMA = 0.... | {"hexsha": "3aa250cbbcef65319a1e2834fb6e3897628a539f", "size": 3254, "ext": "py", "lang": "Python", "max_stars_repo_path": "ac_discrete.py", "max_stars_repo_name": "RocksonZeta/ac", "max_stars_repo_head_hexsha": "050a5cd176864cc2e1f7c376045c3342a7f93221", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
"""
Tests for functionality checks in class SolveDiffusion2D
"""
import numpy as np
import pytest
from diffusion2d import SolveDiffusion2D
def test_initialize_physical_parameters():
"""
Checks function SolveDiffusion2D.initialize_domain
"""
solver = SolveDiffusion2D()
w = 12.
h = 20.
dx = ... | {"hexsha": "dc2b95a1ed74f067ddab7fdaa6b84c50cdd22420", "size": 1301, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/integration/test_diffusion2d.py", "max_stars_repo_name": "constracktor/testing-python-exercise", "max_stars_repo_head_hexsha": "70b15a9d8e193fc518e46996cbc3e9f52cb1336d", "max_stars_repo_lic... |
/*
File: AE.r
Contains: Master include for AE private framework
Copyright: � 1999-2008 by Apple Computer, Inc., all rights reserved.
Bugs?: For bug reports, consult the following page on
the World Wide Web:
http://developer.apple.com... | {"hexsha": "833ec0139648d2b2717cd3e1f761f7274345fcdc", "size": 779, "ext": "r", "lang": "R", "max_stars_repo_path": "contrib/depends/SDKs/MacOSX10.11.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/Headers/AE.r", "max_stars_repo_name": "Amity-Network/amity", "max_stars... |
from __future__ import division
from pandas import read_csv
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from keras.models import Sequential
from keras.layers import Dense, Dropout
import sklearn.model_selection
from sklearn.preprocessing import MinMaxScaler
from collections import Co... | {"hexsha": "5ee2e07ba9ad83c3108aea0fb94599fac57d0de8", "size": 4279, "ext": "py", "lang": "Python", "max_stars_repo_path": "CNN.py", "max_stars_repo_name": "kzbnb/xiaobai_learning_AI", "max_stars_repo_head_hexsha": "60f116d10a7ba3f0edfe921c0e2b9569f653a16f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10, "m... |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 18 15:44:54 2017
@author: Chens
"""
from http.server import BaseHTTPRequestHandler, HTTPServer, SimpleHTTPRequestHandler
import json
from ocr import OCRNeuralNetwork
import numpy as np
import random
#服务器端配置
HOST_NAME = 'localhost'
PORT_NUMBER = 8000
#这个值是通过运行神经网络设计脚本得到... | {"hexsha": "3c5f4c3fae1c5f13201176f40b55f6158b75f5fb", "size": 2148, "ext": "py", "lang": "Python", "max_stars_repo_path": "server.py", "max_stars_repo_name": "ChenSunMac/neural-network-identification-hand-writing-number", "max_stars_repo_head_hexsha": "7583ce933cf302d165f774eb783f689561081573", "max_stars_repo_license... |
#! /usr/bin/env python3
# Robot Planning Python Library (RPPL)
# Copyright (c) 2021 Alexander J. LaValle. All rights reserved.
# This software is distributed under the simplified BSD license.
from networkx.classes.function import get_node_attributes, set_node_attributes
import pygame, time
from pygame.locals ... | {"hexsha": "5332571d1f65b4f2f9958bb1ffec32f294c6cd8f", "size": 7502, "ext": "py", "lang": "Python", "max_stars_repo_path": "valit_grids.py", "max_stars_repo_name": "alexanderjlavalle/RPPL", "max_stars_repo_head_hexsha": "6e891b55c6d9aaace426c54173654c448d7d5ee9", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.