text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
"""
ABCDParams
A structure holding parameters for ABCD graph generator. Fields:
* w::Vector{Int}: a sorted in descending order list of vertex degrees
* s::Vector{Int}: a sorted in descending order list of cluster sizes
* μ::Union{Float64, Nothing}: mixing parameter
* ξ::Union{Float64, Nothi... | {"hexsha": "a5f1f6d6cd99a3c88775c3ebb764db6304ec388a", "size": 12920, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/graph_sampler.jl", "max_stars_repo_name": "bkamins/ABCDGraphGenerator.jl", "max_stars_repo_head_hexsha": "4a1494e64479f52b48185ca746b8205696531c7d", "max_stars_repo_licenses": ["MIT"], "max_st... |
export
AVRESAMPLE_MAX_CHANNELS,
AVAudioResampleContext,
AVMixCoeffType,
AV_MIX_COEFF_TYPE_Q8,
AV_MIX_COEFF_TYPE_Q15,
AV_MIX_COEFF_TYPE_FLT,
AV_MIX_COEFF_TYPE_NB,
AVResampleFilterType,
AV_RESAMPLE_FILTER_TYPE_CUBIC,
AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL,
AV_RESAMPLE_FILTER... | {"hexsha": "3ba4625317f22ec9fe30cbd33d70d3f85a641e9a", "size": 1538, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/libav/AVResample/v1/libavresample_h.jl", "max_stars_repo_name": "JuliaPackageMirrors/VideoIO.jl", "max_stars_repo_head_hexsha": "8c5d40085aab36cd69be4f0772681f8409f11b87", "max_stars_repo_licen... |
[STATEMENT]
lemma basis_iff_rank_of:
assumes "X \<subseteq> carrier"
shows "basis X \<longleftrightarrow> rank_of X = card X \<and> rank_of X = rank_of carrier"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. basis X = (rank_of X = card X \<and> rank_of X = rank_of carrier)
[PROOF STEP]
proof (standard, goal_case... | {"llama_tokens": 2964, "file": "Matroids_Matroid", "length": 41} |
#################################################################################################
# Load Packages
#################################################################################################
cd(@__DIR__)
using Pkg
Pkg.activate("..")
using Revise, PAAV, Plots, DataFrame... | {"hexsha": "7cec5821d513e7258c2dac39aaac25e167e37667", "size": 1608, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "validation/Ratio Effect Validation.jl", "max_stars_repo_name": "itsdfish/VisualSearchACTR.jl", "max_stars_repo_head_hexsha": "d440c686b8bdfaf1d7e467f784bdb349938f99a2", "max_stars_repo_licenses": [... |
[STATEMENT]
lemma powser_ms_aux_asymp_powser:
assumes "asymp_powser h at_top f cs" and basis: "basis_wf bs"
assumes "is_expansion_aux xs h bs" "ms_exp_gt 0 (ms_aux_hd_exp xs)"
shows "is_expansion_aux (powser_ms_aux' cs xs) f bs"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. is_expansion_aux (powser_ms_aux' ... | {"llama_tokens": 9776, "file": null, "length": 43} |
subsection \<open> Design Hoare Logic \<close>
theory utp_des_hoare
imports utp_des_prog
begin
definition HoareD :: "'s upred \<Rightarrow> 's hrel_des \<Rightarrow> 's upred \<Rightarrow> bool" ("{_}_{_}\<^sub>D") where
[upred_defs, ndes_simp]: "HoareD p S q = ((p \<turnstile>\<^sub>n \<lceil>q\<rceil>\<^sub>>) \<... | {"author": "isabelle-utp", "repo": "utp-main", "sha": "27bdf3aee6d4fc00c8fe4d53283d0101857e0d41", "save_path": "github-repos/isabelle/isabelle-utp-utp-main", "path": "github-repos/isabelle/isabelle-utp-utp-main/utp-main-27bdf3aee6d4fc00c8fe4d53283d0101857e0d41/theories/designs/utp_des_hoare.thy"} |
import shutil
from os.path import exists as _exists
from osgeo import gdal, osr
import numpy as np
import utm
from ..all_your_base import isfloat
from .geo import get_utm_zone, utm_srid, wgs84_proj4
from .geo_transformer import GeoTransformer
gdal.UseExceptions()
class UtmGeoTransformer:
def __init__(self, ra... | {"hexsha": "c9049b312f838136abe34f3ee13a105f051c7b90", "size": 5822, "ext": "py", "lang": "Python", "max_stars_repo_path": "geo/raster_geo_transformer.py", "max_stars_repo_name": "rogerlew/all_your_base", "max_stars_repo_head_hexsha": "3b6f1cec0d6ad51a93aa1be47e29208a5217061c", "max_stars_repo_licenses": ["BSD-3-Clause... |
! RUN: %S/test_errors.sh %s %t %f18 -fopenmp
! Check OpenMP declarative directives
!TODO: all internal errors
! enable declare-reduction example after name resolution
! 2.8.2 declare-simd
subroutine declare_simd_1(a, b)
real(8), intent(inout) :: a, b
!ERROR: Internal: no symbol found for 'declare_simd_1'
... | {"hexsha": "782cee7c4446be34a534d7b3bac133a1a0bbba62", "size": 1943, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "flang/test/Semantics/omp-declarative-directive.f90", "max_stars_repo_name": "jroelofs/apple-llvm-project", "max_stars_repo_head_hexsha": "ed6b4c087baabbc7331524c56423ce2d9322c8f9", "max_stars_re... |
import os
os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import numpy as np
from modelAE import IM_AE
from modelSVR import IM_SVR
import argparse
import h5py
logfile = open('logfile.txt','w')
logfile.write("in MAIN\n")
logfile.flush()
parser = argparse.ArgumentParser()
parser.ad... | {"hexsha": "dca306c7b06a94736d29ca707dc34e6e7986f178", "size": 2891, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "supriya-gdptl/IM-NET-pytorch", "max_stars_repo_head_hexsha": "c64895471a6b2e60189ae643c045fb6c2eb69a5c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
'''
Created on September 2, 2017
@author: optas
'''
import numpy as np
from . encoders_decoders import encoder_with_convs_and_symmetry, decoder_with_fc_only
def mlp_architecture_ala_iclr_18(n_pc_points, bneck_size, bneck_post_mlp=False):
''' Single class experiments.
'''
if n_pc_points != 2048:
... | {"hexsha": "13674a65131f8b85038d823e977ac6fa328d27c0", "size": 1497, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/ae_templates.py", "max_stars_repo_name": "sinanbayraktar/latent_3d_points", "max_stars_repo_head_hexsha": "3b07edbea5298fa5daa6d04a9cd62041d30d4e86", "max_stars_repo_licenses": ["MIT"], "max_s... |
#!/usr/bin/python
#==============================================================================
# import libraries/files
#==============================================================================
import feedstock
import pp
import gasifier
import numpy as np
#=====================================================... | {"hexsha": "b6e777264aceb8cc680ec5349f9468965f8c0e6e", "size": 1909, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_chap4_fig4_1.py", "max_stars_repo_name": "rodolfo-enq/gasification", "max_stars_repo_head_hexsha": "696cb4cf1d1a27c1b5ab7c328da1c44868a165d9", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
module m
implicit none
contains
subroutine double(i,i2)
integer, intent(in) :: i
integer, intent(out) :: i2
print*,"entering double, i =",i
i2 = 2*i
print*,"leaving double, i =",i
end subroutine double
end module m
!
program overlapping_arg
use m, only: double
implicit none
integer :: j
j = 3
call dou... | {"hexsha": "fd150fc9b4c597db75fc478cdbae844845e576ec", "size": 756, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "overlapping_arg.f90", "max_stars_repo_name": "awvwgk/FortranTip", "max_stars_repo_head_hexsha": "3810038667e3d5d2ab33c39d4bd0f41870025420", "max_stars_repo_licenses": ["Unlicense"], "max_stars_co... |
# -*- coding: utf-8 -*-
import numpy as np
import curses
import time
import sys
class Connect6:
def __init__(self):
self.board_size = (19, 19)
self.board = np.zeros(self.board_size)
self.empty = 0
self.black = 1
self.white = 2
self.connect = 6
... | {"hexsha": "99fbc42743f568a4c124e12ffd07151f8ad0fae1", "size": 9497, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/environment.py", "max_stars_repo_name": "moonbings/connect6_rl", "max_stars_repo_head_hexsha": "18d7bf1779183f847607b6038849b8a0cc33de8f", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
[STATEMENT]
lemma AAss_\<tau>red0r_xt2:
"\<tau>red0r extTA P t h (i, xs) (i', xs') \<Longrightarrow> \<tau>red0r extTA P t h (Val a\<lfloor>i\<rceil> := e, xs) (Val a\<lfloor>i'\<rceil> := e, xs')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<tau>red0r extTA P t h (i, xs) (i', xs') \<Longrightarrow> \<tau>red0... | {"llama_tokens": 236, "file": "JinjaThreads_Compiler_J0", "length": 1} |
# Copyright (c) 2018 Copyright holder of the paper Generative Adversarial Model Learning
# submitted to NeurIPS 2019 for review
# All rights reserved.
import torch
import numpy as np
def create_torch_var_from_paths(data_paths):
observations = torch.from_numpy(data_paths["observations"]).float()
actions = tor... | {"hexsha": "83dfe913d3d98558aff85aa42bfad13f531f2796", "size": 2143, "ext": "py", "lang": "Python", "max_stars_repo_path": "rllab/torch/utils/misc.py", "max_stars_repo_name": "NeurIPSPaperSubmission7934/code_submission", "max_stars_repo_head_hexsha": "713fce673e8e3ba30b559d4eebe6d3e4891069ed", "max_stars_repo_licenses"... |
[STATEMENT]
lemma eval_euler_approx_aux:
"euler_approx_aux 0 = 1"
"euler_approx_aux 1 = 2"
"euler_approx_aux (Suc 0) = 2"
"euler_approx_aux (numeral n) = 1 + numeral n * euler_approx_aux (pred_numeral n)" (is "?th")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (euler_approx_aux 0 = 1 &&& euler_approx_aux 1... | {"llama_tokens": 925, "file": null, "length": 7} |
import typing
import numpy as np
import random
import matplotlib
import torch
import math
import time
matplotlib.use("TKAgg")
import matplotlib.pyplot as plt
# import seaborn as sns
# sns.set(color_codes=True)
from matplotlib.cm import get_cmap
from enum import Enum
import gym
from .utils import NoiseLearningAgents, E... | {"hexsha": "9b535a1fa31c90cfbb24f7e607a70c2237a0c668", "size": 15348, "ext": "py", "lang": "Python", "max_stars_repo_path": "diploma/noise_learning/noise_learning.py", "max_stars_repo_name": "d4glushko/RLGeneralization", "max_stars_repo_head_hexsha": "788bfbfc54fc3a84bcf930e9546ceff45ade9f59", "max_stars_repo_licenses"... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
from . import numba_wrapper
def get_max_component_indices(x):
'''Returns the indices of the maximum components.
Args:
x: Input array.
Returns:
The resulting indices.
'''
inds1 = x.argmax(axis=-1)
inds2 = np.ind... | {"hexsha": "53a0a18c05a677e36a7a3243f1662829cd822548", "size": 1661, "ext": "py", "lang": "Python", "max_stars_repo_path": "fpq/utils.py", "max_stars_repo_name": "Hasenpfote/fpq", "max_stars_repo_head_hexsha": "3154ed1b1d5eca08255e8359b5027439af43691c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
from __future__ import annotations
import subprocess as sp
from ..environment import (
Environment,
Dependency,
HeaderDependency,
LibraryDependency,
ProgramDependency,
Installer,
GurobiInstaller,
)
from ...errors import InstallError, UninstallError
gurobi_python_template = """#!/bin/bash
... | {"hexsha": "80c51c6602ef38bb863c5889c7e8298050b6a062", "size": 5689, "ext": "py", "lang": "Python", "max_stars_repo_path": "dnnv/_manage/linux/verifiers/bab.py", "max_stars_repo_name": "samysweb/dnnv", "max_stars_repo_head_hexsha": "58fb95b7300914d9da28eed86c39eca473b1aaef", "max_stars_repo_licenses": ["MIT"], "max_sta... |
import json
import os
import pickle
import shutil
import cv2
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import timm
import torch
import torch.nn.functional as F
from albumentations import Compose
from albumentations import GaussNoise
from albumentations import HorizontalFlip
from albumentat... | {"hexsha": "71f97541c0f65d8c5f954c757de69f3746a38897", "size": 16307, "ext": "py", "lang": "Python", "max_stars_repo_path": "services/server/model_output.py", "max_stars_repo_name": "NBNARADHYA/bosch-inter-iit", "max_stars_repo_head_hexsha": "a1e80d45acc7287082b7cb18f1386726ced8b316", "max_stars_repo_licenses": ["Apach... |
"""
Featurizers that mostly concern ligand-based models
"""
from __future__ import annotations
from functools import lru_cache
from typing import Union
import numpy as np
import rdkit
from .core import BaseFeaturizer, BaseOneHotEncodingFeaturizer
from ..core.systems import System
from ..core.ligands import (
Bas... | {"hexsha": "b94a93d1d0c3677dacec4c15ed25a1a92ecb35d3", "size": 14789, "ext": "py", "lang": "Python", "max_stars_repo_path": "kinoml/features/ligand.py", "max_stars_repo_name": "schallerdavid/kinoml", "max_stars_repo_head_hexsha": "4eb3ce344bc84d98144b6a13acf45115e27744ca", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# -*- coding: UTF-8 -*-
# **********************************************************************************#
# File: Display rewards
# **********************************************************************************#
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import r... | {"hexsha": "4c00ec383c9eec8c335ebec54056c406834a1937", "size": 8196, "ext": "py", "lang": "Python", "max_stars_repo_path": "section_cmab/display/rewards.py", "max_stars_repo_name": "myron0330/caching-research", "max_stars_repo_head_hexsha": "adb61e6d7246af13d4428254d456618cd6ccf0dc", "max_stars_repo_licenses": ["MIT"],... |
from batman.functions.utils import multi_eval
import numpy.testing as npt
class MultiEval:
def __init__(self):
pass
@multi_eval
def scalar_func(self, x):
return x[0] + 2
@multi_eval
def vector_func(self, x):
return [x[0] + 1, x[0] + 2]
def test_scalar():
func = Mult... | {"hexsha": "db053a17570892be9957f42110eb923fd7d850d5", "size": 696, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_utils.py", "max_stars_repo_name": "tupui/batman", "max_stars_repo_head_hexsha": "559e1c4574865694e47f52bb202c560fc6252d2d", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count"... |
# -*- coding: UTF-8 -*-
import socket
import cv2
import numpy
address = ('127.0.0.1', 8002)
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
sock.connect(address)
capture = cv2.VideoCapture(0)
ret, frame = capture.read()
encode_param=[int(cv2.IMWRITE_JPEG_QUALITY),90]
while ret:
result, imgencode = cv2.i... | {"hexsha": "b283aa8a533a8b80eb9af65253206a3fd80af9c3", "size": 679, "ext": "py", "lang": "Python", "max_stars_repo_path": "mtcnn/client.py", "max_stars_repo_name": "wilkenshuang/facenet", "max_stars_repo_head_hexsha": "31e4b29ca25ead1b9c354a6a314b090de150c2de", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nul... |
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 29 09:40:12 2021
@author: Ryan Kaufman
Set up function module that can assist in loading pulse sequences into AWG
and functionalizing Alazar acquiring
"""
import numpy as np
from mpl_toolkits.axes_grid1 import make_axes_locatable
from matplotlib.patches import Ellipse
fr... | {"hexsha": "a60cf469f28348712c1e0d9738daf178f5674f62", "size": 58133, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_processing/signal_processing/old/Pulse_Processing_utils.py", "max_stars_repo_name": "PITT-HATLAB/data_processing", "max_stars_repo_head_hexsha": "ad49bb921e0fc90b90f0b696e2cbb662019f5f40", "... |
# https://jaeyung1001.tistory.com/45
import numpy as np
import torch.nn as nn
from sklearn.model_selection import GridSearchCV
from skorch import NeuralNetClassifier
from skorch.tests.conftest import F
from common.global_variables import *
from codes.upbit.upbit_order_book_based_data import UpbitOrderBookBasedData
impo... | {"hexsha": "c0d55af334d6324c54374c6c67eca13a704cbca4", "size": 2636, "ext": "py", "lang": "Python", "max_stars_repo_path": "codes/tests/model/model_lstm_2.py", "max_stars_repo_name": "bluebibi/trade", "max_stars_repo_head_hexsha": "32145c2a139f4172159ace8dfad11591ad8839ea", "max_stars_repo_licenses": ["MIT"], "max_star... |
# Copyright (c) 2015 Peter Cerno
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distrib... | {"hexsha": "654a7cdd28239dc8b4efa163c46b0cc1c370eea7", "size": 22593, "ext": "py", "lang": "Python", "max_stars_repo_path": "morningstar/good_morning.py", "max_stars_repo_name": "sagarkolte/morningstar", "max_stars_repo_head_hexsha": "702695f1ffaeb16bbb07b8049f15f8f77c268024", "max_stars_repo_licenses": ["MIT"], "max_s... |
## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
# $Id$
#
# Copyright (C) 2002-2006 greg Landrum and Rational Discovery LLC
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, foun... | {"hexsha": "f5f4f60660afc6ea790e9aaad5411ebc13ac9aa5", "size": 2033, "ext": "py", "lang": "Python", "max_stars_repo_path": "third_party_package/RDKit_2015_03_1/rdkit/Chem/EState/Fingerprinter.py", "max_stars_repo_name": "Ivy286/cluster_basedfps", "max_stars_repo_head_hexsha": "7fc216537f570436f008ea567c137d03ba2b6d81",... |
"""Test the module ensemble classifiers."""
# Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com>
# Christos Aridas
# License: MIT
import numpy as np
import pytest
from sklearn.datasets import load_iris, make_hastie_10_2
from sklearn.model_selection import (
GridSearchCV,
ParameterGrid,
train_te... | {"hexsha": "7382661479d1fce6ea7da9eabed25d3a0c121ed5", "size": 16851, "ext": "py", "lang": "Python", "max_stars_repo_path": "imblearn/ensemble/tests/test_bagging.py", "max_stars_repo_name": "laurallu/imbalanced-learn", "max_stars_repo_head_hexsha": "321b751f90ef8faaec6b39218f8c531893e9e79f", "max_stars_repo_licenses": ... |
%Additionally, as explained in Section \ref{sec:uschema}, models trained to perform link prediction will often suffer from a lack of specificity resulting from learning only to `type check,' i.e. incorrectly predicting that Brad Pitt acted in the movie \emph{The Godfather}. Requiring text provinence makes it much more... | {"hexsha": "a8527aefbab863dacc190073fd1a1527c09c888d", "size": 9596, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/naacl2016/experiments.tex", "max_stars_repo_name": "ken77921/torch-relation-extraction", "max_stars_repo_head_hexsha": "929f39dfb8c2f0b44318378fcd8e75557efbaf9f", "max_stars_repo_licenses": ["MI... |
Thomas H. Frankel is a Davis attorney and philanthropist who was named Davis Citizen of the Year in 1984 for his contributions to the community. He was a trustee at the Explorit Science Center for many years and cofounded the Davis chapter of the Yolo Compassionate Friends with his wife Barbara. In addition to their ... | {"hexsha": "e5b250ce39aeae9b747b7ee0eb789eb58babe069", "size": 677, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Thomas_H._Frankel.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
% Copyright 2017 Emilio Rojas
%
% Permission is hereby granted, free of charge, to any person obtaining a copy of
% this software and associated documentation files (the "Software"), to deal in
% the Software without restriction, including without limitation the rights to
% use, copy, modify, merge, publish, distribute... | {"hexsha": "9b8e5c62ed3e9e1ebcf985e9c1db69293fbf460b", "size": 2538, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "shared/commands.tex", "max_stars_repo_name": "emilio93/ie323-iii2016", "max_stars_repo_head_hexsha": "64a70233a1fc51a988d7b108dc4958bafffe7876", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
import numpy as np
import pyamg
from scipy import sparse
from scipy.spatial import Delaunay
from linsolver import sparse_solver
from triangulation.delaunay import delaunay
class Element:
def __init__(self, points, global_indexes, fem):
self.points = np.array(points)
self.global_indexes = global_i... | {"hexsha": "e07b1d529111d4e2e89b3b1cd2c58ff9446e312f", "size": 6642, "ext": "py", "lang": "Python", "max_stars_repo_path": "fem/fem.py", "max_stars_repo_name": "Pengeace/DGP-PDE-FEM", "max_stars_repo_head_hexsha": "64b7f42ca7083b05f05c42baa6cad21084068d8c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 7, "max... |
# -*- coding: utf-8 -*-
import re
from re import split
from networkx import Graph
from networkx import pagerank
from itertools import combinations
from collections import Counter
import nltk
from konlpy.tag import Okt
from .sentence import Sentence
# from sklearn.feature_extraction.text import TfidfVectorizer
# from... | {"hexsha": "8b2e9f64e263d7a52365b0d357c89f2681ad1e49", "size": 6141, "ext": "py", "lang": "Python", "max_stars_repo_path": "backend/links/textrankr.py", "max_stars_repo_name": "dla1635/hyLink", "max_stars_repo_head_hexsha": "8f3d1b6b0cad57ce2f6861583eb2b523f9fceee7", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
using Test, YaoBlocks, BitBasis
using YaoBlocks: check_dumpload
@testset "check_dumpload" begin
@test check_dumpload(X)
@test check_dumpload(X + Y)
@test check_dumpload(+(put(5, 4 => X), put(5, 5 => X)))
@test check_dumpload(kron(put(1, 1 => X), Y))
@test check_dumpload(kron(5, 2 => X, 4 => Y))
... | {"hexsha": "e33985884296d699046ff3f6e854b0b0ee66f462", "size": 1860, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "lib/YaoBlocks/test/treeutils/dumpload.jl", "max_stars_repo_name": "wildart/Yao.jl", "max_stars_repo_head_hexsha": "f1975d50627ca271ac524866dc64ca96ece0a05a", "max_stars_repo_licenses": ["Apache-2.0... |
[STATEMENT]
lemma conv_abscissa_MInf_iff: "conv_abscissa (f :: 'a fds) = -\<infinity> \<longleftrightarrow> (\<forall>s. fds_converges f s)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (conv_abscissa f = - \<infinity>) = (\<forall>s. fds_converges f s)
[PROOF STEP]
proof safe
[PROOF STATE]
proof (state)
goal (2 s... | {"llama_tokens": 857, "file": "Dirichlet_Series_Dirichlet_Series_Analysis", "length": 8} |
// Copyright (c) 2015-2018 Daniel Cooke
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#ifndef threshold_filter_factory_hpp
#define threshold_filter_factory_hpp
#include <memory>
#include <vector>
#include <string>
#include <boost/optional.hpp>
#include "logging/pro... | {"hexsha": "44fc1aaeb4fd544a4e99a0e98df3f9bc62448825", "size": 2140, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/core/csr/filters/threshold_filter_factory.hpp", "max_stars_repo_name": "alimanfoo/octopus", "max_stars_repo_head_hexsha": "f3cc3f567f02fafe33f5a06e5be693d6ea985ee3", "max_stars_repo_licenses": [... |
class train:
'''
Can be run to train a new network on a dataset and save the model as a checkpoint
Prints out training loss, validation loss, and validation accuracy as the network trains
Last update: 03/30, 05:47
Basic usage:
-----------
python train.py data_directory
Sum... | {"hexsha": "1b03a12da353d547b044014ee087c4f56904d5d8", "size": 3641, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "GabCaz/flower_image_classifier", "max_stars_repo_head_hexsha": "e9831f9c412dfc71bdb66e6fb8d1b3d97b758dd1", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""
Unit tests for inventory.py classes and methods.
"""
import copy
import unittest
from unittest.mock import patch
from sympy import Integer, log
from radioactivedecay.decaydata import load_dataset, DEFAULTDATA
from radioactivedecay.inventory import (
Inventory,
InventoryHP,
)
from radioactivedecay.nuclide i... | {"hexsha": "4e24320053a380a758301c633e1e5753d9a0fb29", "size": 32173, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_inventory.py", "max_stars_repo_name": "BGameiro2000/radioactivedecay", "max_stars_repo_head_hexsha": "98a84345b9f15001dd99b177e131cfa17714804d", "max_stars_repo_licenses": ["MIT"], "ma... |
using Test
using YaoExperiment: yaorepl_parse, yaorepl_trans, YaoREPLState
@testset "yaorepl_parse" begin
@test yaorepl_parse("e op reg") == :(expect(op, reg))
@test yaorepl_parse("e' op reg") == :(expect'(op, reg))
@test yaorepl_parse("m! reg") == :(measure!(reg))
@test yaorepl_parse("cr(x)") == :(cr... | {"hexsha": "f80325c15a610de1337ad10e10cca918b80c2874", "size": 1203, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/repl.jl", "max_stars_repo_name": "QuantumBFS/YaoExperiment.jl", "max_stars_repo_head_hexsha": "6a8f3f40c1b86eba14d87ddbfbe594a38bddabf8", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_... |
export Mixture, sample_mixture, log_pdf_mixture
struct Mixture
"Number of Gaussian kernels"
Nψ::Int64
"Dimension of the state"
Nx::Int64
"Array of Nψ dimensions"
dist::Array{MvNormal,1}
"Vector of weights for each mode"
w::Array{Float64,1}
end
function Mixture(Nx::Int64)
@as... | {"hexsha": "1a85a0c9d399f6ed40a7406fce7160437a768773", "size": 1332, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/tools/mixture.jl", "max_stars_repo_name": "mleprovost/TransportBasedInference.jl", "max_stars_repo_head_hexsha": "bdcedf72e9ea23c24678fe6af7a00202c5f9d5d7", "max_stars_repo_licenses": ["MIT"], ... |
/**
* Copyright (c) 2009 Carnegie Mellon University.
*
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENS... | {"hexsha": "786f77f74751b45e9fcb6f27662b63e656940cbf", "size": 10692, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/graphlab/util/hopscotch_map.hpp", "max_stars_repo_name": "madi171/madi171-graphlab", "max_stars_repo_head_hexsha": "806dde3ac848adcebb442bbb156b5ba50f962ddd", "max_stars_repo_licenses": ["ECL-2... |
// ------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
// ------------------------------------------------------------
#include "stdafx.h"
#include ... | {"hexsha": "d69de6632d54c3bf1bc6f44608baabac10ebbe8e", "size": 13569, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/prod/src/Common/StringUtility.Test.cpp", "max_stars_repo_name": "AnthonyM/service-fabric", "max_stars_repo_head_hexsha": "c396ea918714ea52eab9c94fd62e018cc2e09a68", "max_stars_repo_licenses": [... |
import numpy as np
import pytest
from csmsm.estimator import CoresetMarkovStateModel
from csmsm.estimator import TransitionMatrix
from csmsm.estimator import DiscreteTrajectory
class TestEstimator:
def test_create_empty(self):
model = CoresetMarkovStateModel()
assert f"{model!r}" == "CoresetMar... | {"hexsha": "5e0ecb42fef5d5f824791e361686f7bed8d2ea0d", "size": 8129, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_estimator.py", "max_stars_repo_name": "janjoswig/cs-MSM", "max_stars_repo_head_hexsha": "b6b529fb5a122810f2521eb80f1e44ba44714933", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
! RUN: %python %S/test_folding.py %s %flang_fc1
! Tests folding of PACK (valid cases)
module m
integer, parameter :: arr(2,3) = reshape([1, 2, 3, 4, 5, 6], shape(arr))
logical, parameter :: odds(*,*) = modulo(arr, 2) /= 0
integer, parameter :: vect(*) = [(j, j=-10, -1)]
logical, parameter :: test_pack_1 = all(p... | {"hexsha": "e101c09eb5761935f79b45931ea64d530710edf2", "size": 984, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "flang/test/Evaluate/folding24.f90", "max_stars_repo_name": "mkinsner/llvm", "max_stars_repo_head_hexsha": "589d48844edb12cd357b3024248b93d64b6760bf", "max_stars_repo_licenses": ["Apache-2.0"], "m... |
// Own headers
#include "chip8.hpp"
#include "imgui_helper.hpp"
// System headers
#include <array>
#include <vector>
// Third-party headers
#include <SFML/Graphics.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Event.hpp>
#include <argparse/argparse.hpp>
#include <boost/circular_buffer.hpp>
#include <fmt... | {"hexsha": "2812b619c5f483e56920f49108a200f7b838cff5", "size": 3592, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/main.cpp", "max_stars_repo_name": "Panky-codes/CHIP8", "max_stars_repo_head_hexsha": "55e32eb18f253772d770bcdfdcfb0f1f366ba198", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1.0, "max_... |
from __future__ import print_function
import json
import requests
import uuid
from datetime import datetime
import sys
# airflow operators
import airflow
from airflow.models import DAG
from airflow.utils.dates import days_ago
from airflow.operators.python_operator import PythonOperator
# airflow sagemaker operators
f... | {"hexsha": "cf1493e7368c1f621db25b468eeb8bc2fb45c53e", "size": 6643, "ext": "py", "lang": "Python", "max_stars_repo_path": "dags/xgboost-ml-pipeline/1.10/mwaa-customer-churn-dag.py", "max_stars_repo_name": "mrichman/amazon-mwaa-examples", "max_stars_repo_head_hexsha": "701385c29c8ef26e5d550f02113865902cac6d44", "max_st... |
# compare times of direct calculation of c's compared to Crandall's recursive calculation
using Polylogarithms
using BenchmarkTools
using DataFrames, CSV
using PyPlot
using SpecialFunctions
import Base: parse
using Printf
Q = Polylogarithms.Q
c = Polylogarithms.c
max_terms = 10
max_n = 5
s = 5.0001;
r = s - n;
μ = -0... | {"hexsha": "060a939c47c4736b74fbabbc8be80de4d8401f67", "size": 1058, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "extended_tests/Q_bench_time.jl", "max_stars_repo_name": "AshtonSBradley/Polylogarithms.jl", "max_stars_repo_head_hexsha": "f52e3075cd1d87b0d67d26c72cd1a79a365eddcd", "max_stars_repo_licenses": ["MI... |
#include <internal/facts/aix/kernel_resolver.hpp>
#include <facter/facts/collection.hpp>
#include <leatherman/logging/logging.hpp>
#include <leatherman/execution/execution.hpp>
#include <leatherman/util/regex.hpp>
#include <leatherman/file_util/file.hpp>
#include <boost/regex.hpp>
using namespace leatherman::execution... | {"hexsha": "e4277c545e785ad00d776f1ed48237ae907ed884", "size": 870, "ext": "cc", "lang": "C++", "max_stars_repo_path": "lib/src/facts/aix/kernel_resolver.cc", "max_stars_repo_name": "Dorin-Pleava/facter", "max_stars_repo_head_hexsha": "74769988e1b132edc401eb7e420901495092c74c", "max_stars_repo_licenses": ["Apache-2.0"]... |
'''
LSTM is inserted at the concatenation path
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import numpy as np
from blocks import simple_block, Down_sample, Up_sample
from model import init_U_Net
from RNN import ConvLSTMCell, ConvLayer
from CenterLSTM import C... | {"hexsha": "8906d42e7d47e6daba3ea5fb73c1998beab55438", "size": 8600, "ext": "py", "lang": "Python", "max_stars_repo_path": "ShortcutLSTM.py", "max_stars_repo_name": "TUDelftHao/TUDelftHao-4DLongitudinal-MRI-segmentation", "max_stars_repo_head_hexsha": "c028e3c8b64812a05e39efa80699a327172c095d", "max_stars_repo_licenses... |
#!/usr/bin/env python
# coding: utf-8
# ## StatQuest!
# # Support Vector Machines in Python, From Start To Finish
# Copyright 2020, Joshua Starmer
#
# ----
#
# In this lesson we will build this **Support Vector Machine** for **classification** (shown below) using **scikit-learn** and the **Radial Basis Function (RBF... | {"hexsha": "ee18d166b5c6eedca2572fb087b9763df105b718", "size": 33149, "ext": "py", "lang": "Python", "max_stars_repo_path": "Lecture8/statquest_support_vector_machines_in_python/statquest_support_vector_machines_in_python_heart_disease.py", "max_stars_repo_name": "quao627/AGRI9999-Seminar-in-Python", "max_stars_repo_he... |
import torch
import random
import numpy as np
from itertools import compress
from rdkit import Chem
from rdkit.Chem.Scaffolds import MurckoScaffold
from collections import defaultdict
from sklearn.model_selection import StratifiedKFold
def generate_scaffold(smiles, include_chirality=False):
"""
Obtain Bemis-... | {"hexsha": "9ab71e8174872b4dec7bcdb0ab3ecd946456c2b3", "size": 11549, "ext": "py", "lang": "Python", "max_stars_repo_path": "splitters.py", "max_stars_repo_name": "thomasly/contextSub", "max_stars_repo_head_hexsha": "11ddeaf7ebbf8292804eb6d0db177a6c9b68ea17", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,... |
from __future__ import print_function
import scipy.io as sio
import os
import numpy as np
from PIL import Image
import xml.etree.cElementTree as ET
def rand_select_bg():
sun_img_path = os.path.join(bg_root, 'JPEGImages')
sun_anno_path = os.path.join(bg_root, 'Annotations')
while True:
detected = False
img = n... | {"hexsha": "98d6ee2b8b9e42a230d93c602dc3c9d351de9b3f", "size": 3526, "ext": "py", "lang": "Python", "max_stars_repo_path": "Tools/read_pascal_mat.py", "max_stars_repo_name": "n8886919/YOLO", "max_stars_repo_head_hexsha": "3726a8819d7880e03f4a7e056751ad10a850201b", "max_stars_repo_licenses": ["BSD-Source-Code"], "max_st... |
\documentclass{scrartcl}
\usepackage{listings}
\usepackage{amsmath}
\title{Design of Embedded System\\Exercise 3}
\author{Erin van der Veen - s4431200\\
Brigel Pineti - s1005549}
\begin{document}
\maketitle
\section*{3a}
The global counter is first incremented to 10 by taskOne, after which it is decremented to 0 b... | {"hexsha": "cf5e1bf6cc50459a4c445679aa65548b041d5095", "size": 1389, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "ex03/ex03.tex", "max_stars_repo_name": "ErinvanderVeen/Design-of-Embeded-Systems", "max_stars_repo_head_hexsha": "755c444089c28824b79bb3489535063a0c972d7f", "max_stars_repo_licenses": ["MIT"], "max_... |
#!/usr/bin/env python
# encoding: utf-8
# File Name: data_util.py
# Author: Jiezhong Qiu
# Create Time: 2019/12/30 14:20
# TODO:
import io
import itertools
import os
import os.path as osp
from collections import defaultdict, namedtuple
import dgl
import matplotlib.pyplot as plt
import numpy as np
import scipy
import ... | {"hexsha": "961b2f4fb86d91a8ce6680513161eb095d826f60", "size": 9320, "ext": "py", "lang": "Python", "max_stars_repo_path": "gcc/datasets/data_util.py", "max_stars_repo_name": "TangYucopper/GCC", "max_stars_repo_head_hexsha": "26c9e0bbe9db330748055924bc0f2bc3a0868cdf", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
#!/usr/bin/env python
import click as ck
import numpy as np
import pandas as pd
import logging
import math
from collections import deque
from utils import Ontology, FUNC_DICT
from sklearn.manifold import TSNE
from sklearn.metrics import roc_curve, auc, matthews_corrcoef
import matplotlib.pyplot as plt
from scipy.sta... | {"hexsha": "c6aedd39280983c2ddf83f7936093c565651b939", "size": 5428, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluate_sim_interactions.py", "max_stars_repo_name": "leechuck/julia-stuff", "max_stars_repo_head_hexsha": "1470edaa84fd38e65a06636635a1b22344882fce", "max_stars_repo_licenses": ["BSD-2-Clause"],... |
// Warning! This file is autogenerated.
#include <boost/text/bidirectional.hpp>
#include "bidi_tests.hpp"
#include <gtest/gtest.h>
#include <algorithm>
std::vector<int> expected_levels;
std::vector<int> expected_reordered_indices;
TEST(bidi, bidi_541_000)
{
expected_levels = { 1, -1, 1, 1 };
expected_reo... | {"hexsha": "cdc3b92733595cd431f5c2ecefee6cc905954867", "size": 980737, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/bidi_test_541.cpp", "max_stars_repo_name": "eightysquirrels/text", "max_stars_repo_head_hexsha": "d935545648777786dc196a75346cde8906da846a", "max_stars_repo_licenses": ["BSL-1.0"], "max_stars... |
import sys
import numpy as np
from helper_ECPN import helper_sim
def single_run(N_val, h0_val):
sim_pars = {
'J0': 1.2,
'chi': 1.0,
'sigma': 0.0,
'dh': 0.001,
't_min': 0,
't_max': 1e6,
'Nt': 100001,
'log_every_n': 100
}
helper_sim(N=N_val, ... | {"hexsha": "c7a09da156b0f20ff8f795d0df2c376e58e73595", "size": 461, "ext": "py", "lang": "Python", "max_stars_repo_path": "results/numExp01_small_systems/main_single_run.py", "max_stars_repo_name": "omelchert/py-ecpn", "max_stars_repo_head_hexsha": "da142a89299f5b6942ecffd07222c2a49595f081", "max_stars_repo_licenses": ... |
#pragma once
#include <mapnik/datasource.hpp>
#include <mapnik/geometry_adapters.hpp>
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include <boost/variant/recursive_wrapper.hpp>
#include <cstdint>
#include <string>
#include <unordered_map>
#include <vector>
namespace flywave {
namespace nik {
struct ... | {"hexsha": "6189974f57a453607b495368303101ff44e72f05", "size": 2279, "ext": "hh", "lang": "C++", "max_stars_repo_path": "feature.hh", "max_stars_repo_name": "baiyicanggou/mapnik_mvt", "max_stars_repo_head_hexsha": "9bde52fa9958d81361c015c816858534ec0931bb", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": ... |
# -*- coding: utf-8 -*-
from typing import Callable, Optional, Tuple
import numpy as np
from torch.utils.data import DataLoader, Dataset
from torch.utils.data.dataloader import default_collate
from torch.utils.data.sampler import SubsetRandomSampler
class BaseDataLoader(DataLoader):
"""
Base class for custo... | {"hexsha": "b45bc34b93a8601914186d4bde63b46bbc9142d7", "size": 3641, "ext": "py", "lang": "Python", "max_stars_repo_path": "base/base_data_loader.py", "max_stars_repo_name": "theLongLab/group-lasso-nn", "max_stars_repo_head_hexsha": "6d7b9ffe2867b0efe99d6062bbb8b09ec12155c2", "max_stars_repo_licenses": ["MIT"], "max_st... |
import boto3
import os
import json
import shortuuid as su
import bioimagepath as bp
import bioims
import sagemaker
from sagemaker.pytorch import PyTorch
from sagemaker.inputs import FileSystemInput
VERSION=3
MESSAGE_LAMBDA_ARN = os.environ['MESSAGE_LAMBDA_ARN']
IMAGE_MANAGEMENT_LAMBDA_ARN = os.environ['IMAGE_MANAGEME... | {"hexsha": "9fffc5aa6f6aa83709b02c855279dc1f80a790db", "size": 6284, "ext": "py", "lang": "Python", "max_stars_repo_path": "main/src/training-compute/training-compute.py", "max_stars_repo_name": "aws-samples/bioimage-search", "max_stars_repo_head_hexsha": "7acdeb8e24c31ff7302563df60f9b65a522dd834", "max_stars_repo_lice... |
# Reservoir computing on the hypersphere
import numpy as np
import chargrams as cg
import csv
import time
# create input weight matrix u and hidden state/reservoir matrix v
def init(M,N):
u,v = np.random.rand(N,M),np.identity(M)
# normalizing columns in NxM sized input matrix U as in formulas 6,7
for m in ... | {"hexsha": "03f9e568d99cc162ab773b2d209c39719ec01a3f", "size": 7192, "ext": "py", "lang": "Python", "max_stars_repo_path": "hypervoir.py", "max_stars_repo_name": "shy1/language-model", "max_stars_repo_head_hexsha": "2e24519449544c3b68e57a3654345d8a8563eafd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
import sys
import json
import os
import hashlib
from itertools import chain
from concurrent import futures
import numpy as np
import warnings
sys.path.append('/groups/saalfeld/home/papec/Work/my_projects/z5/bld/python')
import z5py
def precompute_offset_list(path, output_shape, blocklist_file='precomputed_list.json',... | {"hexsha": "5b09e90f4cfd5d3117cf91fcb00f00ca4edbe351", "size": 2222, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/cremi_validation/precompute_offsets.py", "max_stars_repo_name": "neptunes5thmoon/simpleference", "max_stars_repo_head_hexsha": "96c74187bd3d83f6f1e910e72e56f45d6cc8d5d9", "max_stars_re... |
import os
from glob import glob
import numpy as np
import scipy.misc
import math
# Set params.
src_dir = '/iron/db/celebA/'
dst_dir = './db/celebA/'
im_format = '*.jpg'
im_size = 64
keep_aspect = True
# Do the job.
if not os.path.exists( dst_dir ):
os.mkdir( dst_dir )
iid2impath = glob( os.path.join( src_dir, im_forma... | {"hexsha": "61d4aadb28d2a94463428ea92fa019b15f6e4247", "size": 1072, "ext": "py", "lang": "Python", "max_stars_repo_path": "make_train_data.py", "max_stars_repo_name": "nlkim0817/WEARING", "max_stars_repo_head_hexsha": "452b91c0c26e9848e1bbd7bd8da262a734a02354", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2,... |
from typing import Any, Dict, Optional
import os
import pickle
import numpy as np
from catalyst.core.logger import ILogger
from catalyst.settings import SETTINGS
if SETTINGS.wandb_required:
import wandb
class WandbLogger(ILogger):
"""Wandb logger for parameters, metrics, images and other artifacts.
W&... | {"hexsha": "d5cd4773bd1f206eb1a7de4fbd5bcf3ee9401165", "size": 7412, "ext": "py", "lang": "Python", "max_stars_repo_path": "catalyst/loggers/wandb.py", "max_stars_repo_name": "sergunya17/catalyst", "max_stars_repo_head_hexsha": "f98d71138c09cd1b5a69b788cb5006115f5c7fda", "max_stars_repo_licenses": ["Apache-2.0"], "max_... |
!
! This file is part of the ExaHyPE project.
! Copyright (c) 2016 http://exahype.eu
! All rights reserved.
!
! The project has received funding from the European Union's Horizon
! 2020 research and innovation programme under grant agreement
! No 671698. For copyrights and licensing, please consult the webpa... | {"hexsha": "edf7d931c1ef91e067109e6415d0305de23416f2", "size": 12814, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "ExaHyPE/kernels/aderdg/generic/fortran/3d/spaceTimePredictorNonlinearFortran.f90", "max_stars_repo_name": "linusseelinger/ExaHyPE-Tsunami", "max_stars_repo_head_hexsha": "92a6e14926862e1584ef1e... |
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from . import thops
from . import modules
from . import utils
from torchvision.models import resnet18
def f(in_channels, out_channels, hidden_channels):
return nn.Sequential(
modules.Conv2d(in_chann... | {"hexsha": "041fdddb5ea751ac44e772f7744f160ad619e8a3", "size": 16815, "ext": "py", "lang": "Python", "max_stars_repo_path": "glow/models.py", "max_stars_repo_name": "ShreyDixit/glow-pytorch", "max_stars_repo_head_hexsha": "a964ba181898183c41f6ec6122a71b925ac33efa", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
/- A natural number is either zero or the successor of a natural number.-/
inductive mynat : Type
| zero : mynat
| mysucc : mynat → mynat
open mynat
lemma succ_eq (a b : mynat) : (a = b) -> (mysucc a = mysucc b) :=
begin
intros h, rw h,
end
def nat_one : mynat := (mysucc zero)
def myadd : mynat → mynat → my... | {"author": "anonymousLeanDocsHosting", "repo": "lean-polynomials", "sha": "361ef4cb7b68ef47d43b85cfa2d13f2ea0a47613", "save_path": "github-repos/lean/anonymousLeanDocsHosting-lean-polynomials", "path": "github-repos/lean/anonymousLeanDocsHosting-lean-polynomials/lean-polynomials-361ef4cb7b68ef47d43b85cfa2d13f2ea0a47613... |
'''
detnet based on PyTorch
this is modified from https://github.com/lingtengqiu/Minimal-Hand
'''
import sys
import torch
sys.path.append("./")
from torch import nn
from einops import rearrange, repeat
from model.helper import resnet50, conv3x3
import numpy as np
# my modification
def get_pose_tile_torch(N):
p... | {"hexsha": "f9f99aea30f9a785acca4e64db40550e2889dc6e", "size": 4298, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/detnet/detnet.py", "max_stars_repo_name": "tanyinghui/Minimal-Hand-pytorch", "max_stars_repo_head_hexsha": "3e991af9be0475ebc761fec3f13d00f81146631a", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
def ecdf(x):
x = np.sort(x)
u, c = np.unique(x, return_counts=True)
n = len(x)
y = (np.cumsum(c) - 0.5)/n
def interpolate_(x_):
yinterp = np.interp(x_, u, y, left=0.0, right=1.0)
return yinterp
return interpolate_
def cummulative_kl(x, y, fraction=0.5):
... | {"hexsha": "93be3e27f87501c25d4805d2d1e87116d3f27c3c", "size": 598, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/kl_divergence_cummulative.py", "max_stars_repo_name": "tdosreis/kl-divergence", "max_stars_repo_head_hexsha": "438c2c0e2b0521b0eaece1fb7aa81a82b847f249", "max_stars_repo_licenses": ["MIT"], "ma... |
import numpy as np
total = 0
matrix = np.array(([[1,3,19,20], [2,6,9,10], [-59,49,23,0], [10,1,-1.3]]))
print(matrix)
for i in range(4):
for j in range(2):
total = total +matrix[i][j]
total = sum(total)
print(total)
| {"hexsha": "1a237b413c81742e1e0fdc177ac17c49bc32c8ba", "size": 249, "ext": "py", "lang": "Python", "max_stars_repo_path": "Exercise 6.py", "max_stars_repo_name": "VladyslavKotov584/Python-Exercises", "max_stars_repo_head_hexsha": "c341a692a5ae8479f20c5947b50a2bf34870dfc6", "max_stars_repo_licenses": ["MIT"], "max_stars... |
# first version of two way lattice for getting current
import numpy as np
import numpy.random as rd
import random as random
import scipy
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
from datetime import datetime
now = datetime.now()
#parameters
N = 100 # number... | {"hexsha": "9036e381d712a5e935ad4ce31eda47ebac307790", "size": 22820, "ext": "py", "lang": "Python", "max_stars_repo_path": "Mathematics/PBC_simulations/heatmaps/PBC_heatmaps.py", "max_stars_repo_name": "grohalex/Final-Project", "max_stars_repo_head_hexsha": "41ac4e56e1a688a5f03f81d40d99eb2f839f9a26", "max_stars_repo_l... |
SUBROUTINE COVSRT(COVAR,NCVM,MA,LISTA,MFIT)
DIMENSION COVAR(NCVM,NCVM),LISTA(MFIT)
DO 12 J=1,MA-1
DO 11 I=J+1,MA
COVAR(I,J)=0.
11 CONTINUE
12 CONTINUE
DO 14 I=1,MFIT-1
DO 13 J=I+1,MFIT
IF(LISTA(J).GT.LISTA(I)) THEN
COVAR(LISTA(J),LISTA(I))=... | {"hexsha": "f53e09cfc2b35580b78c1018886a7c13ca393621", "size": 794, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "Math3/NumRec/source/covsrt.for", "max_stars_repo_name": "domijin/MM3", "max_stars_repo_head_hexsha": "cf696d0cf26ea8e8e24c86287cf8856cab7eaf77", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma bounded_sesquilinear_butterfly[bounded_sesquilinear]: \<open>bounded_sesquilinear (\<lambda>(b::'b::chilbert_space) (a::'a::chilbert_space). butterfly a b)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. bounded_sesquilinear (\<lambda>b a. butterfly a b)
[PROOF STEP]
proof standard
[PROOF ST... | {"llama_tokens": 1765, "file": "Complex_Bounded_Operators_Complex_Bounded_Linear_Function", "length": 14} |
#=
This file is taken from: https://github.com/rikhuijzer/PlutoStaticHTML.jl/blob/main/src/PlutoStaticHTML.jl
in Oct 2021. The project has grown since with parallel builds/caching like features.
Kindly use PlutoStaticHTML.jl instead.
=#
using Pluto:
Cell,
CellOutput,
Notebook,
ServerSession,
SessionActions,... | {"hexsha": "d643c103248dcae727de3152225bd4aa3085f85f", "size": 29779, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "docs/interactive_pluto_docs/test/html.jl", "max_stars_repo_name": "memetics19/Genie.jl", "max_stars_repo_head_hexsha": "6f0b9cda7f9d13181a1c4c095069d7cf6ee7045e", "max_stars_repo_licenses": ["MIT"... |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import math
import warnings
import numpy as np
import matplotlib.colors as mplc
import napari
from detectron2.utils.colormap import random_color
from detectron2.utils.visualizer import ColorMode
from detectron2.utils.visualizer import Visualizer as Det... | {"hexsha": "fc35afc136ea98925edf138d02cc6d5cb8587051", "size": 26667, "ext": "py", "lang": "Python", "max_stars_repo_path": "napari_detectron2/_visualizer_2.py", "max_stars_repo_name": "sofroniewn/napari-detectron2", "max_stars_repo_head_hexsha": "c45839e0729825e8c1943446bfd51590ec1fb8f5", "max_stars_repo_licenses": ["... |
#https://www.arunponnusamy.com/yolo-object-detection-opencv-python.html
# Imports
import cv2
import numpy as np
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import RPi.GPIO as GPIO
# Function Definitions
def turn_motor_on(motor):
GPIO.output(motor_pins[motor], GPIO.HIGH)
def ... | {"hexsha": "8fd811561bfaccd676589eacd8da7a7ffb350cfa", "size": 4978, "ext": "py", "lang": "Python", "max_stars_repo_path": "opencv_test.py", "max_stars_repo_name": "greasypenguins/SafeCrossHat", "max_stars_repo_head_hexsha": "106f4c9101fd8d670ce0f53ff68c20035de3016b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
MODULE fortranfft
contains
SUBROUTINE generate_exp(N, exp_factors)
! Generates the exponential factors which are used in the subroutines
! bellow.
!
! Inputs : N
!
! Outputs : exp_factors - array of the form W[n] = exp(-2j*pi*n/N)
implicit none
integer, intent(in) :: N
complex(... | {"hexsha": "2bdf4f19953fe232a4163d7cc20d4c16a5a86fac", "size": 3673, "ext": "f95", "lang": "FORTRAN", "max_stars_repo_path": "Module/fortranfft.f95", "max_stars_repo_name": "rusruskov/Fortran-FFT", "max_stars_repo_head_hexsha": "ebcd773d61bb06163b14a868b81986bc6a52fe11", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
"""
Example script for cortical parcellation.
If you use this code, please cite the following paper.
Seungbo Ha and Ilwoo Lyu
SPHARM-Net: Spherical Harmonics-based Convolution for Cortical Parcellation.
IEEE Transactions on Medical Imaging. 2022
Copyright 2022 Ilwoo Lyu
Licensed under the Apache License... | {"hexsha": "fcf1a26386903299569f3bc9bc814f96dad50919", "size": 6017, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/parc.py", "max_stars_repo_name": "Shape-Lab/SPHARM-Net", "max_stars_repo_head_hexsha": "76971c2302113f24e5796b3c393cc9327eb212a7", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
import time
import logging
import os
from PyQt5 import QtCore
from pprint import pprint
import numpy as np
import qcodes
#import qcodes.logger as logger
#from qcodes.logger import start_all_logging
from qcodes_contrib_drivers.drivers.Keysight.M3202A import M3202A
from core_tools.GUI.keysight_videomaps.liveplotting i... | {"hexsha": "d256558e5f408e5f13904cc58995a1256793a5ef", "size": 4015, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/hvi2/liveplottest.py", "max_stars_repo_name": "peendebak/core_tools", "max_stars_repo_head_hexsha": "2e43edf0bbc1d7ceb7042559db499535e8f6a076", "max_stars_repo_licenses": ["BSD-2-Clause"]... |
[STATEMENT]
lemma delete_eqvt:
fixes p :: "name prm"
and X :: "name set"
and Y :: "name set"
shows "p \<bullet> (X - Y) = (p \<bullet> X) - (p \<bullet> Y)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. p \<bullet> (X - Y) = p \<bullet> X - p \<bullet> Y
[PROOF STEP]
by(auto simp add: perm_set_def perm... | {"llama_tokens": 140, "file": "Psi_Calculi_Agent", "length": 1} |
from abc import ABC, abstractmethod, abstractproperty
import numpy as np
# pylint: disable=not-callable
import torch
from torch import nn
from distributed.util import q_value_index_to_action
class BaseAgent(nn.Module, ABC):
def __init__(self):
super().__init__()
self.size = None
self.dev... | {"hexsha": "4fc301fa26d4059b98dde8abc7489e130b83e9bc", "size": 2958, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/agents/base_agent.py", "max_stars_repo_name": "mbecker12/surface-rl-decoder", "max_stars_repo_head_hexsha": "5399c4caabda8154feaa6027e14057cef82843b3", "max_stars_repo_licenses": ["MIT"], "max... |
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{PS2 Hoffman}
\author{Abigail Hoffman}
\date{February 2021}
\usepackage{natbib}
\usepackage{graphicx}
\begin{document}
\maketitle
\section{Main Tools of a Data Scientist}
\begin{itemize}
\item Measurement
\item Statistical Progra... | {"hexsha": "6364dfd20957f7c4bb881e4f9b2e14fd8b8b7e15", "size": 479, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "ProblemSets/PS2/PS2_Hoffman.tex", "max_stars_repo_name": "abbyhhoffman/DScourseS21", "max_stars_repo_head_hexsha": "b7cafebeda81a464db26572354ab142c5b34a8f4", "max_stars_repo_licenses": ["MIT"], "max... |
import numpy as np
# Index 13: STO2
def get_index_13(x, listener):
# get R1 and R2
r1 = listener.params[0]
r2 = listener.params[1]
# between 570nm and 590nm
data1 = np.ma.amin(np.gradient(np.gradient(x[:, :, 14:18], axis=2), axis=2), axis=2)
# between 740nm and 780nm
data2 = np.ma.amin(np.... | {"hexsha": "58b134549dea89ec5647e08443d400657fcd69bb", "size": 499, "ext": "py", "lang": "Python", "max_stars_repo_path": "AnalysisModules/Indices/index_13.py", "max_stars_repo_name": "MIC-Surgery-Heidelberg/HyperGUI_1.0", "max_stars_repo_head_hexsha": "0ee8e0da85049076bb22a542d15d6c3adf6ea106", "max_stars_repo_license... |
from typing import Tuple
from typing import Union
from pathlib import Path
from typeguard import check_argument_types
import numpy as np
from espnet_onnx.utils.function import (
make_pad_mask,
mask_fill
)
class GlobalMVN:
"""Apply global mean and variance normalization
Args:
config.stats_fi... | {"hexsha": "17d49e4e85455c0d77d8bef2f3abae88efab7a84", "size": 1935, "ext": "py", "lang": "Python", "max_stars_repo_path": "espnet_onnx/asr/frontend/global_mvn.py", "max_stars_repo_name": "Masao-Someki/espnet_onnx", "max_stars_repo_head_hexsha": "a0f44a087329bdcc292a4479ddf29d299edd92e5", "max_stars_repo_licenses": ["M... |
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 12 20:28:17 2018
@author: Alexandre
"""
###############################################################################
import numpy as np
###############################################################################
from pyro.dynamic import cartpole
#################... | {"hexsha": "2a04e63d24817467a35b5d0ce5bb61062edffa73", "size": 486, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/by_systems/cartpole/cartpole_modes.py", "max_stars_repo_name": "SherbyRobotics/PyRobotics", "max_stars_repo_head_hexsha": "86eb1189258f6f41642a149c813dd2fd6853bcc1", "max_stars_repo_licens... |
import numpy as np
from numpy.random import default_rng
from timeit import timeit
from mtalg.random import MultithreadedRNG
import seaborn as sns
import matplotlib.pyplot as plt
from tqdm import tqdm
import pandas as pd
import mkl_random
from collections import defaultdict
sns.set()
mrng = MultithreadedRNG(seed=1, num... | {"hexsha": "ef08a070ad59c1e7bf8bc02f1f92db45ddc0d388", "size": 3407, "ext": "py", "lang": "Python", "max_stars_repo_path": "mtalg/testing/benchmarks_rng.py", "max_stars_repo_name": "WWakker/mtalg", "max_stars_repo_head_hexsha": "fd63f305d857ef2cfbd5280c1de54f52a309a3fd", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
from __future__ import division
import logging
from collections import Iterable
import numpy as np
from adv_attacks.base import Attack
class PGDAttack(Attack):
"""
This class implements gradient attack method, and is the base of FGSM, BIM,
ILCM, etc.
"""
def __init__(self, model, support_target... | {"hexsha": "6e50ec2fb06547ea220c9233dce170088a62bc66", "size": 3991, "ext": "py", "lang": "Python", "max_stars_repo_path": "DQN/adv_attacks/PGD.py", "max_stars_repo_name": "rohitsanjay/radial_rl", "max_stars_repo_head_hexsha": "5daa30ec57319db8d0dd6bee10cf0f41832ef0f3", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
""" @namespace Demos of Bolt step adjustment
@file
@copyright Copyright (c) 2017-2019,
New York University and Max Planck Gesellschaft,
License BSD-3-Clause
@example
"""
import numpy as np
import pybullet as p
from robot_properties_bolt.config import BoltConfig
from robot_properties_bolt.bolt_wrap... | {"hexsha": "81c70a32329e77aefd4b74733d8e0f2e914770f9", "size": 8460, "ext": "py", "lang": "Python", "max_stars_repo_path": "demos/demo_reactive_planners_bolt_step_adjustment.py", "max_stars_repo_name": "Lhumd/reactive_planners-1", "max_stars_repo_head_hexsha": "5d8bd04da3d06fb2f968aa23a0c6713dcd773f44", "max_stars_repo... |
[STATEMENT]
lemma register_id'[simp]: \<open>register (\<lambda>x. x)\<close>
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. register (\<lambda>x. x)
[PROOF STEP]
using register_id
[PROOF STATE]
proof (prove)
using this:
register id
goal (1 subgoal):
1. register (\<lambda>x. x)
[PROOF STEP]
by (simp add: id_def) | {"llama_tokens": 130, "file": "Registers_Quantum_Extra", "length": 2} |
from typing import Optional, Tuple, Union
import numpy as np
from numpy.typing import ArrayLike
from pyproj import CRS, Transformer
import pyvista as pv
from .common import nan_mask, to_xyz, wrap
from .crs import WGS84
from .log import get_logger
__all__ = ["Transform"]
# Configure the logger.
logger = get_logger(_... | {"hexsha": "1177f504ee238d336ae77123cd56a4b6832b9cda", "size": 22626, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/geovista/bridge.py", "max_stars_repo_name": "trexfeathers/geovista", "max_stars_repo_head_hexsha": "f11a7a54ef11d8542be632c29f9fe6653572879e", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
# MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# r... | {"hexsha": "6f2278e5dcd714d5bfe8d470e9fe27452c032f42", "size": 3776, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/defences/test_gaussian_noise.py", "max_stars_repo_name": "minaremeli/adversarial-robustness-toolbox", "max_stars_repo_head_hexsha": "3454f7f11c3ade9317d11637c8c8621c9f44e8fd", "max_stars_rep... |
\documentclass{scrartcl}
\usepackage{url}
\usepackage{graphicx}
\usepackage{amssymb}
\begin{document}
\tableofcontents
\section{Introduction}
MultiRNG (Multi Random Number Generator is a multiplatform-application which lets you generate reproducable random numbers using several libraries, algorithms and distri... | {"hexsha": "dfeb66ece46e69b1e0f6138fc2f7b420f6912fa7", "size": 16733, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "MultiRNGF/doc/doc.tex", "max_stars_repo_name": "ulikoehler/MultiRNG", "max_stars_repo_head_hexsha": "66af2c5605dd0ba13aba2af8b69188ef796ddae0", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_co... |
/*
Copyright (C) 2003-2013 by David White <davewx7@gmail.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.... | {"hexsha": "803b7d7a51bd04b9d13c814ec11604698a1967a0", "size": 4086, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/wml_formula_callable.hpp", "max_stars_repo_name": "sweetkristas/anura", "max_stars_repo_head_hexsha": "5e8cbcfc7b761c5c01e5c5509a0fb159b8fb60cd", "max_stars_repo_licenses": ["CC0-1.0"], "max_sta... |
#
import os
import sys
import glob as glob
import numpy as np
import shutil
from sklearn.model_selection import train_test_split
# Root directory of the project
ROOT_DIR = os.path.abspath("../../")
def maybe_makedir(folder):
if not os.path.exists(folder):
os.makedirs(folder)
data_folder = os.path.join(R... | {"hexsha": "30884d8876b527762a895c48a255c53eecf302d8", "size": 1444, "ext": "py", "lang": "Python", "max_stars_repo_path": "samples/idcard/train_val_split.py", "max_stars_repo_name": "hegc/Mask_RCNN", "max_stars_repo_head_hexsha": "a22e9a02c07022b61c10c80b78b07e55cdc6e7fb", "max_stars_repo_licenses": ["MIT"], "max_star... |
include("../module/CustomStencil.jl")
include("../misc/misc.jl")
include("../misc/comp_count.jl")
include("../misc/cpu_stencils.jl")
## Star Stencil definition with radius = 1
coefs = [1;0.5;]
star_stencil = @def_stencil_expression c[0]D[x,y,z] + @sum(i, 1, 1, c[i]*(
D[x+i,y,z] + D[x,y+i,z] + D[x,y,z+i] +
... | {"hexsha": "17867e04cb84827d798d9142d2a0a9d5fcbe388d", "size": 1272, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "benchmarks/count_computations.jl", "max_stars_repo_name": "KonstantinosChatziantoniou/CustomStencil", "max_stars_repo_head_hexsha": "3b9d20521f35b5e05ecce5f251e60e8c7f738950", "max_stars_repo_licen... |
#!/bin/env python
"""
Main training script
"""
import os
from collections import OrderedDict
from tag import IDENT
import pickle
import theano
import theano.tensor as T
import numpy as np
import logging
class HiddenLayer(object):
def __init__(self, input, dim1, dim2):
"""Create the hidden layer"""
... | {"hexsha": "d4923804507992ae4c49806cc935159987e2fdd6", "size": 8218, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "Sentimentron/Dracula", "max_stars_repo_head_hexsha": "878f81c1c56a8ac12cf02d8f15bd93c544e29611", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": ... |
import numpy as np
import pandas as pd
from tqdm import tqdm
import os
import ast
from IPython import embed
if __name__ == '__main__':
data_path = f'./data/drugs/'
df = pd.read_csv(f'{data_path}train_data_allcontext_sideeffect.csv', index_col=0)
embed()
df.groupby('user')['activity_count'].agg('cou... | {"hexsha": "81e90116080c53445a28c63be4c71cb39d684049", "size": 430, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/build_statistics_data.py", "max_stars_repo_name": "paulagd/GCE", "max_stars_repo_head_hexsha": "c6680ef248430aed69a2ef5183f0d1df59d50608", "max_stars_repo_licenses": ["Apache-2.0"], "max_st... |
import numpy as np
import cv2
import sys
from tqdm import tqdm
def draw_flow(img, flow, step=16):
h, w = img.shape[:2]
y, x = np.mgrid[step/2:h:step, step/2:w:step].reshape(2,-1).astype(int)
fx, fy = flow[y,x].T
lines = np.vstack([x, y, x+fx, y+fy]).T.reshape(-1, 2, 2)
lines = np.int32(lines + 0.5... | {"hexsha": "c8688e12b9dc7af9dbc25e10524988a076f35ad3", "size": 7514, "ext": "py", "lang": "Python", "max_stars_repo_path": "ml_utils/calc_optical_flow.py", "max_stars_repo_name": "SuriyaNitt/ML_UTILS", "max_stars_repo_head_hexsha": "a26a50540d6555b23c9cbfb015dba7597920c9a5", "max_stars_repo_licenses": ["MIT"], "max_sta... |
[STATEMENT]
lemma agree_DRESTRICT:
assumes "agree s1 s2"
shows "agree (fmrestrict_set vs s1) (fmrestrict_set vs s2)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. agree (fmrestrict_set vs s1) (fmrestrict_set vs s2)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
agree s1 s2
goal (1 subgoal):
... | {"llama_tokens": 190, "file": "Factored_Transition_System_Bounding_SystemAbstraction", "length": 2} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.