text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
struct CoNLL{S}
filepaths::Vector{S}
year::Int
trainpath::String
testpath::String
devpath::String
end
function CoNLL(dirpath, year=2003)
@assert(isdir(dirpath), dirpath)
files = Dict()
if year == 2003
inner_files = readdir(dirpath)
if "train.txt" ∈ inner_files
... | {"hexsha": "3e0cb29f0a3cb29dd1264253cbb48ff75205868f", "size": 2560, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/CoNLL.jl", "max_stars_repo_name": "AdarshKumar712/CorpusLoaders.jl", "max_stars_repo_head_hexsha": "379ff7bf902a1d8e48153f3da53eb811afda00ac", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
from multiprocessing import Process
import argparse, time, math
import numpy as np
import os
os.environ['OMP_NUM_THREADS'] = '16'
import mxnet as mx
from mxnet import gluon
import dgl
from dgl import DGLGraph
from dgl.data import register_data_args, load_data
from gcn_ns_sc import gcn_ns_train
from gcn_cv_sc import gcn... | {"hexsha": "872506f5a02937446fb4534f2432b8b7773cf336", "size": 3445, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/mxnet/_deprecated/sampling/multi_process_train.py", "max_stars_repo_name": "ketyi/dgl", "max_stars_repo_head_hexsha": "a1b859c29b63a673c148d13231a49504740e0e01", "max_stars_repo_licenses"... |
# (C) Copyright IBM Corp. 2016
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | {"hexsha": "b8df261eb839b994ff309a3625128853647b1e73", "size": 7955, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/tests/vector_regression_test.py", "max_stars_repo_name": "ibm-research-tokyo/dybm", "max_stars_repo_head_hexsha": "a6d308c896c2f66680ee9c5d05a3d7826cc27c64", "max_stars_repo_licenses": ["Apach... |
import numpy as np
import codecs
import json
import sys
import math
import scipy
from scipy.spatial.distance import cdist, pdist, squareform
from scipy.linalg import eigh
from sklearn.cluster import KMeans
def load_json_files(file_path):
'''
Loads data from a json file
Inputs:
file_path the pat... | {"hexsha": "7e923f6bf1d7878b67a6c498de747a8dda4251be", "size": 10449, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/test_functions2.py", "max_stars_repo_name": "flynn-chen/forest-fire-clustering", "max_stars_repo_head_hexsha": "98437a80d37e6ab842d1dae18feba1487e2eb0eb", "max_stars_repo_licenses": ["MI... |
# This is a anti-pattern to disable warnings
# I'm using just for a simplification
import warnings
warnings.filterwarnings("ignore")
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
import pyLDAvis.sklearn
import re
import seaborn as sns
import spacy
import string
from collections impor... | {"hexsha": "a0335bcba503053fcfd2f770cafedc1561713e91", "size": 8172, "ext": "py", "lang": "Python", "max_stars_repo_path": "eu_ai.py", "max_stars_repo_name": "fclesio/european-union-ai", "max_stars_repo_head_hexsha": "efea836ac584d25d515d88ab96af0708aeaf9a87", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null... |
import copy
import os
import math
import numpy as np
import random
class Node(object):
def __init__(self, idx, x, y, load, minTime, maxTime):
super(Node, self).__init__()
self.idx = idx
self.x = x
self.y = y
self.load = load
self.minTime = minTime
... | {"hexsha": "bcfbd567ed08786b87b9a99550d434769f5476b2", "size": 22876, "ext": "py", "lang": "Python", "max_stars_repo_path": "Meta-heuristic project/Algorithm Codes/Project 3 - GA- V01.py", "max_stars_repo_name": "nusstu-dz/IE5600-Applied-Programming-for-Industrial-Systems", "max_stars_repo_head_hexsha": "2289d9a63f49d8... |
struct Handler{P<:AbstractPath}
path::P
settings # Could be Vector or Pairs on 0.6 or 1.0 respectively
end
"""
Handler(path::Union{String, AbstractPath}; kwargs...)
Handler(bucket::String, prefix::String; kwargs...)
Handles iteratively saving JLSO file to the specified path location.
FilePath a... | {"hexsha": "f8da4cb2683edc8cd3b4c7eed31f00d5376d28b6", "size": 2771, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/handler.jl", "max_stars_repo_name": "aisopous/Checkpoints.jl", "max_stars_repo_head_hexsha": "708cde9c3e6bd4e3b25bad15a992363a54c4ae82", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
This is the implementation of CAB method
Ref: Babakhani, Pedram, and Parham Zarei. "Automatic gamma correction based on average of brightness."
Advances in Computer Science: an International Journal 4.6 (2015): 156-159.
Author: Yong Lee
E-Mail: yongli.cv@gmail.c... | {"hexsha": "b63b6f1255208b05bd474b8a8a03e9b32562f294", "size": 2645, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/methods/CAB.py", "max_stars_repo_name": "yongleex/GCME", "max_stars_repo_head_hexsha": "77227e70605069c4fbfec570621fd19efdce1da4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 6, "m... |
[STATEMENT]
lemma irreducible\<^sub>d_def_0:
fixes f :: "'a :: {comm_semiring_1,semiring_no_zero_divisors} poly"
shows "irreducible\<^sub>d f = (degree f \<noteq> 0 \<and>
(\<forall> g h. degree g \<noteq> 0 \<longrightarrow> degree h \<noteq> 0 \<longrightarrow> f \<noteq> g * h))"
[PROOF STATE]
proof (prove)
g... | {"llama_tokens": 961, "file": "Berlekamp_Zassenhaus_Poly_Mod_Finite_Field", "length": 8} |
import numpy as np
import pandas as pd
from sklearn import utils
import matplotlib
from scipy.optimize import minimize
from tflearn import DNN
from tflearn.layers.core import input_data, dropout, fully_connected
from tflearn.layers.estimator import regression, oneClassNN
import tensorflow as tf
import tflearn
import nu... | {"hexsha": "ddf2db9fe800bb24ccace6d5095a8f84c80d5f4d", "size": 11518, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/tflearn_OneClass_NN_model.py", "max_stars_repo_name": "chihyunsong/oc-nn", "max_stars_repo_head_hexsha": "f57130545f221fee67e9780d2a93ca48b9d10ba5", "max_stars_repo_licenses": ["MIT"], "ma... |
[STATEMENT]
lemma WT_fv: "P,E \<turnstile> e :: T \<Longrightarrow> fv e \<subseteq> dom E"
and "P,E \<turnstile> es [::] Ts \<Longrightarrow> fvs es \<subseteq> dom E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (P,E \<turnstile> e :: T \<Longrightarrow> fv e \<subseteq> dom E) &&& (P,E \<turnstile> es [::] Ts \... | {"llama_tokens": 1473, "file": "CoreC++_WellType", "length": 4} |
In Nyx a stochastic force field can be applied. To make sure this option is chosen correctly, we must always set \\
\noindent {\bf USE\_FORCING = TRUE} \\
\noindent in the GNUmakefile and \\
\noindent {\bf nyx.do\_forcing} = 1 \\
\noindent in the inputs file. \\
The external forcing term in the momentum equation... | {"hexsha": "5cc803eaa098218b406c3a94f059cd0ae3a23510", "size": 3207, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "UsersGuide/Forcing/NyxForcing.tex", "max_stars_repo_name": "Gosenca/axionyx_1.0", "max_stars_repo_head_hexsha": "7e2a723e00e6287717d6d81b23db32bcf6c3521a", "max_stars_repo_licenses": ["BSD-3-Clause-... |
/** \file gameengine/Expressions/InputParser.cpp
* \ingroup expressions
*/
// Parser.cpp: implementation of the CParser class.
/*
* Copyright (c) 1996-2000 Erwin Coumans <coockie@acm.org>
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby gran... | {"hexsha": "d710a904bfccea803621a7dfb94104da50436eeb", "size": 15962, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "source/gameengine/Expressions/intern/InputParser.cpp", "max_stars_repo_name": "aseer95/upbge", "max_stars_repo_head_hexsha": "f99d5f781f3c2cded0c7fc8ef387908fd35af505", "max_stars_repo_licenses": [... |
"""Stanford Question Answering Dataset (SQuAD).
Includes MLM and QA tasks.
Author:
Jeffrey Shen
"""
import torch
import torch.utils.data as data
import numpy as np
import random
class MLM(data.IterableDataset):
"""
Each item in the dataset is a tuple with the following entries (in order):
- x: Ma... | {"hexsha": "e5e24f4df3a53974dd8e6ebe3b0c32217edbd205", "size": 13014, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/bpe_squad.py", "max_stars_repo_name": "jeffdshen/squad", "max_stars_repo_head_hexsha": "61ed2120fc06f5e33204200ac0f8d86d1da6f361", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
-- Interseccion_con_su_union.lean
-- Intersección con su unión.lean
-- José A. Alonso Jiménez
-- Sevilla, 26 de abril de 2022
-- ---------------------------------------------------------------------
-- ---------------------------------------------------------------------
-- Demostrar que
-- s ∩ (s ∪ t) = s
-- -----... | {"author": "jaalonso", "repo": "Razonando-con-Lean", "sha": "d6e3fe9e384bdb6d8cc6ce4383d86c72bbcc154c", "save_path": "github-repos/lean/jaalonso-Razonando-con-Lean", "path": "github-repos/lean/jaalonso-Razonando-con-Lean/Razonando-con-Lean-d6e3fe9e384bdb6d8cc6ce4383d86c72bbcc154c/src/Interseccion_con_su_union.lean"} |
[STATEMENT]
lemma top_finfun_apply [simp]: "($) top = (\<lambda>_. top)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. ($) top = (\<lambda>_. top)
[PROOF STEP]
by(auto simp add: top_finfun_def) | {"llama_tokens": 82, "file": "FinFun_FinFunPred", "length": 1} |
[STATEMENT]
theorem TBtheorem4a_notP2:
assumes "\<not> ine Q E"
and "subcomponents PQ = {P,Q}"
and "correctCompositionIn PQ"
and "ine_exprChannelSet P ChSet E"
and "\<forall> (x ::chanID). ((x \<in> ChSet) \<longrightarrow> (x \<in> (loc PQ)))"
shows "\<not> ine PQ E"
[PROOF STATE]
proo... | {"llama_tokens": 293, "file": "CryptoBasedCompositionalProperties_Secrecy", "length": 2} |
# Authors: Hugo Richard, Pierre Ablin
# License: BSD 3 clause
import numpy as np
import warnings
from scipy.linalg import expm
from .reduce_data import reduce_data
from ._permica import permica
from ._groupica import groupica
from time import time
def multiviewica(
X,
n_components=None,
dimension_reducti... | {"hexsha": "f6df7a7bc02234555917b783e359e868a1657c8e", "size": 9841, "ext": "py", "lang": "Python", "max_stars_repo_path": "multiviewica/_multiviewica.py", "max_stars_repo_name": "hugorichard/multiviewica", "max_stars_repo_head_hexsha": "54405b6adf66c9aec1f40dda2ef9c355aadec8f9", "max_stars_repo_licenses": ["BSD-3-Clau... |
from PIL import Image
from torchvision import transforms
from torchvision.datasets import CIFAR10, Omniglot
# +
import cv2
import numpy as np
from torchvision.datasets.utils import check_integrity, list_dir, list_files
from os.path import join
# -
# np.random.seed(0)
class GaussianBlur(object):
# Implements G... | {"hexsha": "22db97ea2b82d2f49183e4569931a0da0db0aff6", "size": 14551, "ext": "py", "lang": "Python", "max_stars_repo_path": "Omniglot/utils.py", "max_stars_repo_name": "yaohungt/Demystifying_Self_Supervised_Learning", "max_stars_repo_head_hexsha": "e3de6b90b22215742c6515ef676e193c95234b04", "max_stars_repo_licenses": [... |
from styx_msgs.msg import TrafficLight
import rospy
import numpy as np
class TLClassifier(object):
def __init__(self):
#TODO load classifier
pass
def get_classification(self, image):
"""Determines the color of the traffic light in the image
Args:
image (cv::Mat): i... | {"hexsha": "0368d260bb9437957bbd27e9dc9fb79f72e02346", "size": 1395, "ext": "py", "lang": "Python", "max_stars_repo_path": "ros/src/tl_detector/light_classification/tl_classifier.py", "max_stars_repo_name": "OctopusNO1/CarND-Capstone-master", "max_stars_repo_head_hexsha": "39f153cb0bf09bfda0a455864bd5a61c6a45501a", "ma... |
#!/usr/bin/env python2
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Client to control DUT hardware connected to servo debug board
"""
import collections
import logging
import optparse
import pk... | {"hexsha": "9f2311a2ea0cfb59dce51213e7f39aea8869b020", "size": 12436, "ext": "py", "lang": "Python", "max_stars_repo_path": "servo/dut_control.py", "max_stars_repo_name": "mmind/servo-hdctools", "max_stars_repo_head_hexsha": "c7d50190837497dafc45f6efe18bf01d6e70cfd2", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
import random
import threading
import numpy as np
import sqlite3
import pickle
from contextlib import closing
from blist import sortedlist
import time
from rl import AsyncMethodExecutor
class DataPacket(object):
def __init__(self):
self.data = None
class ExperienceReplay(object):
def __init__(
... | {"hexsha": "4c5c8bea2c5fb1defc81544842801b61a2687f8b", "size": 5956, "ext": "py", "lang": "Python", "max_stars_repo_path": "rl/ExperienceReplay.py", "max_stars_repo_name": "valiro21/MarioLearningCompany", "max_stars_repo_head_hexsha": "a8ffdafa70d735e609296b13b0aa9950f73cfb07", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma sees_fields_fun:
"(Cs,T) \<in> FieldDecls P C F \<Longrightarrow> (Cs,T') \<in> FieldDecls P C F \<Longrightarrow> T = T'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>(Cs, T) \<in> FieldDecls P C F; (Cs, T') \<in> FieldDecls P C F\<rbrakk> \<Longrightarrow> T = T'
[PROOF STEP]
by(fast... | {"llama_tokens": 146, "file": "CoreC++_SubObj", "length": 1} |
'''
A Shallow Constrained RGB Autoencoder
Some utility methods...
'''
import numpy as N
import tensorflow as tf
'''
Force matplotlib to not use any Xwindows backend.
see: http://stackoverflow.com/questions/29217543/why-does-this-solve-the-no-display-environment-issue-with-matplotlib
'''
import matplotlib
matplotlib.use... | {"hexsha": "8ede7f04703f48ddace8e7bf9a59e9b6fbe26202", "size": 4558, "ext": "py", "lang": "Python", "max_stars_repo_path": "scae/__init__.py", "max_stars_repo_name": "dvpc/rgb-autoenc-tf", "max_stars_repo_head_hexsha": "ec06d89d8d5e69bc51fc51a6c43161ecff7c4e65", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
(* Specific program we care about *)
Require Import dumb_oeuf. (* Oeuf program in cminor *)
Require Import dumb_cm. (* Linked program in cminor *)
Require Import Dumb. (* Original Oeuf program *)
Require Import dumb_axioms. (* necessary axioms for proof *)
Require Import compcert.common.Globalenvs.
Require Import comp... | {"author": "uwplse", "repo": "oeuf", "sha": "f3e4d236465ba872d1f1b8229548fa0edf8f7a3f", "save_path": "github-repos/coq/uwplse-oeuf", "path": "github-repos/coq/uwplse-oeuf/oeuf-f3e4d236465ba872d1f1b8229548fa0edf8f7a3f/shim_verif/dumb_proof.v"} |
import os
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import colors as _colors
from scipy import interpolate
import figlatex
import hist2d
import colormap
command = '-m 100000 -L 1 -t -l 500 darksidehd/nuvhd_lf_3x_tile57_77K_64V_6VoV_1.wav'
###########################
def naivelinear(co... | {"hexsha": "da2822117d0ae55d114714cf4a436a71e53ef5c7", "size": 1223, "ext": "py", "lang": "Python", "max_stars_repo_path": "figthesis/fighist2dtile57-cmap.py", "max_stars_repo_name": "Gattocrucco/sipmfilter", "max_stars_repo_head_hexsha": "74215d6c53b998808fc6c677b46030234d996bdf", "max_stars_repo_licenses": ["CC-BY-4.... |
import h5py
import numpy as np
from PIL import Image
def rotate_image(image):
return image.rotate(-90, expand=True)
class LabeledDataset:
"""Python interface for the labeled subset of the NYU dataset.
To save memory, call the `close()` method of this class to close
the dataset file once you're done u... | {"hexsha": "5d1383696ca987e78b0fbcecb5289e6edc71955b", "size": 3190, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/nyuv2/toolbox/labeled.py", "max_stars_repo_name": "SJTU-CV-2021/Single-Image-3D-Reconstruction-Based-On-ShapeNet", "max_stars_repo_head_hexsha": "7c0f4d478c99bf51176ba1d1b883984f41aa93d5", "m... |
[STATEMENT]
lemma rel_star_contl: "X ; Y^* = (\<Union>i. X ; rel_d.power Y i)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. X ; Y\<^sup>* = (\<Union>i. X ; rel_d.power Y i)
[PROOF STEP]
by (simp add: rel_star_def relcomp_UNION_distrib) | {"llama_tokens": 109, "file": "Algebraic_VCs_AVC_KAT_VC_KAT_scratch", "length": 1} |
import numpy as np
import spacy
import collections
import time
import os
class MyInputGenerator(object):
def __init__(self, dirname, vocab, seq_length, sequences_step, num_epochs, batch_size=1) :
self.dirname = dirname
self.batch_size = batch_size
self.num_epochs = num_epochs
self.vocab = vocab
self.voca... | {"hexsha": "60f2da8ab77903e1a4709d1f4ee06b53748d4de8", "size": 2545, "ext": "py", "lang": "Python", "max_stars_repo_path": "Scripts/Generator.py", "max_stars_repo_name": "saadmoumad/DiscoursDeRoi", "max_stars_repo_head_hexsha": "5c6f0d4b48fdc347c0f6766ad7d1dc2c3b104b49", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import statsmodels.stats.multitest as smm
import pickle
import matplotlib.pyplot as plt
import seaborn
import numpy as np
alphas = [0.01,0.0001,0.000001]
sizes = [128,256,512,1024,2048,4096]
aggregations = ['mean','median']
GTEx_directory = '/hps/nobackup/research/stegle/users/willj/GTEx'
[most_expressed_transcript_i... | {"hexsha": "3388ef653dcd33c0764d4a30e6b9f5964a99ae76", "size": 5230, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/figures/associations/association_graphs.py", "max_stars_repo_name": "willgdjones/GTEx", "max_stars_repo_head_hexsha": "c56a5d548978545ab8a98e74236d52343113e9e6", "max_stars_repo_licenses": ["M... |
//==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
@copyright 2016 J.T. Lapreste
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
... | {"hexsha": "4681258b9ec890a56185b962664e09129e2a381b", "size": 1414, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/boost/simd/function/signnz.hpp", "max_stars_repo_name": "yaeldarmon/boost.simd", "max_stars_repo_head_hexsha": "561316cc54bdc6353ca78f3b6d7e9120acd11144", "max_stars_repo_licenses": ["BSL-1.... |
function disp(f)
%DISP Display a BALLFUNV to the command line.
% Copyright 2019 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.
loose = strcmp(get(0,'FormatSpacing'),'loose');
% Compact version:
if ( isempty(f) )
fprintf('empty ballfunv\n\n')
re... | {"author": "chebfun", "repo": "chebfun", "sha": "8c49396a55e46ddd57a1d108c6a8f32e37536d54", "save_path": "github-repos/MATLAB/chebfun-chebfun", "path": "github-repos/MATLAB/chebfun-chebfun/chebfun-8c49396a55e46ddd57a1d108c6a8f32e37536d54/@ballfunv/disp.m"} |
// Copyright Marek Dalewski 2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <commander/detail__type_traits/always_false.hpp>
#include <boost/test/unit_test.hpp>
BOOST_AU... | {"hexsha": "ecf396cfa66b1225536499e92b59f76807fc69de", "size": 2113, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "project/test/type_traits/always_false.cpp", "max_stars_repo_name": "daishe/commander", "max_stars_repo_head_hexsha": "0a23abcbe406e234a4242e0d508bb89d72b28e25", "max_stars_repo_licenses": ["BSL-1.0"... |
Ronny Restrepo
Portfolio
Blog
Tutorials
Contact
Lidar Birds Eye Views
March 26, 2017, 11 p.m.
Summary
Today i started working on creating birds eye view images of the LIDAR data.
Quirks of the Lidar Coordinates
One thing to keep in mind about the LIDAR data is that the axes represent different things to what a camera ... | {"hexsha": "b8d2313dc376969d2e0a51fa02295691068e4dea", "size": 8003, "ext": "py", "lang": "Python", "max_stars_repo_path": "demos/read_lidar.py", "max_stars_repo_name": "PeiliangLi/avod", "max_stars_repo_head_hexsha": "655b333d36710d665de63fa67355d973364625b5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
#%%
import pandas as pd
import numpy as np
from io import StringIO
# our simple csv file
file_path = "./3.Pandas/simple_data.csv"
#%%
# create dataframe, read_csv data
dt = pd.read_csv(file_path)
dt
#%% choose columns
dt = pd.read_csv(file_path, usecols=['Imie', 'wiek'])
print(dt.head())
#%% parse and cast dat... | {"hexsha": "a2d078dbca8bbb60f52a9a8e26d7face80889531", "size": 753, "ext": "py", "lang": "Python", "max_stars_repo_path": "3.Pandas/3.reading_files.py", "max_stars_repo_name": "ksopyla/data-visualization-intro", "max_stars_repo_head_hexsha": "d512b03c820f49108611d3076c4f2cb2cf4de94e", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
from keras.datasets import mnist
def create_gallery_probe(x, digit_indices, num_classes):
probe = []
probe_l = []
gallery = []
gallery_l = []
n = min([len(digit_indices[d]) for d in range(num_classes)])
numProbe = max(int(n*0.25),1)
for d in range(num_classes):
fo... | {"hexsha": "5cff93e743aa2a4f1149cae57819f938dae43fcd", "size": 2305, "ext": "py", "lang": "Python", "max_stars_repo_path": "MNISTHelpers.py", "max_stars_repo_name": "psiva7/MNISTTriplet", "max_stars_repo_head_hexsha": "695897b5229387a092b69b5de17dbd996ca2d899", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
from audioop import add
from numpy import mat
import tensorflow as tf
# 2차원 배열 정의
list_of_list = [[10, 20], [30, 40]]
# 텐서 변환 - constant 함수에 2차원 배열 입력
mat1 = tf.constant(list_of_list)
# 랭크 확인
print("rank:", tf.rank(mat1))
# 텐서 출력
print("mat1:", mat1)
# 1차원 벡터 정의
vec1 = tf.constant([1, 0])
vec2 = tf.constant([-1, 2... | {"hexsha": "b400fd372ef4a504ce034bf9a1333d949f9e9301", "size": 1068, "ext": "py", "lang": "Python", "max_stars_repo_path": "practice/3_basic_tensorflow/Example_Matrix.py", "max_stars_repo_name": "rabbitsun2/toy_python", "max_stars_repo_head_hexsha": "32f84b4d15b13c4daa4fa212a40e685abc0d2a5d", "max_stars_repo_licenses":... |
from __future__ import print_function, division, absolute_import
import torch
import torch.nn as nn
import torch.nn.functional as F # HACK TODO DEBUG
import numpy as np
from torchsummary import summary
try:
# relative import: when executing as a package: python -m ...
from .base_models import BaseModelAutoEnco... | {"hexsha": "22dc9878071968d70f3405762f7305146ed4b36e", "size": 7079, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/autoencoders.py", "max_stars_repo_name": "ncble/srl-zoo", "max_stars_repo_head_hexsha": "cc209a292ec19718e749e5585488c06f5650e69b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import numpy as np
from scipy import signal
from scipy import interpolate
import cv2
import wave
import math
import sys
#cvt angle to color
def val2color(radangle):
M_PI = math.pi
pi_sixtydig = M_PI / 3
angle = ((radangle / (M_PI*2))- (int)(radangle / (M_PI * 2)))*(M_PI * 2)
rgb = [0,0,0... | {"hexsha": "24eeec1f85b0a13acf30d8de0136a3d999bd711a", "size": 6635, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "cln515/AudioVisualizer", "max_stars_repo_head_hexsha": "343ea7f4150b27b1bf832fade3575af34b8a5dcf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
import torch
import numpy as np
from DDPG import DDPG
from utils import ReplayBuffer
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
class HAC:
def __init__(self, k_level, H, state_dim, action_dim, render, endgoal_thresholds,
action_bounds, action_offset, state_bounds, st... | {"hexsha": "6e0b3df556c37fcb458c145588a76ec5e45ca7ce", "size": 9350, "ext": "py", "lang": "Python", "max_stars_repo_path": "HAC.py", "max_stars_repo_name": "auliyafitri/Hierarchical-Actor-Critic-HAC-PyTorch", "max_stars_repo_head_hexsha": "470e7c392b6436375157c4dc6adc1edd3e9be63a", "max_stars_repo_licenses": ["MIT"], "... |
import numpy as np
import torch
import torchvision
import os
from .camvid import CamVid
c10_classes = np.array([
[0, 1, 2, 8, 9],
[3, 4, 5, 6, 7]
], dtype=np.int32)
def camvid_loaders(path, batch_size, num_workers, transform_train, transform_test,
use_validation, val_size, shuffle_train=True... | {"hexsha": "ec18a8771ab3b4c232d78283091e92065181ff19", "size": 7222, "ext": "py", "lang": "Python", "max_stars_repo_path": "swag/data.py", "max_stars_repo_name": "probabilisticdeeplearning/swa_gaussian", "max_stars_repo_head_hexsha": "033f2b956e98f7050793a0d8a4155feb98931a3d", "max_stars_repo_licenses": ["BSD-2-Clause"... |
[STATEMENT]
lemma ListReds2:
"P \<turnstile> \<langle>es,s,b\<rangle> [\<rightarrow>]* \<langle>es',s',b'\<rangle> \<Longrightarrow> P \<turnstile> \<langle>Val v # es,s,b\<rangle> [\<rightarrow>]* \<langle>Val v # es',s',b'\<rangle>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. P \<turnstile> \<langle>es,s,b\<r... | {"llama_tokens": 1866, "file": "JinjaDCI_J_Equivalence", "length": 10} |
[STATEMENT]
lemma usubst_ulambda [usubst]: "\<sigma> \<dagger> (\<lambda> x \<bullet> P(x)) = (\<lambda> x \<bullet> \<sigma> \<dagger> P(x))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<sigma> \<dagger> ulambda P = (\<lambda> x \<bullet> \<sigma> \<dagger> P x)
[PROOF STEP]
by (transfer, simp) | {"llama_tokens": 119, "file": "UTP_utp_utp_subst", "length": 1} |
from builtins import ord
import numpy as np
import cv2
# Создаем экземпляр класса VideoCapture(). Принимает один аргумент - это
# путь к файлу (относительный или абсолютный) или целое число (индекс
# подключенной камеры)
cap = cv2.VideoCapture(0)
while (True):
# Функция cap.read() класса VideoCapture() возвращае... | {"hexsha": "891f871c548c859878152e69a35fa787f2c005b6", "size": 1605, "ext": "py", "lang": "Python", "max_stars_repo_path": "FaceRecognition/VisionDiscovery/VisionDicover.py", "max_stars_repo_name": "Harout8/FuzzyNeuralNetwork", "max_stars_repo_head_hexsha": "7b62a2289b3b1dc83e66acb90acdee0a9037b55d", "max_stars_repo_li... |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Scipp contributors (https://github.com/scipp)
# @author Simon Heybrock
import numpy as np
import pytest
import scipp as sc
def make_dataarray(dim1='x', dim2='y', seed=None):
if seed is not None:
np.random.seed(seed)
return sc.DataArray(data... | {"hexsha": "e026a6ea56234f4e53f5d28c07a6184c6c803f21", "size": 12583, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/data_array_test.py", "max_stars_repo_name": "mlund/scipp", "max_stars_repo_head_hexsha": "26648fdcda49b21a7aacdafd58625fab7ee3403b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_... |
# # Flock model
# ```@raw html
# <video width="auto" controls autoplay loop>
# <source src="../flocking.mp4" type="video/mp4">
# </video>
# ```
# The flock model illustrates how flocking behavior can emerge when each bird follows three simple rules:
#
# * maintain a minimum distance from other birds to avoid collisio... | {"hexsha": "fa1388c1dcac2e2f8c18c262b2ad8e9c4468e643", "size": 5168, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/flock.jl", "max_stars_repo_name": "Alim-faraji/Agents.jl", "max_stars_repo_head_hexsha": "139095939bcc4efbaa84a4e58a50c04792ee6b0f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import numpy as np
import matplotlib.pyplot as plt
import argparse
def fractal_dimension(array, max_box_size=None, min_box_size=1, n_samples=20, n_offsets=0, plot=False):
"""Calculates the fractal dimension of a 3D numpy array.
Args:
array (np.ndarray): The array to calculate the fractal dimension of.... | {"hexsha": "dffcf95c2da53de7566da99cb08f2977da79ed88", "size": 4295, "ext": "py", "lang": "Python", "max_stars_repo_path": "fractal-dimension/fractal.py", "max_stars_repo_name": "bemu/diagnosis_covid19", "max_stars_repo_head_hexsha": "625954beb136caa3348edfc75de16cc4db21ee43", "max_stars_repo_licenses": ["MIT"], "max_s... |
// This file is part of libigl, a simple c++ geometry processing library.
//
// Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla Public License
// v. 2.0. If a copy of the MPL was not distributed with this file, You can
// obtain one at http://... | {"hexsha": "d414e90a113dbab52ffda6d16de9a30cbf21e089", "size": 4991, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Code/include/igl/grad.cpp", "max_stars_repo_name": "FabianRepository/SinusProject", "max_stars_repo_head_hexsha": "48d68902ccd83f08c4d208ba8e0739a8a1252338", "max_stars_repo_licenses": ["BSD-3-Claus... |
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/spawn.hpp>
#include <boost/asio/connect.hpp>
#include <boost/asio/signal_set.hpp>
#include <boost/beast/core.hpp>
#include <boost/beast/http.hpp>
#include <boost/beast/version.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/format.hpp>
#inc... | {"hexsha": "a18bf33bb226fb33a0b0685073483a9b8eb83f03", "size": 106990, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/client.cpp", "max_stars_repo_name": "mhqz/ouinet", "max_stars_repo_head_hexsha": "10f924712bdbfae03d64097f040697d4c11d7911", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
"""
The object ``climlab.solar.orbital.OrbitalTable`` is an ``xarray.Dataset``
holding orbital data (**eccentricity**, **obliquity**, and **longitude of perihelion**)
for the past 5 Myears. The data are from :cite:`Berger_1991`.
Data are read from the file ``orbit91``, which was originally obtained from
<https://www1.... | {"hexsha": "acebb9e3ad09ecf6fa2cc7fecef4288dbea934ad", "size": 1559, "ext": "py", "lang": "Python", "max_stars_repo_path": "climlab/solar/orbital/__init__.py", "max_stars_repo_name": "nfeldl/climlab", "max_stars_repo_head_hexsha": "2cabb49e2c3f54c1795f24338ef5ee44e49fc7e7", "max_stars_repo_licenses": ["BSD-3-Clause", "... |
"""
@Author: Yu Huang
@Email: yuhuang-cst@foxmail.com
"""
import os
from tqdm import tqdm
import h5py
import sys
import scipy.sparse as sp
import numpy as np
from sklearn.externals import joblib
from scipy.sparse import save_npz, load_npz, csr_matrix
import json
import pickle
import time
import logging, logging.config... | {"hexsha": "46f460120889411760cc710596be9df647fec4d9", "size": 8820, "ext": "py", "lang": "Python", "max_stars_repo_path": "aide/utils_.py", "max_stars_repo_name": "tinglabs/aide", "max_stars_repo_head_hexsha": "3aee646b219cd81214cb3681286735ff24c72d88", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": 3, ... |
#' Convert descriptives to a tidy data frame
#'
#' \code{tidy_describe_data} returns a tidy data frame of descriptive statistics created with \strong{tidystats}' \code{describe_data}.
#'
#' @param descriptives A data frame created with tidystats' \code{describe_data}.
#'
#' @examples
#' library(dplyr)
#'
#' # Calculate... | {"hexsha": "57f43bfa55c1da6c4d6703b5620f37c96952b7ef", "size": 1210, "ext": "r", "lang": "R", "max_stars_repo_path": "R/tidy_describe_data.r", "max_stars_repo_name": "WillemSleegers/tidystats-v0.3", "max_stars_repo_head_hexsha": "03b08a96c1cb4617a3c90daab3ae88d51d1f5fcc", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
\chapter{Components}
\label{sec:draw}
Some sweet pictures!
\nomenclature[aA]{$y^+$}{Length in viscous units}
...
...
...
| {"hexsha": "205f140dd979884b0f43dd79a98a797f6ca468de", "size": 124, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "appendices/fabricationPictures.tex", "max_stars_repo_name": "Biles430/Dissertation", "max_stars_repo_head_hexsha": "5594a5f3d172662b4404d5357d3a28639a0feb43", "max_stars_repo_licenses": ["CC0-1.0"], ... |
\section{How To create a simulation}
To create your own simulation, from a xml description, or a c++ file, you have to respect some rules.
The Modeler can be used to have a quick view of all the components already available in Sofa.
\subsection{Model a dynamic object}
To model a dynamic object, you have to follow that... | {"hexsha": "88c1ac580530eaefe29aedafc582ed920981f43d", "size": 6679, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/HowTo/createSimulation.tex", "max_stars_repo_name": "sofa-framework/issofa", "max_stars_repo_head_hexsha": "94855f488465bc3ed41223cbde987581dfca5389", "max_stars_repo_licenses": ["OML"], "max_st... |
import pandas as pd
import h5py
import numpy as np
from rdkit.Chem import MolFromSmiles
from rdkit.Chem.rdMolDescriptors import GetMorganFingerprintAsBitVect
def smiles2ecfp(smiles, radius=4, bits=2048):
mol = MolFromSmiles(smiles)
if mol is None:
return ""
fp = GetMorganFingerprintAsBitVect(mol, ... | {"hexsha": "dc96bcb4bdb8420de0c9e05cce8069456142391d", "size": 1458, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/data_preprocessing/chembl24.py", "max_stars_repo_name": "XieResearchGroup/PLANS", "max_stars_repo_head_hexsha": "479e97f5944dcc036d5f4204890a371ebafb394a", "max_stars_repo_licenses": ["MIT"], ... |
using PyPlot
using Statistics
include("../../../src/extract_planet.jl")
include("../../../src/laplace_wisdom.jl")
function chop_coeff_inner(alpha,j)
# Computes f_1^(j) from equation (10) in Deck & Agol (2015).
beta = j*(1-alpha^1.5)
# Equation (11) in Deck & Agol (2015):
f1 = 2*beta*laplace_wisdom(1//2,j,1,alpha)+
... | {"hexsha": "c4e00f5bb6ae3da4f9c9e04adb144085e733b677", "size": 5762, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "tex/figures/julia/plot_ttv_diff.jl", "max_stars_repo_name": "educrot/TRAPPIST1_Spitzer", "max_stars_repo_head_hexsha": "850ca965c3c8a794519ce9f73a117d08039c3de6", "max_stars_repo_licenses": ["MIT"]... |
import numpy as np
import math
import cv2
import os
import json
# from scipy.special import expit
# from utils.box import BoundBox, box_iou, prob_compare
# from utils.box import prob_compare2, box_intersection
from ...utils.box import BoundBox
from ...cython_utils.cy_yolo2_findboxes import box_constructor
# from .sort... | {"hexsha": "9aa9e155e7b22087ecc7586e9e697c2272c5f795", "size": 6277, "ext": "py", "lang": "Python", "max_stars_repo_path": "sort/predict.py", "max_stars_repo_name": "srnthsrdhrn/VehicleTrackingGUI", "max_stars_repo_head_hexsha": "a18d890176de7547d557dfe7cc18dd37afa37411", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import BlockArrays: BlockIndex, BlockIndexRange, globalrange, nblocks, global2blockindex, blockindex2global
@testset "Blocks" begin
@test Int(Block(2)) === Integer(Block(2)) === Number(Block(2)) === 2
@test Block((Block(3), Block(4))) === Block(3,4)
end
#=
[1,1 1,2] | [1,3 1,4 1,5]
------------------------... | {"hexsha": "9043580c4413fdc0c1249d9354fb2248a2b4760d", "size": 3126, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_blockindices.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/BlockArrays.jl-8e7c35d0-a365-5155-bbbb-fb81a777f24e", "max_stars_repo_head_hexsha": "5812573bf3ee4b5797ba631e6b7a8... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as xp
class Variable(object):
def __init__(self, data):
self.data = data
self.creator = None
self.grad = 1
def set_creator(self, gen_func):
self.creator = gen_func
def backward(self):
if self.creator is ... | {"hexsha": "eebcc70f71becb5378ead2ff0605651fa63d7e78", "size": 1814, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/exp_2.py", "max_stars_repo_name": "mitmul/1f-chainer", "max_stars_repo_head_hexsha": "f9970493214ba615f22579a234b6954267427fd8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10,... |
#!/usr/bin/env python
# PyTorch 1.8.1-CPU virtual env.
# Python 3.9.4 Windows 10
# -*- coding: utf-8 -*-
"""The script implement the classical longstaff-schwartz algorithm for pricing american options.
This script focus on the multidimensional case for rainbow option
"""
# reproducablity
seed = 3
import random
import ... | {"hexsha": "058d6d780a60a0a5f737f354c4ccd9a8083c66a9", "size": 4186, "ext": "py", "lang": "Python", "max_stars_repo_path": "generateData.py", "max_stars_repo_name": "MrPPL/FNNMC", "max_stars_repo_head_hexsha": "6ecbe8fcf802a409d9f2dcbc62c3291e182915eb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
from PIL import Image, ImageDraw, ImageFont, ImageFilter
import os
import numpy as np
import cv2
import math
import copy
from albumentations import IAAAffine, IAAPerspective
import random
angle_map = {"left": 225, "vertical": 270, "right": 315, "top": 45, "horizontal": 0, "down": 315}
def get_text_size(font, char):
... | {"hexsha": "bbe7f7f19a06f97d4afcb6c8050a54c9104957e2", "size": 50653, "ext": "py", "lang": "Python", "max_stars_repo_path": "text_image_maker.py", "max_stars_repo_name": "jireh-father/InsightFace_Pytorch", "max_stars_repo_head_hexsha": "6d635cfabe88b15e6a65d1965c48b9266d71e7ea", "max_stars_repo_licenses": ["MIT"], "max... |
""" script to generate plots for a simulation
Use: python plots.py sim_date mode
Eg: python plots.py 2015-03-06 nowcast generates plots for the
March 6, 2015 nowcast. sim_date corresponds to the date simulated.
plots are stored in a directory mode/run_dat, where run_date is the
date the simulation ... | {"hexsha": "107eae066f7ad5f42d38ddc97d38e70970a42868", "size": 5892, "ext": "py", "lang": "Python", "max_stars_repo_path": "nowcast/plots.py", "max_stars_repo_name": "SalishSeaCast/SalishSeaNowcast", "max_stars_repo_head_hexsha": "947ba6fbb8952c7ae989a3aa96614b900748f55d", "max_stars_repo_licenses": ["Apache-2.0"], "ma... |
% #############################################################################
% This is Chapter 7
% !TEX root = ../main.tex
% #############################################################################
% Change the Name of the Chapter i the following line
\fancychapter{Conclusion}
\cleardoublepage
% The following l... | {"hexsha": "2b4a3b2bd20b96c2f695774a36d29826e556466e", "size": 5451, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Chapters/Thesis-MSc-Chapter_7.tex", "max_stars_repo_name": "LexVar/thesis_latex", "max_stars_repo_head_hexsha": "fbfd42ad61e74e6cde8e198d8cabe4a4e405a598", "max_stars_repo_licenses": ["MIT"], "max_s... |
import tensorflow as tf
import numpy as np
ISHAPE = (1, 2, 3, 4)
OSHAPE = (int(np.product(ISHAPE)),)
def genWithKeras():
data = tf.keras.Input(dtype='float32', name='input', batch_size=ISHAPE[0], shape=ISHAPE[1:])
reshape = tf.keras.layers.Reshape(OSHAPE, name='reshaped')(data)
model = tf.keras.Model(inputs=[d... | {"hexsha": "4962d9f536925cea5d21a99b9e25eebab30169b2", "size": 977, "ext": "py", "lang": "Python", "max_stars_repo_path": "misc/model-builder/reshape/tflite.py", "max_stars_repo_name": "jackwish/shrub", "max_stars_repo_head_hexsha": "acd14c72269c88e3143997288efcc6f0130c4c8e", "max_stars_repo_licenses": ["Apache-2.0"], ... |
subroutine foo02
print *, "foo02"
end
subroutine bar02
print *, "bar02"
end
| {"hexsha": "67385d8b25e00aa834ab4a77c2b8a5a54b9d5a19", "size": 117, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/PIPS/validation/Preprocessor/source01.src/module02.f", "max_stars_repo_name": "DVSR1966/par4all", "max_stars_repo_head_hexsha": "86b33ca9da736e832b568c5637a2381f360f1996", "max_stars_repo_... |
# -*- coding: utf-8 -*-
import numpy as np
def format_results_table(results_table, header_names, row_names=None, operation=None, col_span=10, digits=4):
"""Build a customized text formatted table
Parameters
----------
results_table : 2d array-like, shape = [n_rows, n_cols]
Array of data to b... | {"hexsha": "0fc02aed19fd58aa769f7561499ca87734ecdbb1", "size": 4065, "ext": "py", "lang": "Python", "max_stars_repo_path": "mltoolbox/utils/format.py", "max_stars_repo_name": "eegkno/mltoolbox", "max_stars_repo_head_hexsha": "54da8854f25c724f8dd1ee2517ff95bfa54b07d4", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
""" Run MuJoCo Maze experiments.
"""
import os
from typing import Optional
import click
import numpy as np
from torch import optim
import nets
import ppimoc
import our_oc
import rainy
import vis_mjmaze
from rainy.envs import EnvExt, pybullet_parallel
from rainy.net import option_critic as oc
from rainy.net.policy... | {"hexsha": "7a4585f9b8f68adfdb354c3aeda008cb289386f9", "size": 7810, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/run_mjmaze.py", "max_stars_repo_name": "kngwyu/infomax-option-critic", "max_stars_repo_head_hexsha": "9d907c041c1d0280db9b23eb2fdf9e0033e33bf3", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
"""
The paramselect module handles automated parameter selection for linear models.
Automated Parameter Selection
End-members
Note: All magnetic parameters from literature for now.
Note: No fitting below 298 K (so neglect third law issues for now).
For each step, add one parameter at a time and compute AICc with max... | {"hexsha": "5b66d10b0e4a85984f7b5be2aa9894e96a69e42e", "size": 23680, "ext": "py", "lang": "Python", "max_stars_repo_path": "espei/paramselect.py", "max_stars_repo_name": "wahab2604/ESPEI", "max_stars_repo_head_hexsha": "70a4185ce87a125e926f88e7ef93c02276fd6e90", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3... |
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
import keras
import string
# transform the input series and window-size into a set of input/output pairs for use with our RNN model
def window_transform_series(series, window_size):
# containers fo... | {"hexsha": "4042bf0ed2c9f28f54bfff491cce0d1e7ef10bb2", "size": 2470, "ext": "py", "lang": "Python", "max_stars_repo_path": "my_answers.py", "max_stars_repo_name": "anoff/aind-rnn", "max_stars_repo_head_hexsha": "c1c4742f2bc8f30a3e71d4ca58e171a445c90340", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
import os
import pickle
import logging
import librosa
import numpy as np
import pandas as pd
from math import pi
from scipy.fftpack import fft, hilbert
from sklearn.ensemble import GradientBoostingClassifier
from .gcp_inference import get_vggish_embedding
MEAN_VGGISH_EMBEDDING = 0.63299006
VGGISH_EMBEDDING_INDEX = 33
... | {"hexsha": "826c543b08b183fe141dd3ee34d57c7624c5a2b1", "size": 6206, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/CovidClassifier/CovidClassifier.py", "max_stars_repo_name": "LukasHaas/cs329s-covid-prediction", "max_stars_repo_head_hexsha": "bd73935e1141e72f005389013ba2fa772657b53f", "max_stars_repo_licen... |
#!/usr/bin/env python
# ****************************************** Libraries to be imported ****************************************** #
from __future__ import print_function
# noinspection PyPackageRequirements
import numpy as np
import matplotlib.image as mpimg
import cv2
from glob import glob
from moviepy.edi... | {"hexsha": "05410f220bf4365df06ac5212ccaf05bda869104", "size": 13235, "ext": "py", "lang": "Python", "max_stars_repo_path": "Advanced-Lane-Lines/pipeline_test.py", "max_stars_repo_name": "YashBansod/udacity-self-driving-car", "max_stars_repo_head_hexsha": "2ea83ec4d9232adead77e2662c7593b98f67be97", "max_stars_repo_lice... |
// Copyright 2012-2016 The CRAVE developers, University of Bremen, Germany. All rights reserved.//
#include <fstream>
#include <boost/assert.hpp>
#include "../../crave/experimental/ConstrainedRandomGraph.hpp"
#include "../../crave/experimental/graph/GraphVisitor.hpp"
#include "../../crave/utils/Logging.hpp"
namespa... | {"hexsha": "4f615208d173e4ad8d122ee3b9ba90d293292536", "size": 6012, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/lib/experimental/ConstrainedRandomGraph.cpp", "max_stars_repo_name": "quadric-io/crave", "max_stars_repo_head_hexsha": "8096d8b151cbe0d2ba437657f42d8bb0e05f5436", "max_stars_repo_licenses": ["MI... |
### A Pluto.jl notebook ###
# v0.12.21
using Markdown
using InteractiveUtils
# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
lo... | {"hexsha": "893fdc1b04d69ea43f3011d888cab897cf119bb6", "size": 45217, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "tutorials/07_Visualisation.jl", "max_stars_repo_name": "sashedher/iitm-cs6741", "max_stars_repo_head_hexsha": "ff626ceda12486d5885e6cbb1ef0d3d91b2fc392", "max_stars_repo_licenses": ["Unlicense"], ... |
import torch as th
import numpy as np
from reversible2.util import np_to_var
from reversible2.gradient_penalty import gradient_penalty
from reversible2.ot_exact import ot_euclidean_loss_for_samples
from reversible2.constantmemory import clear_ctx_dicts
from reversible2.ot_exact import ot_euclidean_loss_memory_saving_fo... | {"hexsha": "b4375c538122e925038a779b26aabd9843698f80", "size": 12219, "ext": "py", "lang": "Python", "max_stars_repo_path": "reversible2/training.py", "max_stars_repo_name": "robintibor/reversible2", "max_stars_repo_head_hexsha": "e6fea33ba41c7f76ee50295329b4ef27b879a7fa", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# Licensed under an MIT style license -- see LICENSE.md
import numpy as np
import copy
__author__ = ["Charlie Hoy <charlie.hoy@ligo.org>"]
def paths_to_key(key, dictionary, current_path=None):
"""Return the path to a key stored in a nested dictionary
Parameters
----------`
key: str
the key ... | {"hexsha": "df2b9650a906aa15b3f7796ec5558117e9b171c9", "size": 8392, "ext": "py", "lang": "Python", "max_stars_repo_path": "pesummary/utils/dict.py", "max_stars_repo_name": "pesummary/pesummary", "max_stars_repo_head_hexsha": "99e3c450ecbcaf5a23564d329bdf6e0080f6f2a8", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import numpy as np
import math
from zero2ml.supervised_learning._base import BaseModel
from zero2ml.utils.evaluation_metrics import MeanSquaredError
from zero2ml.utils.data_transformations import Standardize
class LinearRegression(BaseModel):
"""
Multiple Linear Regression with input features standardization... | {"hexsha": "be05533b8bdf7ccc623ef11ab2f354ece6a63d22", "size": 3619, "ext": "py", "lang": "Python", "max_stars_repo_path": "zero2ml/supervised_learning/linear_regression.py", "max_stars_repo_name": "bekzatalish/zero2ml", "max_stars_repo_head_hexsha": "c2baa747e3a02893c58590de52f049184fb4b167", "max_stars_repo_licenses"... |
/-
Copyright (c) 2022 Joël Riou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joël Riou
-/
import category_theory.limits.shapes.regular_mono
import category_theory.limits.shapes.zero_morphisms
/-!
# Categories where inclusions into coproducts are monomorphisms
> ... | {"author": "leanprover-community", "repo": "mathlib", "sha": "5e526d18cea33550268dcbbddcb822d5cde40654", "save_path": "github-repos/lean/leanprover-community-mathlib", "path": "github-repos/lean/leanprover-community-mathlib/mathlib-5e526d18cea33550268dcbbddcb822d5cde40654/src/category_theory/limits/mono_coprod.lean"} |
[STATEMENT]
lemma par_strict_col_par_strict:
assumes "C \<noteq> E" and
"A B ParStrict C D" and
"Col C D E"
shows "A B ParStrict C E"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. A B ParStrict C E
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. A B ParStrict C E
[PROOF STEP]
have... | {"llama_tokens": 1267, "file": "IsaGeoCoq_Tarski_Neutral", "length": 14} |
#!/usr/bin/env python
"""
Random graph from given degree sequence.
Draw degree histogram with matplotlib.
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
try:
import matplotlib.pyplot as plt
import matplotlib
except:
raise
import networkx as nx
z=nx.create_degree_sequence(100,nx.utils.powerlaw_se... | {"hexsha": "9aabc154dba458cbbe4fe9dcaa5703160708eeaf", "size": 990, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/drawing/degree_histogram.py", "max_stars_repo_name": "bjedwards/NetworkX_fork", "max_stars_repo_head_hexsha": "6cb4465d73b8adc4692206fdbc8e1a3934d94fe6", "max_stars_repo_licenses": ["BSD-3... |
import theano
import theano.tensor as T
import numpy as np
X = theano.shared(value=np.asarray([[1, 0], [0, 0], [0, 1], [1, 1]]), name='X')
y = theano.shared(value=np.asarray([[1], [0], [1], [0]]), name='y')
rng = np.random.RandomState(1234)
LEARNING_RATE = 0.01
def layer(n_in, n_out):
np_array = np.asarray(rng.u... | {"hexsha": "5c734955ab93e3d5210403d848b2f959335567a8", "size": 956, "ext": "py", "lang": "Python", "max_stars_repo_path": "3_simple_neural_net/simple_net.py", "max_stars_repo_name": "JBed/Simple_Theano", "max_stars_repo_head_hexsha": "f2e265975339b558c9abb77c26aff6ec8e4a78cb", "max_stars_repo_licenses": ["Apache-2.0"],... |
import h5py
import lmdb
import numpy as np
import sys
h5_file = h5py.File(sys.argv[1])
data = h5_file.get('images')
target = h5_file.get('labels')
num = int(sys.argv[3])
data = data[:num]
target = target[:num]
map_size = data.nbytes * 10
env = lmdb.open(sys.argv[2], map_size=map_size)
for i in range(data.shape[0]):... | {"hexsha": "7d935313d915b7e2f9a71e141db07c7f1ede7f99", "size": 495, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch/hdf5_to_lmdb.py", "max_stars_repo_name": "mjm522/gpd", "max_stars_repo_head_hexsha": "6327f20eabfcba41a05fdd2e2ba408153dc2e958", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_coun... |
# # Series Recipes
@nospecialize
"""
_process_seriesrecipes!(plt, kw_list)
Recursively apply series recipes until the backend supports the seriestype
"""
function _process_seriesrecipes!(plt, kw_list)
for kw in kw_list
# in series attributes given as vector with one element per series,
# sele... | {"hexsha": "f799a9192d6467b5ae7f2c6d718fd50fc8efb1de", "size": 2799, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/series_recipe.jl", "max_stars_repo_name": "KristofferC/RecipesPipeline.jl", "max_stars_repo_head_hexsha": "a380895318b4386a3e60ba5be88dcd51c6045928", "max_stars_repo_licenses": ["MIT"], "max_st... |
import sys
sys.path.append('.')
import numpy as np
import torch
from catalyst import utils
from catalyst.dl import SupervisedRunner
from src.model.mobilenet import MBv2
from src.model.model_wrapper import ModelWrapper
if __name__ == "__main__":
image_size = [1, 3, 416, 416]
batch = {
'image': np.r... | {"hexsha": "50caaf9a330382fb12ff6345985396c1d9c1746e", "size": 1057, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/trace_model.py", "max_stars_repo_name": "meikuam/cat_faces", "max_stars_repo_head_hexsha": "00f58d91ac3b01c9e7f239b896283ca678448692", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_c... |
#include <boost/fusion/include/vector30.hpp>
| {"hexsha": "59e1c11332108d6ac5ec1b8650f0c7b6dc26952e", "size": 45, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost_fusion_include_vector30.hpp", "max_stars_repo_name": "miathedev/BoostForArduino", "max_stars_repo_head_hexsha": "919621dcd0c157094bed4df752b583ba6ea6409e", "max_stars_repo_licenses": ["BSL-1... |
"""
"""
import re
import json
from rio_tiler import main
from rio_tiler.utils import array_to_img, linear_rescale
import numpy as np
from lambda_proxy.proxy import API
from distutils import util
APP = API(app_name="lambda-tiler")
@APP.route('/bounds', methods=['GET'], cors=True)
def bounds():
"""
Handle bo... | {"hexsha": "590f4154f70b5a4aa00a39950f7e348d607be50b", "size": 2026, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/handler.py", "max_stars_repo_name": "dlindenbaum/lambda-tiler", "max_stars_repo_head_hexsha": "18f32d646edc877340abd388c77e37ac4de80b2b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
import io
import urllib.request
# 3rd Party
from PIL import Image
import numpy as np
from matplotlib import pyplot as plt
from scipy import ndimage
def get_entropy(signal):
""" Uses log2 as base
"""
probabability_distribution = [np.size(signal[signal == i])/(1.0 * signal.size) for i in list(set(signal))]
... | {"hexsha": "a9993ae58899ccc194cbc96abf45b6d1998a9f31", "size": 2087, "ext": "py", "lang": "Python", "max_stars_repo_path": "imagem.py", "max_stars_repo_name": "arijr/tic", "max_stars_repo_head_hexsha": "f6d2312a7d1b09fa15344c9ff8474ce42afad256", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_re... |
from .gen_guided_model import GuidedModel
import torch
import numpy as np
from PIL import Image
import cv2
import matplotlib.pyplot as plt
from scipy.io import savemat
class GuideCall(object):
def __init__(self, args):
self.input_path = args.input_path
self.output_path = args.output_path
s... | {"hexsha": "30718ce74aa0955412944b75795d0fa549716a2f", "size": 2873, "ext": "py", "lang": "Python", "max_stars_repo_path": "propagation/guided_function.py", "max_stars_repo_name": "naivete5656/WSISPDR", "max_stars_repo_head_hexsha": "1dc4d1bf24a6ebf7efd3c75d3f1a9edbe849d38b", "max_stars_repo_licenses": ["MIT"], "max_st... |
#! /usr/bin/env python
"""Thermodynamic quantities."""
import numpy as np
from scipy.optimize import brentq
from .constants import (
C_P,
C_PV,
EPSILON,
GRAV_EARTH,
L_V,
P0,
R_D,
R_V,
REL_HUM,
)
def sat_vap_press_tetens_kelvin(temp):
"""Saturation vapor pressure using Tetens ... | {"hexsha": "81868041ce5f0c0a9e4f528d2a0514aeae6c7433", "size": 6293, "ext": "py", "lang": "Python", "max_stars_repo_path": "puffins/thermodynamics.py", "max_stars_repo_name": "spencerahill/puffins", "max_stars_repo_head_hexsha": "27a9c06fe0ae1bc090a86084c2f3c924ce15ec95", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
Require Import
MathClasses.interfaces.abstract_algebra MathClasses.interfaces.orders.
(** Scalar multiplication function class *)
Class ScalarMult K V := scalar_mult: K → V → V.
#[global]
Instance: Params (@scalar_mult) 3 := {}.
Infix "·" := scalar_mult (at level 50) : mc_scope.
Notation "(·)" := scalar_mult (only ... | {"author": "coq-community", "repo": "math-classes", "sha": "c11eb05a1e58a7293ef9a9a046ca02a9fd5b44bc", "save_path": "github-repos/coq/coq-community-math-classes", "path": "github-repos/coq/coq-community-math-classes/math-classes-c11eb05a1e58a7293ef9a9a046ca02a9fd5b44bc/interfaces/vectorspace.v"} |
subroutine chk_endianc(mendian)
!----------------------------------------------------------------------
!$$$ documentation block
!
! get_mendian: to obtain machine endianness
!
! programmer: J. Wang date: Aug, 2012
!
! Input:
! no input argument
! OUTPUT:
! mendian: character(16) machine end... | {"hexsha": "b0f8fc0f9123b89bfa1d8ac473b6b37e6ab3eed7", "size": 1654, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "buildscripts/libs/NCEPlibs/src/bacio/v2.0.1/src/chk_endianc.f", "max_stars_repo_name": "GMAO-SI-Team/jedi-stack", "max_stars_repo_head_hexsha": "c34e968b3f803a255a7d2d1f33c1bf8c4d1559a0", "max_sta... |
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 21 10:32:59 2021
Poisson Distribution
A random variable X that has a Poisson distribution represents
the number of events occurring in a fixed time interval with
a rate parameters λ. λ tells you the rate at which the number of
events occur. The average and varia... | {"hexsha": "1df3ea2cbbb49a1342e0b7785ee990b4925a4558", "size": 552, "ext": "py", "lang": "Python", "max_stars_repo_path": "PoissonDistribution.py", "max_stars_repo_name": "IceCube1001/Poisson_Distribution", "max_stars_repo_head_hexsha": "f33f31a639929ec05f0383057e237034d649cfca", "max_stars_repo_licenses": ["Apache-2.0... |
"""A user interface for teleoperating an agent in an x-magical environment.
Modified from https://github.com/unixpickle/obs-tower2/blob/master/obs_tower2/recorder/env_interactor.py
"""
import time
from typing import List
import numpy as np
import pyglet.window
from gym.envs.classic_control.rendering import SimpleIma... | {"hexsha": "66b4d2d4cc3e65e981814d59d72f4c4b0e6f5f14", "size": 3358, "ext": "py", "lang": "Python", "max_stars_repo_path": "xmagical/utils/env_interactor.py", "max_stars_repo_name": "kevinzakka/x-magical", "max_stars_repo_head_hexsha": "ce0533f17b0e02baffc04acded5b5b12eb9d1d00", "max_stars_repo_licenses": ["0BSD"], "ma... |
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 31 11:03:47 2020
@author: abner
"""
import os
import numpy as np #arrays
import matplotlib.pyplot as plt #visualizacióm
import pandas as pd #datos
os.chdir('D:/Git Hub-BEST/machinelearning-az/datasets/Part 2 - Regression/Section 6 - Polynomial Regress... | {"hexsha": "d560274dfcc829bff8ddfa449be6ca90704ddfcb", "size": 4839, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/Part 2 - Regression/Section 6 - Polynomial Regression/Regresion_Abner.py", "max_stars_repo_name": "abnercasallo/machinelearning-az", "max_stars_repo_head_hexsha": "6f212c29c9870b697d84029... |
# -*- coding: utf-8 -*-
from autograd.blocks.hyperbolic import sinh
from autograd.blocks.hyperbolic import cosh
from autograd.blocks.hyperbolic import tanh
from autograd.variable import Variable
import numpy as np
import autograd as ad
def test_sinh_forward():
ad.set_mode('forward')
# ============================... | {"hexsha": "0f364496c346b800c3bce2083f5fe3a932fe9018", "size": 10375, "ext": "py", "lang": "Python", "max_stars_repo_path": "autograd/tests/test_hyperbolic.py", "max_stars_repo_name": "pmaederyork/Dragrongrad", "max_stars_repo_head_hexsha": "32794d561f8d0273592ed55d315013eab2c24b8b", "max_stars_repo_licenses": ["MIT"],... |
#!/usr/bin/python3
import numpy as np
from mseg.utils.cv2_utils import (
grayscale_to_color,
form_hstacked_imgs,
form_vstacked_imgs,
add_text_cv2,
)
def test_add_text_cv2() -> None:
"""
Smokescreen
"""
img = 255 * np.ones((512, 512, 3), np.uint8)
text = "Hello World!"
add_tex... | {"hexsha": "4a4fb19f5fc7675af815b41a219a103f26638f32", "size": 2819, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_cv2_utils.py", "max_stars_repo_name": "mintar/mseg-api", "max_stars_repo_head_hexsha": "df7b899b47b33ad82dcbf17c289856a1f1abea22", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_stars_c... |
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(-3,3,50)
y1 = 2*x+1
y2 = x**2
#绘制在同一个figure中
plt.figure()
plt.plot(x,y1)
plt.plot(x,y2,color='red',linewidth = 2.0,linestyle = '--')#指定颜色,线宽和线型
#截取x,y的某一部分
plt.xlim((-1,2))
plt.ylim((-2,3))
#设置x,y的坐标描述标签
plt.xlabel("I am x")
plt.ylabel("I am y")
#设置x... | {"hexsha": "705b4746e07442322764c7be61e71fbca137b9c9", "size": 913, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/extends/analysis/mkfigs/1.py", "max_stars_repo_name": "li-phone/DefectNet", "max_stars_repo_head_hexsha": "f1b6f44a34581c8942d7ee5341cb9da4e76a225a", "max_stars_repo_licenses": ["MIT"], "max_... |
(*
* Copyright 2020, Data61, CSIRO (ABN 41 687 119 230)
*
* SPDX-License-Identifier: BSD-2-Clause
*)
theory CompoundCTypes
imports Vanilla32 Padding
begin
definition empty_typ_info :: "typ_name \<Rightarrow> 'a typ_info" where
"empty_typ_info tn \<equiv> TypDesc (TypAggregate []) tn"
primrec
extend_ti :: "'a... | {"author": "seL4", "repo": "l4v", "sha": "9ba34e269008732d4f89fb7a7e32337ffdd09ff9", "save_path": "github-repos/isabelle/seL4-l4v", "path": "github-repos/isabelle/seL4-l4v/l4v-9ba34e269008732d4f89fb7a7e32337ffdd09ff9/tools/c-parser/umm_heap/CompoundCTypes.thy"} |
import matplotlib.pyplot as plt
import numpy as np
from scipy.signal import convolve2d
# python gs_convolve.py 3.53s user 0.13s system 107% cpu 3.414 total
def calc(u, v, u2, v2):
dt = 0.2
F = 0.04
k = 0.06075
laplacian = np.array([[0, 1, 0], [1, -4, 1], [0, 1, 0]])
lu = 0.1*convolve2d(u, laplac... | {"hexsha": "e25705bdc7d7a08dfdc3ff084712a68a34c6cf22", "size": 889, "ext": "py", "lang": "Python", "max_stars_repo_path": "gs_convolve.py", "max_stars_repo_name": "kaityo256/python_gs", "max_stars_repo_head_hexsha": "d825db5eff9048863a9bed1a52c77e329c6518ff", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
from scipy.fft import fft, fftfreq
import numpy as np
import matplotlib.pyplot as plt
#Chebyshev Filter Coefficients
b = [ 0.00757702, -0.02666634, 0.06433529, -0.09739344, 0.11965053, -0.10339635,
0.07472005, -0.0214037, -0.0214037, 0.07472005, -0.10339635, 0.11965053,
-0.09739344, 0.06433529, -0.02666634, ... | {"hexsha": "30394c722e96e0fde62fa245a2db45cc9a05701f", "size": 1395, "ext": "py", "lang": "Python", "max_stars_repo_path": "graphing/18_fftsaturationaliasing.py", "max_stars_repo_name": "jaakjensen/PythonDSP", "max_stars_repo_head_hexsha": "d4f5850a5379c14d531e6f9c6d43e03f53fb888d", "max_stars_repo_licenses": ["MIT"], ... |
#!/usr/bin/env python
# encoding: utf-8
"""
miprest.py
@author: Kevin S. Brown (UCONN), Ameya Akkalkotkar (UCONN)
Created by Kevin Brown on 2016-09-19.
"""
from stopping import covmatrix
from numpy.linalg import svd
from numpy import dot,newaxis
def pca(X,k):
'''
PCA decomposition of matrix X. X is assume... | {"hexsha": "2282d4c70f7b10468dec87222b5a2f6ac0373266", "size": 1213, "ext": "py", "lang": "Python", "max_stars_repo_path": "pca.py", "max_stars_repo_name": "archimonde1308/miprest", "max_stars_repo_head_hexsha": "097cec1d737df9f590b902028f34275fb870721a", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.