text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
using BenchmarkTools, Test, CUDA
a = CUDA.zeros(1024)
function kernel(a)
i = threadIdx().x
a[i] += 1
return
end
@cuda threads=length(a) kernel(a)
##
N = 2^20
x_d = CUDA.fill(1.0f0, N) # a vector stored on the GPU filled with 1.0 (Float32)
y_d = CUDA.fill(2.0f0, N) # a vector stored on the GPU filled ... | {"hexsha": "e5e44f76994b10cf1b27d82920f3d07fb5571ef8", "size": 1159, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "scripts/cuda_debug.jl", "max_stars_repo_name": "doddgray/OptiMode.jl", "max_stars_repo_head_hexsha": "8d3185000218e0094c01b83f420dcebdf270b2c3", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
#!/usr/bin/env python3
import numpy as np
import tensorflow as tf
import cart_pole_evaluator
class Network:
def __init__(self, threads, seed=42):
# Create an empty graph and a session
graph = tf.Graph()
graph.seed = seed
self.session = tf.Session(graph = graph, config=tf.ConfigProt... | {"hexsha": "61a0ea735248d83dd4994c5d1afb197d463c1a0d", "size": 4646, "ext": "py", "lang": "Python", "max_stars_repo_path": "charles-university/deep-learning/labs/12/reinforce.py", "max_stars_repo_name": "Hyperparticle/lct-master", "max_stars_repo_head_hexsha": "8acb0ca8fe14bb86305f235e3fec0a595acae2de", "max_stars_repo... |
import chess
import numpy as np
import time
from numpy.random import default_rng
rng = default_rng()
class MCTS_graph:
def __init__(self,agent):
self.root=agent.root
self.temperature = agent.temperature
def make_graph(self,depth=1000):
self.cont=0
self.nodes = {}
... | {"hexsha": "d4f27f5a3133c797071081b88b7c6d69a9460a27", "size": 7779, "ext": "py", "lang": "Python", "max_stars_repo_path": "chesslab/agent_mcts.py", "max_stars_repo_name": "yniad/chesslab", "max_stars_repo_head_hexsha": "4720bfd093e9657798953702a1fa918f85991f65", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#include <string>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <boost/filesystem.hpp>
#include "res2h.h"
#include "res2hutils.hpp"
struct FileData {
boost::filesystem::path inPath;
boost::filesystem::path outPath;
std::string internalName;
std::string dataVariableName;
std::string sizeVari... | {"hexsha": "69fae17903c065ca3ede622d5ff2a554d803d064", "size": 36469, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "data/res2h-master/src/res2h.cpp", "max_stars_repo_name": "tlanks/esbusyness", "max_stars_repo_head_hexsha": "41ed9e6b552585476c81f2f89b9e3d539c54d4ab", "max_stars_repo_licenses": ["Apache-2.0", "MI... |
\section{Discussion}\label{section:discussion}
We have introduced relative suffix trees (\RCST), a new kind of compressed suffix tree for repetitive sequence collections. Our \RCST{} compresses the suffix tree of an individual sequence relative to the suffix tree of a reference sequence. It combines an already known... | {"hexsha": "6ca296c09b4e58f46fa017390b2bc475b10b2d42", "size": 2681, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "rcst/concl.tex", "max_stars_repo_name": "jltsiren/relative-fm", "max_stars_repo_head_hexsha": "68c11f172fd2a546792aad3ad81ee1e185b5ee7f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 16, "... |
import os
import numpy.linalg as la
import numpy as np
from skimage.draw import line_nd
from os.path import join, expanduser
from dipy.io import read_bvals_bvecs
from dipy.io.image import load_nifti, save_nifti
rel_path = '~/.dnn/datasets/synth'
name = 'synth'
def process_movement():
bvals, bvecs = load_bvals_... | {"hexsha": "cf71e616c93f24230b80d9ff351ad76474645a18", "size": 2586, "ext": "py", "lang": "Python", "max_stars_repo_path": "dataset/mnist/dwi/movement.py", "max_stars_repo_name": "cassianobecker/dnn", "max_stars_repo_head_hexsha": "bb2ea04f77733de9df10f795bb049ac3b9d30478", "max_stars_repo_licenses": ["MIT"], "max_star... |
[STATEMENT]
lemma vars_of_instances:
shows "vars_of (subst t \<sigma>)
= \<Union> { V. \<exists>x. (x \<in> (vars_of t)) \<and> (V = vars_of (subst (Var x) \<sigma>)) }"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. vars_of (t \<lhd> \<sigma>) = \<Union> {V. \<exists>x. x \<in> vars_of t \<and> V = vars_of (... | {"llama_tokens": 9771, "file": "SuperCalc_terms", "length": 44} |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.neural_network import MLPRegressor
from sklearn.model_selection import LeaveOneGroupOut
from plot_with_PE_imputation import plot_with_PE_imputation
import matplotlib.colors as colors
from mpl_toolkits.axes_grid1 import make_axes_locata... | {"hexsha": "e6bbf3ea06862e0e492948c45271192370b86fdb", "size": 3154, "ext": "py", "lang": "Python", "max_stars_repo_path": "MLP_mean_impute.py", "max_stars_repo_name": "suniipang/PE_Imputation", "max_stars_repo_head_hexsha": "836b9c687883ac87f091785fc17fded6d122be83", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma ns_mul_ext_bottom: "(A,{#}) \<in> ns_mul_ext ns s"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (A, {#}) \<in> ns_mul_ext ns s
[PROOF STEP]
by (auto intro!: ns_mul_extI) | {"llama_tokens": 92, "file": "Weighted_Path_Order_Multiset_Extension2", "length": 1} |
from policy import LSTMPolicy, MlpPolicyValue
import gym
import gym_compete
import pickle
import sys
import argparse
import tensorflow as tf
import numpy as np
def load_from_file(param_pkl_path):
with open(param_pkl_path, 'rb') as f:
params = pickle.load(f)
return params
def setFromFlat(var_list, flat... | {"hexsha": "d2997f9fd0befd133e3a7728c04ecbf4d5053abb", "size": 4910, "ext": "py", "lang": "Python", "max_stars_repo_path": "multiagent-competition/main.py", "max_stars_repo_name": "MachengShen/torchbeast", "max_stars_repo_head_hexsha": "3853fdda44db4d91d773ff2a3db3658a02fa1a15", "max_stars_repo_licenses": ["Apache-2.0"... |
# -*- coding:utf-8 -*-
###############################################################################
# Rutap Bot 2019 Hangul Clock Module #
# 해당 모듈은 한글시계에서 파생된 소프트웨어로서, GPLv3 라이선스의 적용을 받습니다. #
# 모듈 사용시 원작자분께 허락을 받으시길 바랍니다. #
# ... | {"hexsha": "1d4fc7c4808fd7099ec15a4757909fe0a8de1007", "size": 2263, "ext": "py", "lang": "Python", "max_stars_repo_path": "hangul_clock.py", "max_stars_repo_name": "HyunsDev/Rutap-bot_Discord", "max_stars_repo_head_hexsha": "13f664864953e56a4bb887fd9cc29519a58b49db", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
from __future__ import division, absolute_import, print_function
import glob
import argparse
import os
import shutil
import pdb
import numpy as np
from tqdm import tqdm
CONTINUAL_LEARNING_LABELS = ['CC', 'SC', 'EC', 'SQC']
CL_LABEL_KEY = "continual_learning_label"
def main():
parser = argparse.ArgumentParser(d... | {"hexsha": "21b874d5a5239f77ef89feee4906bb387aeb0323", "size": 11782, "ext": "py", "lang": "Python", "max_stars_repo_path": "environments/dataset_merger.py", "max_stars_repo_name": "sun-te/robotics-rl-srl", "max_stars_repo_head_hexsha": "d321085b81eef63dcac58028af87eec6de7633b4", "max_stars_repo_licenses": ["MIT"], "ma... |
from pathlib import Path
import numpy as np
from tensorflow import keras
from tensorflow.keras.preprocessing.image import load_img
class MaskSequence(keras.utils.Sequence):
def __init__(self, base_path, split, batch_size, img_size):
self.batch_size = batch_size
self.img_size = img_size
s... | {"hexsha": "7b2e0c5eede2942dbe7d1c75add953385cc3089d", "size": 1916, "ext": "py", "lang": "Python", "max_stars_repo_path": "fashiondatasets/MaskSequence.py", "max_stars_repo_name": "NiklasHoltmeyer/FashionDatasets", "max_stars_repo_head_hexsha": "a9309f90abd6bff739ecffafd69cf52506f2cb97", "max_stars_repo_licenses": ["M... |
%% Copyright (C) 2014, 2016-2017, 2019, 2022 Colin B. Macdonald
%% Copyright (C) 2020 Mike Miller
%% Copyright (C) 2020 Fernando Alvarruiz
%%
%% This file is part of OctSymPy.
%%
%% OctSymPy is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published
%% b... | {"author": "cbm755", "repo": "octsympy", "sha": "c1ecd1e08f027d5101d0f4250dfc496aa98c8bcd", "save_path": "github-repos/MATLAB/cbm755-octsympy", "path": "github-repos/MATLAB/cbm755-octsympy/octsympy-c1ecd1e08f027d5101d0f4250dfc496aa98c8bcd/inst/@sym/private/mat_rclist_asgn.m"} |
import numpy as np
import os
import textwrap
import tkinter as tk
import tkinter.ttk as tk_ttk
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
TREEVIEW_SELECT_EVENT = '<<treeview_select>>'
class FullDisplay(tk.Frame):
def __init__(self, master):
s... | {"hexsha": "4474ea2f2b460f2931327cd2b8210c28ed377ca0", "size": 5683, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_browser/data_browser.py", "max_stars_repo_name": "gfetterman/file_browser", "max_stars_repo_head_hexsha": "8f54fb0f3a4a1fcce93b98ae44431accd943ac00", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma rt_graph_not_dip [dest]:
"\<And>ip ip' \<sigma> dip. (ip, ip') \<in> rt_graph \<sigma> dip \<Longrightarrow> ip \<noteq> dip"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>ip ip' \<sigma> dip. (ip, ip') \<in> rt_graph \<sigma> dip \<Longrightarrow> ip \<noteq> dip
[PROOF STEP]
unfolding rt... | {"llama_tokens": 261, "file": "AODV_variants_c_gtobcast_C_Loop_Freedom", "length": 2} |
module LibRealSense
# Load in `deps.jl`, complaining if it does not exist
const depsjl_path = joinpath(@__DIR__, "..", "deps", "deps.jl")
if !isfile(depsjl_path)
error("LibRealSense was not build properly. Please run Pkg.build(\"LibRealSense\").")
end
include(depsjl_path)
# Module initialization function
function... | {"hexsha": "575c309884d625c1fd6887594b6d814be89b08da", "size": 977, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/LibRealSense.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/RealSense.jl-1d20419d-a1bd-598e-846b-24709a6a9336", "max_stars_repo_head_hexsha": "3cdc32505064468416fc891dfd877daf265d48... |
import time
from random import *
import numpy as np
import matplotlib.pyplot as plt
def question_1():
# 初始化生成器
seed()
# 返回给定范围内的随机数
print(randrange(-10, 8))
# 返回给定范围内的随机数
print(randint(0, 20))
# 返回给定序列的随机元素
print(choice([1, 2, 5, 3, 5, 7]))
# 返回序列的给定样本
print(sample([1, 2, 3, 5,... | {"hexsha": "d964f09281ac1a16b182274671829ab480293f5a", "size": 2703, "ext": "py", "lang": "Python", "max_stars_repo_path": "basic_exercises/experiment_3.py", "max_stars_repo_name": "vuhe/LearnPython", "max_stars_repo_head_hexsha": "0a081a85456557ae542925cce950b23313c3c9b9", "max_stars_repo_licenses": ["MIT"], "max_star... |
/*
* VisualServoing is a tutorial program for introducing students to
* robotics.
*
* Copyright 2009, 2010 Kevin Quigley <kevin.quigley@gmail.com> and
* Marsette Vona <vona@ccs.neu.edu>
*
* VisualServoing is free software: you can redistribute it andor modify
* it under the terms of the GNU General Public Lice... | {"hexsha": "0dbc5c42afbc92ce92ea827adfc0d1d19f68e9d9", "size": 19550, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Source/rvctools 1/robot/interfaces/crustcrawler/VisualServoing.cpp", "max_stars_repo_name": "Maria-Paulacf/PlumaBot", "max_stars_repo_head_hexsha": "d4bf2e667b88e955f40e33d55db2a8f22c35b47b", "max_... |
import re
import argparse
import emoji
import MeCab
import numpy as np
import matplotlib.pyplot as plt
mecab = MeCab.Tagger('-Ochasen')
letters_pattern = re.compile(r'[a-zA-Z]+')
bracket_pairs = [['[', ']'], ['(', ')'], ['「', '」'], ['『', '』'], ['(', ')'],
['(', ')'], ['(', ')']]
# Non-breaking space... | {"hexsha": "dbe54f8d627f9c590bb3316f3fbe3c593d5c92db", "size": 3836, "ext": "py", "lang": "Python", "max_stars_repo_path": "image-comment-generation/data/clean.py", "max_stars_repo_name": "stonyhu/Image-Commenting", "max_stars_repo_head_hexsha": "eb925a3f99075d8b74c6cabd125f7b9a1f9786d2", "max_stars_repo_licenses": ["A... |
from scipy import spatial
# Find the distance between each embedding
def get_pairwise_dist(embeddings):
return spatial.distance.squareform(spatial.distance.pdist(embeddings, metric="cosine"))
| {"hexsha": "cf15412fe9b44f24408a1a6ad77545e5ccb9c23f", "size": 197, "ext": "py", "lang": "Python", "max_stars_repo_path": "similarity.py", "max_stars_repo_name": "Peter-Devine/text_finder", "max_stars_repo_head_hexsha": "b09ae796511dc1d000b07c12996d25576566e012", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import numpy as np
from core.buffer.replay_buffer import ReplayBuffer
def test_replay_buffer(mock_transition):
buffer_size = 10
memory = ReplayBuffer(buffer_size=buffer_size)
# test after init
assert memory.buffer_size == buffer_size
assert memory.buffer_index == 0
assert memory.size == 0
... | {"hexsha": "026d6ef7181b7626bb6c14f052acf2ba3a45ee56", "size": 1181, "ext": "py", "lang": "Python", "max_stars_repo_path": "jorldy/test/core/buffer/test_replay_buffer.py", "max_stars_repo_name": "zenoengine/JORLDY", "max_stars_repo_head_hexsha": "1eb867e52a03e0282a55fa612cbc5b5de701ffe7", "max_stars_repo_licenses": ["A... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jun 3 01:30:26 2021
@author: alan
"""
import tensorflow as tf
import glob
import random
import tensorflow.keras.layers as layers
import numpy as np
from skimage.io import imread
import os
import matplotlib.pyplot as plt
import cv2
from datetime impor... | {"hexsha": "0cec8392a4c8f81e84914c431af17f474b4de088", "size": 6639, "ext": "py", "lang": "Python", "max_stars_repo_path": "segmentacionCNN.py", "max_stars_repo_name": "alandgabriel/LV-Segmentation-with-U-Net", "max_stars_repo_head_hexsha": "7cfad5791e91321a1d4afb73559dbeeeeaee9347", "max_stars_repo_licenses": ["MIT"],... |
# Copyright (c) 2017- Salas Lin (leVirve)
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import numpy as np
from scipy.optimize import linear_sum_assignment
np.seterr(divide='ignore', invalid='ignore')
def confusion_table(preds, labels, num_class: int):
''' Calculat... | {"hexsha": "b6434705a9c84e6382a3b4cbf62adb6db847cd45", "size": 3520, "ext": "py", "lang": "Python", "max_stars_repo_path": "onegan/metrics/semantic_segmentation.py", "max_stars_repo_name": "leVirve/OneGAN", "max_stars_repo_head_hexsha": "e0d5f387c957fbf599919078d8c6277740015336", "max_stars_repo_licenses": ["MIT"], "ma... |
# Pre-image for Gaussian kernel
# From Kwok and Tsang, "The Pre-Image problem in kernel methods", ICML 2003
# (based on matlab code provided by authors)
# Also:
# Mika, et al. "Kernel PCA and Denoising in Feature Spaces", NIPS 1998
# and
# Teixeira et al. "KPCA Denoising and the pre-image problem revisited", DSP 2008
#... | {"hexsha": "91a4b0374c0e56afcd4ed27c084140bb0e33d2cb", "size": 4055, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/PreImage.jl", "max_stars_repo_name": "daniel-perry/Kernel.jl", "max_stars_repo_head_hexsha": "da7255ffe7b9e1341d4f2decc82128451dc3d383", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
#!/usr/bin/env python
import numpy as np
def get_input(prompt, default):
return input(prompt) or str(default)
N = int(get_input('Number of NUWS dimensions [1]: ', 1))
cos_power = int(get_input('Power of window function, n (cos^n) [2]: ',2))
Nmax = int(get_input('Maximum number of repeats [16]: ', 16))
print('Ple... | {"hexsha": "2669a329c656d228dc07c5c54eb98fa9b7e60c61", "size": 1752, "ext": "py", "lang": "Python", "max_stars_repo_path": "util/make-nuws.py", "max_stars_repo_name": "chriswaudby/pp", "max_stars_repo_head_hexsha": "a1da83b5cba5ebb5e42b846478dc4bce8bace875", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ... |
End of preview. Expand in Data Studio
proof-pile-2のalgebraic-stackからランダムに所得したデータセット
https://huggingface.co/datasets/EleutherAI/proof-pile-2
License see EleutherAI/proof-pile-2
- Downloads last month
- 7