text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
"""Sort neurons by preferred sequence type and offset."""
function sortperm_neurons(globals::SeqGlobals; thres=0.2)
resp_props = exp.(globals.neuron_response_log_proportions)
offsets = globals.neuron_response_offsets
peak_resp = dropdims(maximum(resp_props, dims=2), dims=2)
has_response = peak_resp .... | {"hexsha": "c4f58d14a5c1ae9420d49d5212845022e73054bd", "size": 592, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/utils/analysis.jl", "max_stars_repo_name": "WilburDoz/PPSeq.jl", "max_stars_repo_head_hexsha": "fd16af0e6aa4ce6e380d22c4a4ee05cf80b188a3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#ifndef GRUNE_SENTENCE_ITERATOR
#define GRUNE_SENTENCE_ITERATOR
#include <boost/operators.hpp>
#include "grune/symbol.hpp"
namespace grune
{
class grammar;
/*
* An iterator that allows iterating over all the possible sentences
* in a grammar in breadth-first order.
*
* Note that the list may contain duplicates... | {"hexsha": "27caec32305700079eafb8902b1785080aac19f2", "size": 1815, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "grune/sentence_iterator.hpp", "max_stars_repo_name": "Fifty-Nine/grune", "max_stars_repo_head_hexsha": "8bd21d10e6ca1e909292f36e573ec8a04c12d109", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
# --------------
# Import packages
import numpy as np
import pandas as pd
from scipy.stats import mode
# code starts here
#path = "Macintosh HD/Users/pritigirishvankudre/Day3_Python/file.csv"
bank = pd.read_csv(path)
categorical_var=bank.select_dtypes(include='object')
print (categorical_var)
numerical_var... | {"hexsha": "2ce4096cec5e5e20176ba5b7d143600a12a41bd5", "size": 1839, "ext": "py", "lang": "Python", "max_stars_repo_path": "Loan-Details/code.py", "max_stars_repo_name": "girishvankudre/ga-learner-dsmp-repo", "max_stars_repo_head_hexsha": "4a9c6f52e2e3404cf16cba0540c77a93bcd24157", "max_stars_repo_licenses": ["MIT"], "... |
import data_readers as dr
import numpy as np
import pandas as pd
from config import Config
from lightgbm import LGBMClassifier
from sklearn.dummy import DummyClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score, roc_auc_score
from sklearn.model_selection import trai... | {"hexsha": "6de96ddbb8e36b964d235a6ada6d699967c2bc97", "size": 2080, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/baseline.py", "max_stars_repo_name": "sigtryggurk/aa228", "max_stars_repo_head_hexsha": "c141ae789a215e807784cd1cc6167e6991cc44c4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
import numpy as np
import csv
__author__ = "Francis Rhys Ward"
__license__ = "MIT"
path = 'meta_data.tsv'
def read_meta(path=path):
'''Correctly reads a .tsv file into a numpy array'''
data = []
with open(path) as fd:
rd = csv.reader(fd, delimiter="\t", quotechar='"')
data = []
fo... | {"hexsha": "8ec387a2af7c4dc19e00df28b90630ddf1a47228", "size": 471, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/MeshCNN/util/read_meta.py", "max_stars_repo_name": "devskroy1/ForkedBrainSurfaceTK", "max_stars_repo_head_hexsha": "774035ab5eae6c0a40eb96eab43d489d3f722eaa", "max_stars_repo_licenses": ["MI... |
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{extramarks}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{tikz}
\usepackage[plain]{algorithm}
\usepackage{algpseudocode}
\usepackage{graphicx}
\graphicspath{{./images/}{IR}}
\usetikzlibrary{automata,positioning}
%
% Basic Document... | {"hexsha": "03bdc6cc1225926afcf007d042b439a191f08116", "size": 10866, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "writeup/homework.tex", "max_stars_repo_name": "aujxn/perceptron", "max_stars_repo_head_hexsha": "b8008ee7cbe150c979e4bb66df700bcaba890a68", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import numpy as np
from typing import List, Dict, Any
from itertools import combinations
from scipy.cluster import hierarchy
from ngslite import Chromosome, FastaWriter
from .cd_hit import CdHit
from .template import Processor, Settings
from .constant import CDS_ID_KEY, ORTHOLOG_ID_KEY
class SortLoci(Proces... | {"hexsha": "cfddb5a04c46a9ae3fa2c2caea759e66b2125111", "size": 6318, "ext": "py", "lang": "Python", "max_stars_repo_path": "locus_hunter/sort_loci.py", "max_stars_repo_name": "linyc74/locus_hunter", "max_stars_repo_head_hexsha": "fc5421b43292cf3b31cbcac6df2ca5db59e5c65c", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma integer_set_bit_code [code]:
"integer_set_bit x n b =
(if n < 0 then undefined x n b else
if b then x OR (push_bit (nat_of_integer n) 1)
else x AND NOT (push_bit (nat_of_integer n) 1))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. integer_set_bit x n b = (if n < 0 then undefined x n b e... | {"llama_tokens": 210, "file": "Native_Word_Code_Target_Integer_Bit", "length": 1} |
################################################
# Ex1 #
# Project by: #
# Group 13 #
# Sofia Aparicio 81105 #
# Rodrigo Lousada 81115 #
# Rogerio Cabaco #
################################################
#####################... | {"hexsha": "3074990f3dae01b7a81c365a11c4c8212de04df5", "size": 5684, "ext": "py", "lang": "Python", "max_stars_repo_path": "Proj2/exercice_1.py", "max_stars_repo_name": "rodrigolousada/IPR-Project", "max_stars_repo_head_hexsha": "803574ef52b39db6c736b231a620e786a7cc58d9", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma before_Cons[simp]:
"y \<in> set xs \<Longrightarrow> y \<noteq> x \<Longrightarrow> before y (x#xs) = insert x (before y xs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>y \<in> set xs; y \<noteq> x\<rbrakk> \<Longrightarrow> before y (x # xs) = insert x (before y xs)
[PROOF STEP]
by(... | {"llama_tokens": 133, "file": "List_Update_Move_to_Front", "length": 1} |
function[N,B,E] = isi(data,T,err,Nbins,plt)
% Calculate the inter-spike-interval histogram
% Usage: [N,B,E] = isi(data,T,err,Nbins,plt)
%
% Input:
% Note that all times have to be consistent.
%
% data - structure array of spike times (re... | {"author": "buzsakilab", "repo": "buzcode", "sha": "2d700a38b3c2a860ad1333be90f14d7a37a72815", "save_path": "github-repos/MATLAB/buzsakilab-buzcode", "path": "github-repos/MATLAB/buzsakilab-buzcode/buzcode-2d700a38b3c2a860ad1333be90f14d7a37a72815/externalPackages/chronux_2_12/spectral_analysis/pointtimes/isi.m"} |
#include "IO_L.h"
#include <boost/filesystem/path.hpp>
using namespace ProjSearch;
IoL :: IoL() {}
bool IoL :: fileExists(string filePath) const {
return boost :: filesystem :: exists(filePath);
}
bool IoL :: isFile(string filePath) const {
return boost :: filesystem :: is_regular(filePath) ||
boost :: filesys... | {"hexsha": "efb1e3b88c3e0fc5e6fb5df3c558b4c61feb32d7", "size": 918, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "CommandLine/IO_L.cpp", "max_stars_repo_name": "AnuragNtl/QwikProjSearch", "max_stars_repo_head_hexsha": "6eb34a87a22f8cd8dfa07aa0691b86c53f0cf54a", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta... |
syms lon lat r
syms x1 y1 z1
syms xx1 yy1 zz1
syms lam1 theta1 r1
% xx1=x1/sqrt(x1^2+y1^2+z1^2);
% yy1=y1/sqrt(x1^2+y1^2+z1^2);
% zz1=z1/sqrt(x1^2+y1^2+z1^2);
% xx1=r*cos(lam)*cos(theta)
% yy1=r*sin(lam)*cos(theta)
% zz1=r*sin(theta);
% yy1/xx1=sin(lam)/cos(lam)
% lam=atan(yy1/xx1)
% theta=asin(zz1/sqrt(xx1^2+yy1^2+z... | {"hexsha": "06c089d67df76cf643e96df8c4b2888470b519b5", "size": 1723, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Grid/MetricGuba.jl", "max_stars_repo_name": "CliMA/CGDycore.jl", "max_stars_repo_head_hexsha": "77297631f8db7775f19daee2d7ac75bc810d9c11", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
# Python < 3 needs this: coding=utf-8
import pytest
from pybind11_tests import builtin_casters as m
from pybind11_tests import UserType, IncType
def test_simple_string():
assert m.string_roundtrip("const char *") == "const char *"
def test_unicode_conversion():
"""Tests unicode conversion and error reporti... | {"hexsha": "91422588cf6f880b40daaa9d635f94cd70d459ad", "size": 13763, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib-opencc-android/src/main/jni/OpenCC/deps/pybind11-2.5.0/tests/test_builtin_casters.py", "max_stars_repo_name": "huxiaomao/android-opencc", "max_stars_repo_head_hexsha": "a251591316323151a97d97... |
# This code was taken from: https://github.com/ViralBShah/MatrixMarket.jl
module MatrixMarket
function mmread(filename::String, infoonly::Bool)
# Reads the contents of the Matrix Market file 'filename'
# into a matrix, which will be either sparse or dense,
# depending on the Matrix Market format indica... | {"hexsha": "bc53ebae60be0aebf5a28fa85b7b4c4ceb9e9d68", "size": 1905, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/machine_learning/MatrixMarket.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/LinearLeastSquares.jl-a8002f64-6652-5b53-92ba-d4864fedfa0a", "max_stars_repo_head_hexsha": "f50c74... |
import numpy as np
from sysidentpy.narmax_base import GenerateRegressors
from sysidentpy.narmax_base import HouseHolder
from sysidentpy.narmax_base import ModelInformation
from sysidentpy.narmax_base import InformationMatrix
from numpy.testing import assert_almost_equal, assert_array_equal, assert_equal
IM = Informat... | {"hexsha": "867016e86c00f5c1620d75b99831870a1608b3dc", "size": 6881, "ext": "py", "lang": "Python", "max_stars_repo_path": "sysidentpy/tests/test_narmax_base.py", "max_stars_repo_name": "neylsoncrepalde/sysidentpy", "max_stars_repo_head_hexsha": "3d241ff3c460a8e01f9bd8afbaf17f27ec3937f3", "max_stars_repo_licenses": ["B... |
[STATEMENT]
lemma DirProds_one_cong_sym: "(f G) \<cong> (DirProds f {G})"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. f G \<cong> DirProds f {G}
[PROOF STEP]
using DirProds_one_iso_sym is_isoI
[PROOF STATE]
proof (prove)
using this:
(\<lambda>x. \<lambda>_\<in>{?G}. x) \<in> Group.iso (?f ?G) (DirProds ?f {?G})
?... | {"llama_tokens": 206, "file": "Finitely_Generated_Abelian_Groups_DirProds", "length": 2} |
"""
---------
Callbacks
---------
Demonstration of how to set up callback functions.
"""
from typing import Tuple
import matplotlib.pyplot as plt
import numpy as np
from mpl_point_clicker import clicker
image = np.load("example_image.npy")
fig, ax = plt.subplots()
ax.imshow(image, cmap='gray')
klicker = clicker(... | {"hexsha": "72d745a6c3da1f5aa0cd206b49bcaa66b5ecab83", "size": 1054, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/callbacks.py", "max_stars_repo_name": "JacobKosowski/mpl-point-clicker", "max_stars_repo_head_hexsha": "ddb7c883e895d5baadd7bc75889129e34cb86c55", "max_stars_repo_licenses": ["BSD-3-Claus... |
[STATEMENT]
lemma skl1_step1_refines_a0i_skip_r:
"{R0sk1iar} Id, skl1_step1 Ra A B {>R0sk1iar}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. {R0sk1iar} Id, skl1_step1 Ra A B {> R0sk1iar}
[PROOF STEP]
by (auto simp add: PO_rhoare_defs R0sk1iar_def skl1_step1_def) | {"llama_tokens": 140, "file": "Key_Agreement_Strong_Adversaries_sklvl1", "length": 1} |
"""
Module for handling Exact Gradient corrected Screened (EGS) Potential
"""
import numpy as np
from numba import njit
import fdint
def update_params(potential, params):
"""
Assign potential dependent simulation's parameters.
Parameters
----------
potential : sarkas.potentials.core.Potential
... | {"hexsha": "be201fec2716d79a6d5df652206537930513b9a9", "size": 5366, "ext": "py", "lang": "Python", "max_stars_repo_path": "sarkas/potentials/egs.py", "max_stars_repo_name": "namurphy/sarkas", "max_stars_repo_head_hexsha": "05d10a4c723240d1e48a2df334423ff1ee7b0db3", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
# Abif format
# ===========
#
# Reader of the ABIF file format.
#
# This file is a part of BioJulia.
# License is MIT: https://github.com/BioJulia/BioJulia.jl/blob/master/LICENSE.md
module ABIF
import BioCore
include("reader.jl")
end
| {"hexsha": "7cf5cbf064fa4095f6a8d1e6b061ab0a5ce3f9e3", "size": 239, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/abif/abif.jl", "max_stars_repo_name": "ivirshup/BioSequences.jl", "max_stars_repo_head_hexsha": "3c12124952d26f85df9de88307e24ee5a93b4dab", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
import cv2
import numpy as np
import os
import glob
import pandas as pd
import common as dataset_commons
'''
This code only gives you a tool to visualize
the images pointed in the csv file and the related bounding boxes using openCV
'''
dir_files = dataset_commons.get_dataset_files()
def load_images_from_csv(images_... | {"hexsha": "6d7dfeb9468053c7a735fc58301ffc4514fa9205", "size": 2527, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/view_csv_files.py", "max_stars_repo_name": "caiobarrosv/object-detection-for-grasping", "max_stars_repo_head_hexsha": "2ac2f58700dff73032836ce33d3b98ebf3f29257", "max_stars_repo_licenses": [... |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import musicalrobot
import os
from musicalrobot import edge_detection as ed
from musicalrobot import pixel_analysis as pa
def dict_pack (d_files, d_names, d_crop, d_inftemp, d_temp, d_plate):
"""
Function is used within the auto_crop funct... | {"hexsha": "bd39bc0f0be786b20b937a2e71d2c3e6bbfefba5", "size": 13075, "ext": "py", "lang": "Python", "max_stars_repo_path": "musicalrobot/bulk.py", "max_stars_repo_name": "pozzocapstone/musical-robot1", "max_stars_repo_head_hexsha": "556cb325851c6e268bee6c46d8a00e073b404ca6", "max_stars_repo_licenses": ["MIT"], "max_st... |
import pandas as pd
import numpy as np
from numpy import linalg
import emm
from emm.losses import *
from emm.reweighting import marginal
# Corpus
m = 5000
age = np.random.choice( ['0-18','18-30','30-40','40-60','60+'],
p=[ 0.2, 0.25, 0.25, 0.2, 0.1], size=m)
sex = np.random.choice([0.0... | {"hexsha": "52a9ed8d1560549185d1b6b6d55c2494e93725dc", "size": 2286, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/simulated.py", "max_stars_repo_name": "LucasKIJ/EMM", "max_stars_repo_head_hexsha": "cf4ec0549956958fad8b3c1d1c5b8ca5b4143704", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
@doc raw"""
gaussjacobi(n::Integer) -> Tuple{Vector{Float64},Vector{Float64}}
Return nodes and weights of [Gauss-Jacobi quadrature](https://en.wikipedia.org/wiki/Gauss%E2%80%93Jacobi_quadrature).
```math
\int_{-1}^{1} f(x) (1-x)^\alpha(1+x)^\beta dx \approx \sum_{i=1}^{n} w_i f(x_i)
```
# Examples
```jldoctest
j... | {"hexsha": "c755941601fd695a284f7682dfc2aab3f09ec7da", "size": 12379, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/gaussjacobi.jl", "max_stars_repo_name": "Datseris/FastGaussQuadrature.jl", "max_stars_repo_head_hexsha": "dd1f2fed53c4024bb6bde9f8d5a237ac47985b51", "max_stars_repo_licenses": ["MIT"], "max_st... |
# Copyright 2020 Makani Technologies LLC
#
# 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... | {"hexsha": "f95169e5a09914289adecca6f6d3aa94fa3245b0", "size": 32128, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/checks/base_check.py", "max_stars_repo_name": "leozz37/makani", "max_stars_repo_head_hexsha": "c94d5c2b600b98002f932e80a313a06b9285cc1b", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
\chapter{System Overview}
\label{cha:overview}
%Briefly introduce the system and its components. Later chapters go into more detail.
SimSpark is built upon an application framework called zeitgeist. This
framework provides basic OS abstractions like file and archive
support, logging, shared libraries etc.), a script... | {"hexsha": "f4afade9319f395c55fc21738895bed6635fb1fb", "size": 5911, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "SimSpark/rcssserver3d/doc/users/overview.tex", "max_stars_repo_name": "IllyasvielEin/Robocup3dInstaller", "max_stars_repo_head_hexsha": "12e91d9372dd08a92feebf98e916c98bc2242ff4", "max_stars_repo_li... |
[STATEMENT]
lemma crel_vs_success:
assumes "crel_vs R a b" "P heap" "Q heap" "state_dp_consistency.cmem heap"
shows "success b heap"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. success b heap
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
crel_vs R a b
P heap
Q heap
state_dp_consistency.cmem... | {"llama_tokens": 251, "file": "Monad_Memo_DP_heap_monad_DP_CRelVH", "length": 3} |
"""
function Scale(ratio)
A simple wrapper that will multiply inputs by the ratio.
```jldoctest
julia> using AudioSchedules
julia> Scale(3)(2)
6
```
"""
struct Scale{Ratio}
ratio::Ratio
end
(scale::Scale)(thing) = thing * scale.ratio
export Scale
const DIGITS = of(:maybe, raw("-")), of(:some, short(:digi... | {"hexsha": "4cccf7981c038c3b80b14672ba0ada22e1af037c", "size": 2156, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/miscellaneous.jl", "max_stars_repo_name": "bramtayl/AudioSchedulers", "max_stars_repo_head_hexsha": "8a7c8905d8c648936b5eaef9fbe76e3d04670314", "max_stars_repo_licenses": ["0BSD"], "max_stars_c... |
// Copyright (c) 2015 The Bitcoin Core developers
// Copyright (c) 2015-2020 The Bitcoin Unlimited developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "bench.h"
#include "allowed_args.h"
#include "bench/bench_co... | {"hexsha": "4d8c97dac3dbf1e281392a65574d4978398c7d66", "size": 1947, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/bench/bench_bitcoin.cpp", "max_stars_repo_name": "gandrewstone/bitcoin", "max_stars_repo_head_hexsha": "05de381c02eb4bfca94957733acadfa217527f25", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import pandas as pd
import numpy as np
# check similarity
from difflib import SequenceMatcher
import warnings, random
def similarity(a, b):
"""
check similarity between two items a and b
:param a: item 1, could be a string or a list of numbers
:param b: item 2, could be a string or a list of numbers
... | {"hexsha": "5abdf1bd7c9cc7096878629efc559540f524e4c6", "size": 5589, "ext": "py", "lang": "Python", "max_stars_repo_path": "pdia/responseReconstruction/makeSBTRcidConversionTable.py", "max_stars_repo_name": "yangjiang001/pdia-1", "max_stars_repo_head_hexsha": "8dcd0960bf2e540f11cd37ccb92cbac1bbd51368", "max_stars_repo_... |
# -*- coding: utf-8 -*-
"""
.. _tut-working-with-seeg:
======================
Working with sEEG data
======================
MNE-Python supports working with more than just MEG and EEG data. Here we show
some of the functions that can be used to facilitate working with
stereoelectroencephalography (sEEG) data.
This e... | {"hexsha": "9c6854e4ffac9effe388f574f4290473283e9fcc", "size": 8025, "ext": "py", "lang": "Python", "max_stars_repo_path": "tutorials/clinical/20_seeg.py", "max_stars_repo_name": "lokinou/mne-python", "max_stars_repo_head_hexsha": "f4aa12bc9118d0739ca05c5ed5a4fba7ae71138b", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
import numpy as np
import pickle
from threading import Thread
from functions import helper_func as func, activations as act
class attention_model():
def __init__(self, name, unit, S, n_s, n_a, layer_dimension, optimizer = None):
"""
Attention Model at time step t in Ty
-----Parameter-----... | {"hexsha": "f1d7cf05ead47832c94274df1ed3155bfc78fe41", "size": 12514, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/attention_model.py", "max_stars_repo_name": "jakelong0509/Song_Detector", "max_stars_repo_head_hexsha": "57ac4b206b985f2c9e40423a9f79deacbc88f64e", "max_stars_repo_licenses": ["MIT"], "max... |
function [B,L,U] = boundingbox(P,Options,x)
%BOUNDINGBOX Computes bounding box of a constraint
%
% If only one output is requested, only the symbolic model is returned
% B = boundingbox(F)
%
% If three outputs are requested, numerical values are returned too
% [B,L,U] = boundingbox(F)
%
% A second argument can be use... | {"author": "yalmip", "repo": "YALMIP", "sha": "f6d5a6d4222a4d722de30bffb43cae4b3e13b860", "save_path": "github-repos/MATLAB/yalmip-YALMIP", "path": "github-repos/MATLAB/yalmip-YALMIP/YALMIP-f6d5a6d4222a4d722de30bffb43cae4b3e13b860/extras/@optproblem/boundingbox.m"} |
import torch
import scipy.misc
from PIL import Image
import numpy as np
import os
from tqdm import tqdm
import random
def extract_ampl_phase(fft_im):
fft_amp = fft_im[:,:,:,0]**2 + fft_im[:,:,:,1]**2
fft_amp = torch.sqrt(fft_amp)
fft_pha = torch.atan2( fft_im[:,:,:,1], fft_im[:,:,:,0] )
return fft_amp, ... | {"hexsha": "4d8b3131aec7433d4acf3ef522466d85fc3eb92f", "size": 5161, "ext": "py", "lang": "Python", "max_stars_repo_path": "augmentation/mix_replace_disorder.py", "max_stars_repo_name": "ruiliu-code/FSAC", "max_stars_repo_head_hexsha": "1bb50b613b4a058802b25905dc9af13f9300212e", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
# Local imports
from jetmontecarlo.utils.vector_utils import angle
# TODO: Include multiple emission accuracy to observables
# TODO: Include accuracy into parton shower observables
# TODO: Include groomed parton shower observables
#######################################
# Observables used in MC in... | {"hexsha": "7db217b4fc69e76ac433566d2bd81abd1df903a3", "size": 6214, "ext": "py", "lang": "Python", "max_stars_repo_path": "jetmontecarlo/jets/observables.py", "max_stars_repo_name": "samcaf/JetMonteCarlo", "max_stars_repo_head_hexsha": "71f50f3bb53a4f68ed927eaeaed5ee258da0dd34", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import math
from agent import Agent
import utils
import hydra
class QuantileAgent(Agent):
"""Quantile algorithm."""
def __init__(self, obs_dim, action_dim, action_range, device, critic_cfg,
actor_cfg, disc... | {"hexsha": "8f1ae2584f92fdc92c5a2c1095e5c8ed475d7180", "size": 10474, "ext": "py", "lang": "Python", "max_stars_repo_path": "agent/quantile.py", "max_stars_repo_name": "willwhitney/quantile-baselines", "max_stars_repo_head_hexsha": "41cb52fd0fc2651bdab69b17df4d48c86b909eab", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""
Shared functions.
Qing Li, 20171213
"""
import datetime
import numpy as np
from netCDF4 import num2date, date2index
from scipy.interpolate import griddata
###############################################################################
# constants ... | {"hexsha": "8e6c5dce26004e88375d175d481bf672ce3ec9ac", "size": 16884, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/gotmtool.py", "max_stars_repo_name": "zhihua-zheng/my_gotmwork", "max_stars_repo_head_hexsha": "9831594713fc30108619e3034a788f74330d6bd0", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import numpy as np
import tensorflow as tf
from stable_baselines.common.policies import ActorCriticPolicy, FeedForwardPolicy
from stable_baselines.a2c.utils import conv, linear, conv_to_fc
class CustomPolicy(FeedForwardPolicy):
"""
FeedForwardPolicy but with a custom cnn feature extractor.
"""
def __i... | {"hexsha": "ea3b7a510f29460fb6182233ae6b161d80ff0a25", "size": 1547, "ext": "py", "lang": "Python", "max_stars_repo_path": "gym_battlesnake/custompolicy.py", "max_stars_repo_name": "SahibSodhi/Tackling-BattleSnake-Game", "max_stars_repo_head_hexsha": "bb24156dada0bda4eee528239bf94d6b71c11eb8", "max_stars_repo_licenses"... |
[STATEMENT]
lemma eucl_truncate_up_mono:
fixes x::"'a::executable_euclidean_space"
shows "x \<le> y \<Longrightarrow> eucl_truncate_up p x \<le> eucl_truncate_up p y"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. x \<le> y \<Longrightarrow> eucl_truncate_up p x \<le> eucl_truncate_up p y
[PROOF STEP]
by (auto s... | {"llama_tokens": 162, "file": "Affine_Arithmetic_Executable_Euclidean_Space", "length": 1} |
{-# OPTIONS --universe-polymorphism #-}
module Categories.NaturalIsomorphism where
open import Level
open import Relation.Binary using (IsEquivalence)
open import Categories.Support.PropositionalEquality
open import Categories.Support.Equivalence
open import Categories.Category
open import Categories.Functor hiding ... | {"hexsha": "f07a836bd6e3541a60b45ec649a9c64f06b2dc61", "size": 7658, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Categories/NaturalIsomorphism.agda", "max_stars_repo_name": "copumpkin/categories", "max_stars_repo_head_hexsha": "36f4181d751e2ecb54db219911d8c69afe8ba892", "max_stars_repo_licenses": ["BSD-3-Cla... |
#
# Correctness Tests
#
using GeoEfficiency
using Base.Test
tests = ["Input_Interface",
"Physical_model",
"Output_Interface",
"calculations"]
println("\nRunning tests:")
for t in tests
println(" * $(t)")
include("test_$(t).jl")
end
@test 1.0==1
| {"hexsha": "744f40401230ca51e56dbf6b433430accc109070", "size": 287, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "JuliaPackageMirrors/GeoEfficiency.jl", "max_stars_repo_head_hexsha": "d41245477df85153aab7103cf9b6e118d23e43e3", "max_stars_repo_licenses": ["MIT"], "max_s... |
# -*- coding: utf-8 -*-
import sys
sys.path += ["/gpfs/data/epavlick/atraylor/Pokemon/poke-env/src"]
import asyncio
import numpy as np
from poke_env.player.random_player import RandomPlayer
from threading import Thread
from poke_env.utils import to_id_str
from poke_env.player.env_player import (
Gen8EnvSinglePlayer... | {"hexsha": "bee8667b59f8715372a6f9acbd9cefc1f13114d7", "size": 14548, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/BigBoy_refactor/run.py", "max_stars_repo_name": "attraylor/poke-env", "max_stars_repo_head_hexsha": "05eb57800c16229ec683762e628aacb0b6dd9cc3", "max_stars_repo_licenses": ["MIT"], "max_s... |
import numpy as np
import random
from collections import namedtuple, deque
from model import QNetwork
import tensorflow as tf
BUFFER_SIZE = int(1e5) # replay buffer size
BATCH_SIZE = 64 # minibatch size
GAMMA = 0.99 # discount factor
TAU = 1e-3 # for soft update of target parameters
... | {"hexsha": "ed2aaaee8c7253834b4cd6064ac7dd4becc87fc9", "size": 7208, "ext": "py", "lang": "Python", "max_stars_repo_path": "project1_navigation/dqn_agent.py", "max_stars_repo_name": "adityabingi/DeepRL-Projects", "max_stars_repo_head_hexsha": "66618db67304987581f48df94ee52d38d877cd22", "max_stars_repo_licenses": ["MIT"... |
import json
import requests
import time
import numpy as np
import keras
from keras import models, layers
from sklearn.model_selection import train_test_split
def get_data():
BASE_URL = "http://www.nlotto.co.kr/common.do?method=getLottoNumber&drwNo="
DATA_PATH = "./data/data.json"
with open(DATA_PATH) as j... | {"hexsha": "8a3cd738f84b60f20b4fe83e5701cf62c5f0dd63", "size": 3243, "ext": "py", "lang": "Python", "max_stars_repo_path": "run.py", "max_stars_repo_name": "6londe/inferoto", "max_stars_repo_head_hexsha": "a5cf292f9d51f6c09a3f5d86e6b837a085cae1dd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "max_stars_re... |
################################################################################
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation; either
## version 2.1 of the License, or (at your op... | {"hexsha": "b75e0b4836fe31956977ae16b108a8cc3687704b", "size": 14384, "ext": "py", "lang": "Python", "max_stars_repo_path": "bin/ADFRsuite/CCSBpckgs/mglutil/math/rmsd.py", "max_stars_repo_name": "AngelRuizMoreno/Jupyter_Dock_devel", "max_stars_repo_head_hexsha": "6d23bc174d5294d1e9909a0a1f9da0713042339e", "max_stars_re... |
import numpy as np
class CartPoleReward():
def __init__(self):
self.posterior = np.array([0.95, 0.05])
def get_reward_distribution(self, obs):
x_pos = obs[0]
if x_pos > 0.0:
return np.array([+2.0, -2.0])
else:
return np.array([+1.0, +1.0])
if __name__ =... | {"hexsha": "b35fa101e30fe17606248bd3bbc63fe3f960436a", "size": 514, "ext": "py", "lang": "Python", "max_stars_repo_path": "spinup/rewards/cartpole_reward_utils.py", "max_stars_repo_name": "jerryzhucs21/spinningup", "max_stars_repo_head_hexsha": "2992e6a8163d78c3f82a3d92c5235fda0527c398", "max_stars_repo_licenses": ["MI... |
@testset "70.climbing-stairs.jl" begin
@test climbing_stairs(1) == 1
@test climbing_stairs(2) == 2
@test climbing_stairs(3) == 3
@test climbing_stairs(8) == 34
@test climbing_stairs(45) == 1836311903
end
| {"hexsha": "1559925db415d9c16ec37e209499de590dee37cb", "size": 224, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/problems/70.climbing-stairs.jl", "max_stars_repo_name": "RexWzh/LeetCode.jl", "max_stars_repo_head_hexsha": "d86109b9d5a15491304ff9d2ee66e506f60d2146", "max_stars_repo_licenses": ["MIT"], "max_... |
// Copyright Carl Philipp Reh 2009 - 2016.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <fcppt/container/enum_array.hpp>
#include <fcppt/config/external_begin.hpp>
#include <boo... | {"hexsha": "d168e7624cdd8d560368986e277bb9801a584d29", "size": 951, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/container/enum_array.cpp", "max_stars_repo_name": "vinzenz/fcppt", "max_stars_repo_head_hexsha": "3f8cc5babdee178a9bbd06ca3ce7ad405d19aa6a", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars_co... |
# import libraries
import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
# model / data parameters
num_classes = 10
input_shape = (28, 28, 1)
# splitting data into train and test sets
#(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
with np.load('mnist... | {"hexsha": "20872558db78c427a356be39e0d98a831b0af36e", "size": 1842, "ext": "py", "lang": "Python", "max_stars_repo_path": "mnist-cnn.py", "max_stars_repo_name": "tanviroy/fed-ml", "max_stars_repo_head_hexsha": "1a5973b4fa731bbda120e5a0873106d680e69c7f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max... |
/*
* Copyright (c) 2009-2013 Charlie Wiseman, Jyoti Parwatikar, John DeHart
* and Washington University in St. Louis
*
* 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.ap... | {"hexsha": "7216974c02b51f6ee232a5cd14d7186d78b4d424", "size": 41600, "ext": "cc", "lang": "C++", "max_stars_repo_path": "crd/onlcrd_component.cc", "max_stars_repo_name": "WU-ARL/ONLdaemons", "max_stars_repo_head_hexsha": "d01e84a1fb80065d2e2ab7dca5b6f2c72313760f", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
import argparse
import sys
import time
import numpy as np
sys.path.append('./')
from ml_utils import nnet_utils
from ml_utils import search_utils
from environments import env_utils
parser = argparse.ArgumentParser()
parser.add_argument('--env', type=str, default='cube3', help="Environment: cube3, cube4")
parser.add_... | {"hexsha": "e4674796faf34bc5c789ba6554273643e7190e91", "size": 3889, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/scripts/testNnet.py", "max_stars_repo_name": "19428861/DeepCube-and-DeepCubePlus", "max_stars_repo_head_hexsha": "2b980623242e287580b5ae4c8b4a03dce70a87e5", "max_stars_repo_licenses": ["MIT"]... |
"""
```
imgb = binarize(Balanced(), img)
binarize!(Balanced(), img)
```
By balancing both side of the images histogram the threshold is iterativly
updated to balance both by removing a bin untill sides untill converge to a value.
# Arguments
The function arguments are described in more detail below.
##... | {"hexsha": "1023e6ed07babaa2c13e20f6acf7a443520c62c4", "size": 1319, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/balanced.jl", "max_stars_repo_name": "betttris13/ImageBinarization.jl", "max_stars_repo_head_hexsha": "51ba2f5af0453c38df5f29509c15c98b82a7e3ba", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
import scipy.stats.stats as stats
import pandas.core.algorithms as algos
#from sklearn.utils.validation import check_is_fitted
from sklearn.utils import check_array
pd.options.mode.chained_assignment = None
class Monotoni... | {"hexsha": "bc70f78f643f6fefb82fec40a387f1902c367edb", "size": 11854, "ext": "py", "lang": "Python", "max_stars_repo_path": "xverse/transformer/_binning.py", "max_stars_repo_name": "itsamejoshab/XuniVerse", "max_stars_repo_head_hexsha": "54d71b9e8bba76c200850f0c774d4159867d0b9f", "max_stars_repo_licenses": ["MIT"], "ma... |
using JuliaDB, UUIDs
using CSV, Tables
import IntervalSets: width, (..), AbstractInterval, leftendpoint
function DungBase.AbstractTimeLine(x)
files = Vector{VideoFile}(undef, length(x))
for i in rows(x)
files[i.index] = VideoFile(i.file_name, i.date_time, Millisecond(Nanosecond(i.duration)))
end
... | {"hexsha": "ccfb9117eb730b46525c93207d06a21daddb9f5b", "size": 4460, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/load_from_csv.jl", "max_stars_repo_name": "JuliaTagBot/DungAnalyse.jl", "max_stars_repo_head_hexsha": "2fa61a34af72aa28ad1f77fcacfc6f39022d601a", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
//
// Boost.Process
// ~~~~~~~~~~~~~
//
// Copyright (c) 2006, 2007 Julio M. Merino Vidal
// Copyright (c) 2008, 2009 Boris Schaeling
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
/**
* \file bo... | {"hexsha": "04e55c8a5cf610d0fca5f27046b814939bfbe3f4", "size": 2345, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/boost/boost/process/win32_operations.hpp", "max_stars_repo_name": "Kingston-kms/PayDayCoin", "max_stars_repo_head_hexsha": "e8824033d634048fa88ef3dce4cb67ca41294d47", "max_stars_repo_licenses": ... |
function [] = visGaussianClassLearning(RBM);
%-----------------------------------------
% [] = visGaussianClassLearning(RBM);
%-----------------------------------------
% DES
nVis = floor(sqrt(size(RBM.W,1))).^2;
subplot(331);
scatter(RBM.auxVars.batchX(:,1),RBM.auxVars.batchX(:,2),'r.');
title('Batch Data');
xlim... | {"author": "dustinstansbury", "repo": "medal", "sha": "f33110422ed937f97aaaf3aeb24338c6f13536d7", "save_path": "github-repos/MATLAB/dustinstansbury-medal", "path": "github-repos/MATLAB/dustinstansbury-medal/medal-f33110422ed937f97aaaf3aeb24338c6f13536d7/visualizations/visGaussianClassLearning.m"} |
\documentclass[12pt]{article}
\usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{bm}
\usepackage{amsmath}
\usepackage{amssymb,amsmath}
\usepackage{listings}
\usepackage{titling}
\usepackage{color}
\usepackage{enumitem}
\usepackage{fancyvrb}
\usepack... | {"hexsha": "f7d488bd09980f6c4b7d2dbef815318ea39f07a3", "size": 13571, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "HW3 - Optimal Economic Dispatch/ZHAO_FRANKLIN_HW3.tex", "max_stars_repo_name": "QinganZhao/Energy-Systems-and-Control", "max_stars_repo_head_hexsha": "ef55c598c2475f4fb3aa9cc9cdae89457e7bae16", "ma... |
import re
import sysconfig
from subprocess import check_output
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
import numpy
extra_compile_args = ['-std=c++11']
# Super hacky way of determining if clang or gcc is being used
CC = sysconfig.get_config_vars().get('CC', 'gcc').s... | {"hexsha": "f5470f147b897fcef24de5e39b14379aabb3f68f", "size": 1089, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "arunchaganty/riemannian-nlp", "max_stars_repo_head_hexsha": "bcaa0590a6be22e1cd2103dd12835400f35f170d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as sp
import random as rm
import matplotlib.pyplot as plt
import math
import numpy as np
import scipy.interpolate as si
n = 100000
def empirica ():
empiricos=[]
x = np.array([1,2,3,4,5,6,7,8])
frec=[0.06, 0.15, 0.20 ,0.10, 0.18, 0.12, ... | {"hexsha": "ad1269a2df527d8ee3f60c2986d9146f760d66cf", "size": 1027, "ext": "py", "lang": "Python", "max_stars_repo_path": "TP2_2/Empirica.py", "max_stars_repo_name": "NicolasBologna/Simulacion", "max_stars_repo_head_hexsha": "d407379b182a373d9f28ca74c25472e711b5fc0f", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
# -*- coding: utf-8 -*-
# ====================================== #
# @Author : Yanbo Han
# @Email : yanbohan98@gmail.com
# @File : conf.py
# ALL RIGHTS ARE RESERVED UNLESS STATED.
# ====================================== #
import os
import logging
import numpy as np
PROJECT_ROOT = os.path.abspath(os.path.dirna... | {"hexsha": "8815bc84c0a38fd3a6a22cb8951bcb995f3bf33e", "size": 527, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyGTOInt/conf/conf.py", "max_stars_repo_name": "saltball/pyGTOInt", "max_stars_repo_head_hexsha": "d887ccf0b79879099e4827d71fb821a37fd8e700", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
import os
import matplotlib.pyplot as plt
import numpy as np
import torch
from datetime import datetime
from configparser import ConfigParser
def getconfigparser(config_path):
parser = ConfigParser()
parser.read(config_path)
return parser
def log_generator(train_theme_name,
... | {"hexsha": "4ca13773bc456b374c70ee899ffc7caabb39d0b0", "size": 4074, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/train_utils.py", "max_stars_repo_name": "KingH12138/yolov1-pytorch", "max_stars_repo_head_hexsha": "5e5937f15aea45d1da5934947c584937f870ae2e", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
import math
import numpy as np
from plotly import graph_objects as go
from plotly.subplots import make_subplots
from src.bsl_python.GUI.visualizations.visualization import Visualization
class AllChannelsTRF(Visualization):
trf = None
list_electrodes = []
height = 0.98
def __init__(self, trf, list_el... | {"hexsha": "ceb94ee742293888833820d5a1e6b9946cfa77e3", "size": 1944, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/bsl_python/GUI/visualizations/all_channels_trf.py", "max_stars_repo_name": "Rechenmann-Data-EIRL/BSLPy", "max_stars_repo_head_hexsha": "45f037d00c7f171bc5f63784e181f82eb909c8c4", "max_stars_re... |
#include <boost/array.hpp>
int main()
{
boost::array<int, 3> a{};
return a[0];
}
| {"hexsha": "d93b8db34c1f56a61fbe2734e802e5bbdf954f94", "size": 86, "ext": "cc", "lang": "C++", "max_stars_repo_path": "test/array_test.cc", "max_stars_repo_name": "cirrostratus1/rules_boost", "max_stars_repo_head_hexsha": "8a084196b14a396b6d4ff7c928ffbb6621f0d32c", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
import numpy as np
from collections import OrderedDict
from theano import function
from theano import shared
def make_shared(shape):
"""
Returns a theano shared variable containing a tensor of the specified
shape.
You can use any value you want.
"""
return shared(np.zeros(shape))
def exchang... | {"hexsha": "727c5b356a1d8c3bcd41da633e55688bc2cac32b", "size": 1430, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebook/05_shared_soln.py", "max_stars_repo_name": "ckrapu/pymc3-gpu-docker", "max_stars_repo_head_hexsha": "a2df0836b03148289d8fd488c2be1b6aac2ac7cc", "max_stars_repo_licenses": ["BSD-3-Clause"]... |
[STATEMENT]
lemma FrameStatEqClosed:
fixes F :: "'b frame"
and G :: "'b frame"
and p :: "name prm"
assumes "F \<simeq>\<^sub>F G"
shows "(p \<bullet> F) \<simeq>\<^sub>F (p \<bullet> G)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. p \<bullet> F \<simeq>\<^sub>F p \<bullet> G
[PROOF STEP]
using ass... | {"llama_tokens": 214, "file": "Psi_Calculi_Frame", "length": 2} |
# ---
# title: 1240. Tiling a Rectangle with the Fewest Squares
# id: problem1240
# author: Tian Jun
# date: 2020-10-31
# difficulty: Hard
# categories: Dynamic Programming, Backtracking
# link: <https://leetcode.com/problems/tiling-a-rectangle-with-the-fewest-squares/description/>
# hidden: true
# ---
#
# Given a rec... | {"hexsha": "dc520d6fb845aff4a6d054ff10bab1081fc432a6", "size": 1177, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/unresolved/1240.tiling-a-rectangle-with-the-fewest-squares.jl", "max_stars_repo_name": "jmmshn/LeetCode.jl", "max_stars_repo_head_hexsha": "dd2f34af8d253b071e8a36823d390e52ad07ab2e", "max_stars... |
import torch
import torch.nn as nn
import torchvision
import numpy as np
from sacred import Experiment
from lib.datasets import ds
from lib.datasets import SequentialHdF5Dataset
from lib.model import net
from lib.model import WorldModel, VRNN
from lib.metrics import compute_video_ar, compute_video_psnr_and_ssim
from ... | {"hexsha": "e93967faf5160af94416c0120f53673fdb4a11e7", "size": 8033, "ext": "py", "lang": "Python", "max_stars_repo_path": "eval_model.py", "max_stars_repo_name": "pemami4911/symmetric-and-object-centric-world-models", "max_stars_repo_head_hexsha": "8a03b08fc840d47602afeffba1a106651becd826", "max_stars_repo_licenses": ... |
import cv2 as cv
import rospy as rp
import numpy as np
from cv_bridge import CvBridge
from sensor_msgs.msg import Image
from matplotlib import pyplot as plt
import threading
class imageViewNode():
'''
A node with a basic GUI to show the spinnaker images
using OpenCV's high GUI
'''
def __in... | {"hexsha": "a8d6c5226a7292beec23ed60b6649afea7c05651", "size": 3976, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/image_view.py", "max_stars_repo_name": "MikeK4y/spinnaker_driver_ros", "max_stars_repo_head_hexsha": "fb3b351eca2764fe6d5414e60b9c755cfd040561", "max_stars_repo_licenses": ["MIT"], "max_st... |
#' rcusum - An Implementation of Cusum Control Charts as an R package
#'
#' This R Package implements the charts as described by _Rogers et al. (2004, doi:10.1016/j.jtcvs.2004.03.011)_. Cusum control charts are devices for monitoring arbitrary processes for a prespecified event. This package and manual uses the term fa... | {"hexsha": "c820ef0eba562f7d6b9e92ef0da656fa139bb717", "size": 900, "ext": "r", "lang": "R", "max_stars_repo_path": "R/RCusum-package.r", "max_stars_repo_name": "meyera/rcusum", "max_stars_repo_head_hexsha": "c3bc90d4abeedb9318672bad6f5db8f4a3ffbda3", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_stars... |
####
#### [x|y|x2|y2]title[!]
####
"""
$SIGNATURES
Internal function to set the title of axes (`el==:title`) or axis objects (`el==:xtitle`...).
"""
function _title(el::Symbol, text::String=""; axes=nothing, opts...)
axes = check_axes(axes)
# retrieve on what object to apply the title either the current a... | {"hexsha": "3e03374b2fbd48f31977f718b11a662a3dba7a3b", "size": 3115, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/ax_elem.jl", "max_stars_repo_name": "tlienart/GPlot.jl", "max_stars_repo_head_hexsha": "c9dc537329b237b45dfb38442a89ad1868fdd0db", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10, "ma... |
[STATEMENT]
lemma star_partitions_elim:
assumes "x @ z \<in> A\<star>" "x \<noteq> []"
shows "\<exists>(u, v) \<in> Partitions (x @ z). strict_prefix u x \<and> u \<in> A\<star> \<and> v \<in> A\<star>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<exists>(u, v)\<in>Partitions (x @ z). strict_prefix u x \<and... | {"llama_tokens": 936, "file": "Myhill-Nerode_Myhill_2", "length": 8} |
#!/usr/bin/env python
#
# Copyright (C) 2019
# Christian Limberg
# Centre of Excellence Cognitive Interaction Technology (CITEC)
# Bielefeld University
#
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistribu... | {"hexsha": "7a8c6ed7c62019f16479d5d157e0fce3cc335e24", "size": 6302, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dbscan.py", "max_stars_repo_name": "limchr/A2VQ", "max_stars_repo_head_hexsha": "2c252070f3ded94801d5be5d05bd7145eff6b515", "max_stars_repo_licenses": ["MIT", "Unlicense"], "max_stars_count": ... |
import numpy as np
import json
import pandas as pd
import torch
import os
from tqdm import tqdm
from plot_curve import plot_curve
import matplotlib.pyplot as plt
train_h = 1.9
test_h = 2.0
h_max = max(train_h, test_h)
path = 'dataset/ihdp/ihdp.csv'
save_path = 'dataset/ihdp/ihdp_v2/tr_h_{:02}_te_l_{:02}_h{:02}'.form... | {"hexsha": "6feba08422aedc4710f231c2c9e3a108c93f5251", "size": 5041, "ext": "py", "lang": "Python", "max_stars_repo_path": "Continuous/data/ihdp_generate_data.py", "max_stars_repo_name": "hlzhang109/TransTEE", "max_stars_repo_head_hexsha": "00e6977147a6dcb3e83f1fe70cd1f4cbef7321a4", "max_stars_repo_licenses": ["MIT"], ... |
# coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | {"hexsha": "86e9db5d11a0c0976ea28af97877993d14a46da2", "size": 5023, "ext": "py", "lang": "Python", "max_stars_repo_path": "value_dice/data_utils.py", "max_stars_repo_name": "jrmendeshurb/google-research", "max_stars_repo_head_hexsha": "f9fa8cdd2fb77975b524371fd29df008b9dc6cf4", "max_stars_repo_licenses": ["Apache-2.0"... |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | {"hexsha": "fe2afed0a0854ff2afd65686bc0a26ad51bb7ada", "size": 13768, "ext": "py", "lang": "Python", "max_stars_repo_path": "model_zoo/research/cv/midas/src/midas_net.py", "max_stars_repo_name": "wang121201/mindspore", "max_stars_repo_head_hexsha": "d16e9bc3f689cf0b52c15a4566f5aad2c54a236e", "max_stars_repo_licenses": ... |
include((@__DIR__)*"/../preamble.jl")
include("reflecting_model/model_def.jl")
include("default_params.jl")
pth = mkpath("hitting_times_model/reflecting_model/transient_distribution/point_mass/datat2/errors")
ic_string = "point_mass"
let
idx = [1
1001
2001
3001
4001
5001
6001
7001
... | {"hexsha": "ac2730d7e2f65847de35ebf4cb768c3b16a29c08", "size": 5371, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "hitting_times_model/evolved_errors.jl", "max_stars_repo_name": "angus-lewis/DFQExamples.jl", "max_stars_repo_head_hexsha": "1dc23e42205e985a16552e4c4b21e4472525e36b", "max_stars_repo_licenses": ["M... |
[STATEMENT]
lemma stdz_insert_Ide_Std:
shows "\<lbrakk>\<Lambda>.Ide u; seq [u] U; Std U\<rbrakk> \<Longrightarrow> stdz_insert u U = stdz_insert (hd U) (tl U)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>\<Lambda>.Ide u; seq [u] U; Std U\<rbrakk> \<Longrightarrow> stdz_insert u U = stdz_insert (hd U... | {"llama_tokens": 8715, "file": "ResiduatedTransitionSystem_LambdaCalculus", "length": 28} |
import numpy as np
from itertools import permutations
from hypothesis import assume, given, settings
from hypothesis import strategies as st
from qflow.wavefunctions.nn.layers import DenseLayer
from qflow.wavefunctions import Dnn, InputSorter
@given(P=st.integers(1, 20), D=st.integers(1, 3))
@settings(deadline=None)... | {"hexsha": "0b7bce43181e3dbf137f9d6a90ea7a964d178354", "size": 1540, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_input_sorter.py", "max_stars_repo_name": "johanere/qflow", "max_stars_repo_head_hexsha": "5453cd5c3230ad7f082adf9ec1aea63ab0a4312a", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
import sys
sys.path.insert(0, "../")
from nn_models import model2 as md
from data import formatImage
import matplotlib.image as image
"""
This initalizes a neural net with a given file and test the file on a given image.
"""
inputSize = 28 * 28 # the pixels space
outputSize = 10 # the number of c... | {"hexsha": "a0f6d1a26af5744b67c979e9951f2099d0c7f154", "size": 2129, "ext": "py", "lang": "Python", "max_stars_repo_path": "neural_networks/pic_nn.py", "max_stars_repo_name": "bguta/neural_network", "max_stars_repo_head_hexsha": "ffa6383749783001d938c11fb0ca116aa4b98f07", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
[STATEMENT]
lemma equal_num0_code [code]:
"equal_class.equal Num0 Num0 = True"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. equal_class.equal Num0 Num0 = True
[PROOF STEP]
by(rule equal_refl) | {"llama_tokens": 82, "file": null, "length": 1} |
import librosa
import numpy as np
def compute_melgram(audio_path):
''' Compute a mel-spectrogram and returns it in a shape of (1,1,96,1366), where
96 == #mel-bins and 1366 == #time frame
parameters
----------
audio_path: path for the audio file.
Any format supported by audioread w... | {"hexsha": "f3bd306628213e5e31f30194c640902eda144a46", "size": 1221, "ext": "py", "lang": "Python", "max_stars_repo_path": "audio_processor.py", "max_stars_repo_name": "mvxxx/music-auto_tagging-keras", "max_stars_repo_head_hexsha": "17236885f10f014258f50047b30b819ca386ea7e", "max_stars_repo_licenses": ["MIT"], "max_sta... |
"""Machinery to parse columns in accordance with their unit indicator.
Parsers to convert column values of uncontrolled data types into values with a data type
consistent with the intended representation given the column's unit indicator.
A data-type-specific parser is implemented for each of the allowable StarTable ... | {"hexsha": "80a0d2633450bc2969fce22d875b9f7be0967778", "size": 6936, "ext": "py", "lang": "Python", "max_stars_repo_path": "pdtable/io/parsers/columns.py", "max_stars_repo_name": "vegatheil/pdtable", "max_stars_repo_head_hexsha": "580fa7b0635d7d90c55bbfcbd77c06a3d19f16bc", "max_stars_repo_licenses": ["BSD-3-Clause"], "... |
# -*- coding: utf-8 -*-
# @Date : 2020/4/27
# @Author: Luokun
# @Email : olooook@outlook.com
import numpy
import torch
from torch.utils.data import DataLoader, TensorDataset
def generate_datasets(data: torch.Tensor, pph, hours):
steps = [hour * pph for hour in hours]
step_max = max(steps)
X = torch.stac... | {"hexsha": "a359b94f7c075969511169323e76323bee300459", "size": 1522, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools/data.py", "max_stars_repo_name": "lk485/matgcn", "max_stars_repo_head_hexsha": "d3f47b8db5895f9fa64c79863757e37f535b7b69", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 19, "max_sta... |
import argparse
import seaborn as sns
import pandas as pd
import numpy as np
import config
import os
from data_loader import get_baseline
def figsize_column(scale, height_ratio=1.0):
fig_width_pt = 244 # Get this from LaTeX using \the\columnwidth
inches_per_pt = 1.0 / 72.27 # Convert pt to inch
golden_me... | {"hexsha": "c25a536c89eacd8c59d2b53c2b9fad88d5e3ce91", "size": 4679, "ext": "py", "lang": "Python", "max_stars_repo_path": "figures.py", "max_stars_repo_name": "HelgeS/predml4copboundaries", "max_stars_repo_head_hexsha": "e536c2677509c03e4c76e1f37b7c78361c1dec57", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
# Function for Event-Related fMRI
from __future__ import absolute_import, division, print_function
import numpy as np
from scipy.stats import gamma
# getting the peak (for this specific hrf function)
peak_value = gamma.pdf(4.91, 6)
undershoot_value = gamma.pdf(4.91, 12)
max_value = peak_value - 0.35 * undershoot_valu... | {"hexsha": "e4d00dcd17cd070979d2afb986497c6125aa8994", "size": 7473, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/utils/functions/event_related_fMRI_functions.py", "max_stars_repo_name": "berkeley-stat159/project-alpha", "max_stars_repo_head_hexsha": "330d025c4eda94d390a82e86deecb791086c9dbf", "max_stars... |
import numpy as np
import math
from scipy.special import gammainc, gammaincc
def geofractal(PN,df,k0,cormodel):
"""
--------------------------------------------------------------------------------
Python version of GEOFRACTAL version 1.0
-----------------------------------------------------... | {"hexsha": "42b0a3a82a10d6ec9fcc14f78f07c0ae7e0a3540", "size": 3669, "ext": "py", "lang": "Python", "max_stars_repo_path": "geofractal_python/geofractal.py", "max_stars_repo_name": "rtazaki1205/geofractal", "max_stars_repo_head_hexsha": "6effd47e418bc759b9437424720fbbdf2663b5a2", "max_stars_repo_licenses": ["MIT"], "ma... |
__all__ = [
"_construct_instance",
"_make_args",
"_assert_almost_equal"
]
__author__ = ["Markus Löning"]
import numpy as np
import pandas as pd
from sktime.classification.base import is_classifier
from sktime.forecasting.base import is_forecaster
from sktime.regression.base import is_regressor
from sktime.... | {"hexsha": "42464341e997b1b90f55cce11cbdd46909bbf489", "size": 5585, "ext": "py", "lang": "Python", "max_stars_repo_path": "sktime/utils/_testing/__init__.py", "max_stars_repo_name": "brettkoonce/sktime", "max_stars_repo_head_hexsha": "6336247bad0dac8692aa4b911c267f401dea4163", "max_stars_repo_licenses": ["BSD-3-Clause... |
\documentclass[12]{scrartcl}
\usepackage{amssymb,amsmath,gensymb,dsfont,calc,multicol,fullpage}
\makeatletter
\newcommand\Aboxed[1]{
\@Aboxed#1\ENDDNE}
\def\@Aboxed#1\ENDDNE{%
&
\settowidth\@tempdima{$\displaystyle#1{}$}
\setlength\@tempdima{\@tempdima+\fboxsep+\fboxrule}
\kern-\@tempdima
\boxed{#1... | {"hexsha": "4f04b5cf4162804ca92c74bf6d9034a97cee3268", "size": 1328, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "LinearAlgebra/Homework22.tex", "max_stars_repo_name": "alexggordon/latex", "max_stars_repo_head_hexsha": "7dd945f33490e6585e26cff39d9cf6ad8f582a0e", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import torch
import torch.optim as optim
import numpy as np
def to_numpy(v):
if torch.is_tensor(v):
return v.cpu().numpy()
return v
def count_parameters(model):
return sum(p.numel() for p in model.parameters() if p.requires_grad)
class Rescaler:
def __init__(self, data):
channels =... | {"hexsha": "90ea30c2dd4e36bee4c863d93b5c3a40dc7776bf", "size": 1099, "ext": "py", "lang": "Python", "max_stars_repo_path": "time-series/utils.py", "max_stars_repo_name": "steveli/partial-encoder-decoder", "max_stars_repo_head_hexsha": "402abdb97b1cdfcca2a30b05507cd97be560ee75", "max_stars_repo_licenses": ["MIT"], "max_... |
(*
Title: Psi-calculi
Author/Maintainer: Jesper Bengtson (jebe@itu.dk), 2012
*)
theory Weak_Congruence
imports Weak_Cong_Struct_Cong Bisim_Subst
begin
context env begin
definition weakCongruence :: "('a, 'b, 'c) psi \<Rightarrow> ('a, 'b, 'c) psi \<Rightarrow> bool" ("_ \<doteq>\<^sub>c _" [70, 70] 65)
wh... | {"author": "data61", "repo": "PSL", "sha": "2a71eac0db39ad490fe4921a5ce1e4344dc43b12", "save_path": "github-repos/isabelle/data61-PSL", "path": "github-repos/isabelle/data61-PSL/PSL-2a71eac0db39ad490fe4921a5ce1e4344dc43b12/SeLFiE/Example/afp-2020-05-16/thys/Psi_Calculi/Weak_Congruence.thy"} |
include("get_div_grad.jl")
function test_cgs()
cgs_tol = 1.0e-6
# Symmetric and positive definite systems (cubic spline matrix).
n = 10
A = spdiagm(-1 => ones(n-1), 0 => 4*ones(n), 1 => ones(n-1))
b = A * [1:n;]
(x, stats) = cgs(A, b)
r = b - A * x
resid = norm(r) / norm(b)
@printf("CGS: Relative re... | {"hexsha": "bcc13888d1d9eb6b24fb08114efd02b4f6cf2bbe", "size": 2163, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_cgs.jl", "max_stars_repo_name": "abelsiqueira/Krylov.jl", "max_stars_repo_head_hexsha": "dc0ca5466f7f1f7e65958fe016e3a06b858e3df0", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
module KnuthBendix
using ProgressMeter
export Word, Alphabet, RewritingSystem, LenLex, knuthbendix
include("abstract_words.jl")
include("words.jl")
include("bufferwords.jl")
include("alphabets.jl")
include("orderings.jl")
include("rules.jl")
include("rewriting.jl")
include("automata.jl")
include("helper_structures.... | {"hexsha": "08cdf51c0e21b0c3701ae08ecd16cf69e6a31de4", "size": 427, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/KnuthBendix.jl", "max_stars_repo_name": "kalmarek/KnuthBendix.jl", "max_stars_repo_head_hexsha": "74f6bdbb804723f88cb8ed1b60bb27b3e839576b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
"""
main.py
Main Segment of DeepND
Bilkent University, Department of Computer Engineering
Ankara, 2020
"""
import sys
import pickle
import numpy as np
import pandas as pd
import os
# Default parameter settings
root = "" # Current directory
trial = 10 # Number of trials to train | Default : 10
k... | {"hexsha": "1f3c3a7ba2d2b60e2db877e6a221ad36aae65a66", "size": 8237, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "ciceklab/DeepND", "max_stars_repo_head_hexsha": "ea01eed3c83035ce088522785a134947c645a7a3", "max_stars_repo_licenses": ["CNRI-Python", "Linux-OpenIB"], "max_stars... |
import os
import io
import pytest
import tempfile
import xarray as xr
import pandas as pd
import numpy as np
import types
import argopy
from argopy.utilities import (
load_dict,
mapp_dict,
list_multiprofile_file_variables,
check_localftp,
isconnected,
isAPIconnected,
erddap_ds_exists,
l... | {"hexsha": "e6d122db3cee2649056e2ed6d026d9f2e9d98f56", "size": 13523, "ext": "py", "lang": "Python", "max_stars_repo_path": "argopy/tests/test_utilities.py", "max_stars_repo_name": "schwehr/argopy", "max_stars_repo_head_hexsha": "1b35d5cfb87b2f9ccd2ca45b9987a614edd30700", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
"""
```
FEMParameters(;
type::AbstractMesh,
order::AbstractElementOrder,
model::AbstractModel,
dx, dy, dz, mx, my, mz
)
```
Creates [`FEMParameters`](@ref).
"""
function FEMParameters(;
type::AbstractMesh,
order::AbstractElementOrder,
model::AbstractModel,
dx,
dy,
dz,
mx,
... | {"hexsha": "0813fc7ee8d5de4e868daca48dcc6deea3fa678c", "size": 26542, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Type/FEMConstructor.jl", "max_stars_repo_name": "dcelisgarza/DDD", "max_stars_repo_head_hexsha": "9257c619240a2b3bbdddd813d5e08ab71a07f7be", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
import unittest
import numpy as np
from numpy.testing import assert_almost_equal
from dymos.utils.hermite import hermite_matrices
class TestHermiteMatrices(unittest.TestCase):
def test_quadratic(self):
# Interpolate with values and rates provided at [-1, 1] in tau space
tau_given = [-1.0, 1.0]... | {"hexsha": "5da47e4e4410b3e8309f308ed349c9a9599c9032", "size": 2225, "ext": "py", "lang": "Python", "max_stars_repo_path": "dymos/utils/test/test_hermite.py", "max_stars_repo_name": "kaushikponnapalli/dymos", "max_stars_repo_head_hexsha": "3fba91d0fc2c0e8460717b1bec80774676287739", "max_stars_repo_licenses": ["Apache-2... |
"""
You don't have to edit this script.
You may, however change the value of MAX_STEPS.
"""
MAX_STEPS = 10000
import gym
from pyglet.window import key
import numpy as np
import pickle
import os
from datetime import datetime
import gzip
import json
# From CarRacing-v0's Documentation
def key_press(k, mod):
# gl... | {"hexsha": "1696843d0ffab51de8babf0b7c578d2c7693e2b7", "size": 3117, "ext": "py", "lang": "Python", "max_stars_repo_path": "ImitationLearning/manual.py", "max_stars_repo_name": "CrypthiccCrypto/Intro-to-RL-2021", "max_stars_repo_head_hexsha": "d1f4e632dad9895c53cf6f4d32a9f514a651a685", "max_stars_repo_licenses": ["MIT"... |
[STATEMENT]
lemma preservation_eq:
assumes "\<Theta>; \<Phi>; \<Delta> \<turnstile> \<langle> \<delta> , AS_let x (AE_op Eq (V_lit (n1)) (V_lit (n2))) s' \<rangle> \<Leftarrow> \<tau>"
shows "\<Theta>; \<Phi>; \<Delta> \<turnstile> \<langle> \<delta> , AS_let x (AE_val (V_lit (((if (n1 = n2) then L_true el... | {"llama_tokens": 3574, "file": "MiniSail_Safety", "length": 15} |
import os
import sys
import glob
import time
import numpy as np
import copy as copy
import tensorflow as tf
from tensorflow.python import pywrap_tensorflow
from env.env import Env
from learning.ppo_agent import PPOAgent
from learning.solvers.mpi_solver import MPISolver
import learning.tf_util as TFUtil
import tf_util_... | {"hexsha": "c6dd937d91cc1a37d21b2acf5d10fca337e4ce96", "size": 47120, "ext": "py", "lang": "Python", "max_stars_repo_path": "TMT/scripts/carl_ppo_agent.py", "max_stars_repo_name": "inventec-ai-center/transition_motion_tensor", "max_stars_repo_head_hexsha": "902814c399b9e7a62230ef240e40616eb579b514", "max_stars_repo_lic... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.