text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
""" identity_vector(l::Integer) """ function identity_vector(l::Integer) IdentityVector(l) end struct IdentityVector{T<:Integer} <: AbstractVector{T} length::T end function getindex(c::IdentityVector{T},i::Integer) where T @assert i > 0 @assert i <= c.length j::T = i j end size(c::IdentityVector) = ...
{"hexsha": "10163ca889e05b169b78eb00cac2e90ad9158f15", "size": 877, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Arrays/IdentityVectors.jl", "max_stars_repo_name": "barche/Gridap.jl", "max_stars_repo_head_hexsha": "70325414653cf0b9822770b150fb082d1a0a5f78", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
""" Show differences between WT and STFT """ from scipy import signal import matplotlib.pyplot as plt import numpy as np import pywt waveletname = 'morl' scales = range(1,200) t = np.linspace(-1, 1, 200, endpoint=False) sig = np.cos(2 * np.pi * 7 * t) + signal.gausspulse(t - 0.4, fc=2) t = np.linspace(-1, 1, 50, en...
{"hexsha": "c2acd711320048cf4096b260d6e85cd5e108c428", "size": 1015, "ext": "py", "lang": "Python", "max_stars_repo_path": "cwt_vs_STFT.py", "max_stars_repo_name": "mn270/Human-Activity-Recognize-HARdataset-", "max_stars_repo_head_hexsha": "861391174f0780c8fe3d69663491076e4c4b737c", "max_stars_repo_licenses": ["MIT"], ...
import numpy as np import math import time import pcl from sklearn.neighbors import NearestNeighbors def nearest_neighbor(src, dst): ''' Find the nearest (Euclidean) neighbor in dst for each point in src Input: src: Nxm array of points dst: Nxm array of points Output: distances:...
{"hexsha": "8f73f35418c53b2a72624b1ed61e11162a7d8af6", "size": 6825, "ext": "py", "lang": "Python", "max_stars_repo_path": "ICP/ICPv1/ICP.py", "max_stars_repo_name": "Yihua-Ni/Tools", "max_stars_repo_head_hexsha": "b40c24b0b2a7025f13182fc5ed5bfcf63b389585", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
[STATEMENT] lemma abs_majorities_intersect: assumes crd: "card E < card S + card T" and s: "S \<subseteq> E" and t: "T \<subseteq> E" and e: "finite E" shows "S \<inter> T \<noteq> {}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. S \<inter> T \<noteq> {} [PROOF STEP] proof (clarify) [PROOF STATE] p...
{"llama_tokens": 1040, "file": "Heard_Of_Majorities", "length": 16}
#!/usr/bin/env python """ Copyright (c) 2019 Microsoft Corporation. All rights reserved. MIT License 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 limita...
{"hexsha": "c9f5608afc9f0e36116ad4efc2c99be8d698cc38", "size": 9541, "ext": "py", "lang": "Python", "max_stars_repo_path": "reader/preprocess.py", "max_stars_repo_name": "gaochangfeng/pykaldi2", "max_stars_repo_head_hexsha": "5e988e5968aa9a5867f8179e6c53ea715ac46bdc", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
import os, time import matplotlib.pyplot as plt import numpy as np import random import tensorflow as tf import genart.tf.charts.data as mdata import genart.tf.charts.model as mmodel import genart.gen_charts as gc physical_devices = tf.config.list_physical_devices('GPU') tf.config.experimental.set_memory_...
{"hexsha": "7012d8b485662be7ac9a31b4cd047c443412ce09", "size": 7513, "ext": "py", "lang": "Python", "max_stars_repo_path": "genart/tf/charts/train_cgan.py", "max_stars_repo_name": "dyf/genart", "max_stars_repo_head_hexsha": "98c8fd31fba4d0e6675809ff4fbc7ea22688bd29", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
# ABIF Reader # =========== export get_tags, tagelements struct AbifDirEntry name::String number::Int32 element_type::Int32 element_size::Int32 num_elements::Int32 data_size::Int32 data_offset::Int32 end """ ABIF.Reader(input::IO) Create a data reader of the ABIF file format. # Argum...
{"hexsha": "6cc53e361d85b51a79cd600e5f169700f70e0b4a", "size": 6372, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/abif/reader.jl", "max_stars_repo_name": "ivirshup/BioSequences.jl", "max_stars_repo_head_hexsha": "3c12124952d26f85df9de88307e24ee5a93b4dab", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
from PIL import Image import numpy as np import cv2 as cv import os, sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from estimate_calories_from_image import compute_volume, compute_calories, compute_volume_with_grabcut, get_foreground_pixels def test(): # helper functions for test ...
{"hexsha": "43cf25207674e104ce1fd69dfd5b85e89c244162", "size": 2297, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/testing/unittests/estimate_calories_from_image_test.py", "max_stars_repo_name": "kallentu/chowdr", "max_stars_repo_head_hexsha": "47efd86025836e04c251c06f86c32d5519b2e0a7", "max_stars_repo...
# Copyright (c) OpenMMLab. All rights reserved. import numpy as np import torch from mmdet.core.bbox.demodata import random_boxes def test_imrenormalize(): from mmtrack.core import imrenormalize img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=Tr...
{"hexsha": "c8bfd53e4f1cd2d0055db1af6c8044acaa5bc045", "size": 5229, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_core/test_track/test_transforms.py", "max_stars_repo_name": "BigBen0519/mmtracking", "max_stars_repo_head_hexsha": "61509b301ccbc2ab14f82a682b94c56f82ce09de", "max_stars_repo_licenses":...
import torch import loader import numpy as np import torch.nn as nn import matplotlib.pyplot as plt import torch.nn.functional as F import network device = loader.device noise_dim = 100 initial_img_size = 2 final_img_size = 32 img_channels = 3 num_classes = 10 batch_size = loader.batch_size epochs = l...
{"hexsha": "5820efa0960cbdf4ef58a06b4bc30450cec5567b", "size": 1645, "ext": "py", "lang": "Python", "max_stars_repo_path": "gans/CGAN/train.py", "max_stars_repo_name": "IvLabs/Variational-DL", "max_stars_repo_head_hexsha": "cd431564ae77ba42a485db17416a6033b32c48fb", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
/** * \file CachedCosinusGeneratorFilter.cpp */ #include "CachedCosinusGeneratorFilter.h" #include <boost/math/constants/constants.hpp> #include <cmath> #include <cstdint> #include <cstring> namespace ATK { template<typename DataType_> CachedCosinusGeneratorFilter<DataType_>::CachedCosinusGeneratorFilter(int ...
{"hexsha": "e5018c49dcdb91408c962290282cd29b3b164e0e", "size": 2674, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "ATK/Tools/CachedCosinusGeneratorFilter.cpp", "max_stars_repo_name": "AudioTK/AudioTK", "max_stars_repo_head_hexsha": "dba42eea68534501efe74692b74edf4792cca231", "max_stars_repo_licenses": ["BSD-3-Cl...
\documentclass[11pt,twoside,fleqn,openright,titlepage]{cslreport} \input{moretext} \raggedbottom \usepackage{cite,relative,url,alltt,times} \usepackage{amsfonts,latexsym,amssymb} \pagenumbering{roman} \setcounter{page}{0} \usepackage[bookmarks=true,hyperindex=true,colorlinks=true,linkcolor=black,citecolor=blue]{hyperr...
{"hexsha": "717e3a4d372fd9e18873833a44167c9590dc99b8", "size": 148112, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "ext/yices/doc/manual/manual.tex", "max_stars_repo_name": "maelvls/ocamlyices2", "max_stars_repo_head_hexsha": "554893d467a4bf3e9b0b630833b417348b15e771", "max_stars_repo_licenses": ["0BSD"], "max_...
""" The Dual Thrust trading algorithm is a famous strategy developed by Michael Chalek. It is a breakout system, commonly used in futures, forex and equity markets. The limits are based on today’s opening price plus or minus a certain percentage of recent trading range. When the price breaks through the upper level, it...
{"hexsha": "c603dd87346c9a2a4ff07b5bada13e265550397f", "size": 8751, "ext": "py", "lang": "Python", "max_stars_repo_path": "backtest/dual_thrust.py", "max_stars_repo_name": "jingmouren/QuantResearch", "max_stars_repo_head_hexsha": "7a17e567b0e95481894ed37524c041b30155b6cb", "max_stars_repo_licenses": ["MIT"], "max_star...
import h5py import numpy as np import os def run(eventid,file, end): # parent_dir = "/Users/parthshah/Documents/Northeastern/Spring2022/BigDataAnalytics/Assignment3/API/Intermediate_Files/" path = "Dummy Variable plz delete" data_path = "/Users/parthshah/Documents/Northeastern/Spring2022/BigDataAnalytics/A...
{"hexsha": "0dcc2e16bc3710083d379c08ff76ed972afecdc6", "size": 1369, "ext": "py", "lang": "Python", "max_stars_repo_path": "API/Functions/datapipeline.py", "max_stars_repo_name": "BigDataArchitecture/Assignment-3-4", "max_stars_repo_head_hexsha": "f4c87dadf443273ed532a8f9ea3c364b9fda75eb", "max_stars_repo_licenses": ["...
import logging import numpy as np import paddle from paddle import fluid from paddle.fluid import dygraph from modules.util import Hourglass, AntiAliasInterpolation2d, kp2gaussian, \ make_coordinate_grid_cpu # ==================== TEST_MODE = False if TEST_MODE: logging.warning('TEST MODE: dense_motion.py') #...
{"hexsha": "96fccf7fd56d4689cdfea019f8cd26da26d3a093", "size": 9656, "ext": "py", "lang": "Python", "max_stars_repo_path": "first_order/src/modules/dense_motion.py", "max_stars_repo_name": "GuoQuanhao/Contrib", "max_stars_repo_head_hexsha": "9069366559d0353c96075ed573222f3fbdfabafe", "max_stars_repo_licenses": ["Apache...
import tensorflow as tf import numpy as np import os from scipy.io import loadmat from epi.util import dbg_check import matplotlib.pyplot as plt # import tensorflow_probability as tfp FANO_EPS = 1e-6 neuron_inds = {"E": 0, "P": 1, "S": 2, "V": 3} def load_SSSN_variable(v, ind=0): # npzfile = np.load("data/V1_Zs...
{"hexsha": "3f24a09d23451ff8f884ff410d0e50d8a368e438", "size": 7867, "ext": "py", "lang": "Python", "max_stars_repo_path": "neural_circuits/SSSN.py", "max_stars_repo_name": "cunningham-lab/epi", "max_stars_repo_head_hexsha": "38febae7035ca921334a616b0f396b3767bf18d4", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta...
import numpy import matplotlib import matplotlib.pyplot as plt import svm_funcs matplotlib.rcParams.update({'font.size': 8}) def plot_data(x_array, y_array, model=None, reg_C=0, linear_boundary=False, nonlinear_boundary=False): # Find indices of positive and negative examples positives = numpy.where(y_arra...
{"hexsha": "ef258d3cd854baa750ed13f0ce7cf65ed2d3f68e", "size": 1523, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/ex6_support_vector_machines/svm_funcs/plot_data.py", "max_stars_repo_name": "ashu-vyas-github/AndrewNg_MachineLearning_Coursera", "max_stars_repo_head_hexsha": "1be5124b07df61f7295dd1c5151b...
[STATEMENT] lemma set_takeWhile_less_sorted: "\<lbrakk> sorted I; x \<in> set I; x < n \<rbrakk> \<Longrightarrow> x \<in> set (takeWhile (\<lambda>x. x < n) I)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>sorted I; x \<in> set I; x < n\<rbrakk> \<Longrightarrow> x \<in> set (takeWhile (\<lambda>x. x <...
{"llama_tokens": 1387, "file": "UTP_toolkit_List_Extra", "length": 9}
""" PyTorch-emulation of ray tracing """ import numpy as np import torch import common.utils as utils import pyrenderer class Raytracing: def __init__(self, settings,# : pyrenderer.RendererInputs, fov_y_radians: float, network_output : str, ste...
{"hexsha": "593a6a04416d172b2a7689cfdf1f72e79107acfd", "size": 13456, "ext": "py", "lang": "Python", "max_stars_repo_path": "applications/common/raytracing.py", "max_stars_repo_name": "shamanDevel/fV-SRN", "max_stars_repo_head_hexsha": "966926ee678a0db0f1c67661537c4bb7eec0c56f", "max_stars_repo_licenses": ["MIT"], "max...
function panel = BstPanel( varargin ) % Constructor for object BstPanel. % A BstPanel object holds mainly a java Swing container to be displayed in the % Brainstorm main window. % % Constructor call : % BstPanel(name, jHandle, sControls) % BstPanel() : just to have a data template % % Data structure % - jHan...
{"author": "brainstorm-tools", "repo": "brainstorm3", "sha": "a892cfaabde1eaa2f9a3ac015c05b73f3739433a", "save_path": "github-repos/MATLAB/brainstorm-tools-brainstorm3", "path": "github-repos/MATLAB/brainstorm-tools-brainstorm3/brainstorm3-a892cfaabde1eaa2f9a3ac015c05b73f3739433a/toolbox/gui/@BstPanel/BstPanel.m"}
# -*- coding: utf-8 -*- # Copyright © 2021 Patrick Levin # SPDX-Identifier: MIT from dataclasses import dataclass from enum import IntEnum import numpy as np import os import tensorflow as tf from PIL.Image import Image from typing import List, Optional, Sequence, Tuple, Union from fdlite import ArgumentError...
{"hexsha": "f6828edaa83222473fcbe447db46dd8a69861fe6", "size": 21163, "ext": "py", "lang": "Python", "max_stars_repo_path": "fdlite/iris_landmark.py", "max_stars_repo_name": "joshtrivedi/face-detection-tflite", "max_stars_repo_head_hexsha": "6ae3bc770dd029af0c1c716d46ace6c8ced05fef", "max_stars_repo_licenses": ["MIT"],...
function DAt = getDAtm(A,Ablkjc,dense,DAtdenq,d,K) % DAt = getDAtm(A,Ablkjc,dense,DAtdenq,d,K) % % GETDATM Computes d[k]'*Aj[k] for each lorentz block k and constraint j. % % ******************** INTERNAL FUNCTION OF SEDUMI ******************** % % See also sedumi, getada2. % This file is part of SeDuMi 1.1 by Imre P...
{"author": "zarathustr", "repo": "LibQPEP", "sha": "99e5c23e746ace0bac4a86742c31db6fcf7297ba", "save_path": "github-repos/MATLAB/zarathustr-LibQPEP", "path": "github-repos/MATLAB/zarathustr-LibQPEP/LibQPEP-99e5c23e746ace0bac4a86742c31db6fcf7297ba/MATLAB/sedumi/getDAtm.m"}
[STATEMENT] lemma "ipv4_cidr_toString (ipv4addr_of_dotdecimal (192,168,0,1), 22) = ''192.168.0.1/22''" [PROOF STATE] proof (prove) goal (1 subgoal): 1. ipv4_cidr_toString (ipv4addr_of_dotdecimal (192, 168, 0, 1), 22) = ''192.168.0.1/22'' [PROOF STEP] by eval
{"llama_tokens": 152, "file": "Simple_Firewall_Primitives_Primitives_toString", "length": 1}
""" from https://www.manishkurse.com/PythonProjects/Analyze_Fitbit_Data.html # Import libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from datetime import datetime % matplotlib inline import seaborn as sns import fitbit from datetime import timedelta import csv import sys, os from col...
{"hexsha": "11ccbb5015e4333c663e06053c665aa40f2df10e", "size": 25408, "ext": "py", "lang": "Python", "max_stars_repo_path": "example.py", "max_stars_repo_name": "hunterdp/fitbit-tracker", "max_stars_repo_head_hexsha": "9109e6a1e553bd8007a80961d4d4707f3f60ae55", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, ...
function y2 = discrim_plot(discf,y,varargin) % y2 = discrim_plot(discf,y,[new figure],[column to do partial corr plot of]) % % Plots correlation or partial correlation % Color codes by median split of y % % see also: % cluster_discrim % cluster_discrim_montage dofig = 1; dopr = 0; if length(varargin) > 0, dofig = vara...
{"author": "canlab", "repo": "CanlabCore", "sha": "af242e120f0480c4feaeea90471c015a14f1f60e", "save_path": "github-repos/MATLAB/canlab-CanlabCore", "path": "github-repos/MATLAB/canlab-CanlabCore/CanlabCore-af242e120f0480c4feaeea90471c015a14f1f60e/CanlabCore/Cluster_contig_region_tools/Cluster-based_multivar_tools/discr...
#include <boost/graph/adjacency_list.hpp> #include <boost/graph/breadth_first_search.hpp> #include <boost/graph/named_function_params.hpp> #include <boost/graph/visitors.hpp> #include <boost/array.hpp> #include <array> #include <utility> #include <algorithm> #include <iostream> int main() { enum { topLeft, topRight,...
{"hexsha": "240a26a45bd4108719e3b50a9678a2e276900d0b", "size": 1107, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "Example/graph_09/main.cpp", "max_stars_repo_name": "KwangjoJeong/Boost", "max_stars_repo_head_hexsha": "29c4e2422feded66a689e3aef73086c5cf95b6fe", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
% !TeX spellcheck = en_US % !TeX TS-program = xelatex \documentclass[11pt]{ltxdoc} \usepackage{color} \usepackage{xspace,fancyvrb,longtable,booktabs} \usepackage[neverdecrease]{paralist} \usepackage[format=hang,labelfont=bf,labelsep=period]{caption} \definecolor{xpgblue}{rgb}{0.02,0.04,0.48} \definecolor{lightblue}{rgb...
{"hexsha": "262b64f999de7b9441e5ef111e1b1ae274c3740d", "size": 127718, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "doc/polyglossia.tex", "max_stars_repo_name": "jspitz/polyglossia", "max_stars_repo_head_hexsha": "83332f10cee52ed34d1fb6601e23f29ce0659a27", "max_stars_repo_licenses": ["LPPL-1.3c"], "max_stars_co...
import numpy as np #fermion number N=500 dk=2*np.pi/N kIndHalf=range(0,int(N)) #parameters before quench mu0=0 t0=1.0 d0=-1.0 #parameters after the quench mu1=1 t1=t0 d1=d0 lmd=3 lmdAll=range(0,20) threadNum=12 #occupation ratio rho=1 tol=1e-15 #dict of spectrum deltaKAll=dict() EkAll=dict() linEAll=[] h0Val = lmd...
{"hexsha": "7289dd2a5e9edbe020dca667022ededea579110d", "size": 452, "ext": "py", "lang": "Python", "max_stars_repo_path": "consts.py", "max_stars_repo_name": "saschapojot/kerrKitaevSpectrum", "max_stars_repo_head_hexsha": "e5eb6307e4e6993f376d86eae824201ed0419fe7", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
#ifndef MULTI_NODE_WORKER_THREAD_H_ #define MULTI_NODE_WORKER_THREAD_H_ #include <boost/atomic.hpp> #include <boost/thread.hpp> #include <boost/unordered_map.hpp> #include <string> #include <vector> #include "caffe/caffe.hpp" #include "caffe/multi_node/msg.hpp" #include "caffe/multi_node/sk_server.hpp" #include "c...
{"hexsha": "26f8e81ad1a4290376ebe7537f89891612640fc2", "size": 6712, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/caffe/multi_node/worker_thread.hpp", "max_stars_repo_name": "AIROBOTAI/caffe-mnode", "max_stars_repo_head_hexsha": "e8b03bfb04f09dce21c9b5bbf66dacecb095d3e1", "max_stars_repo_licenses": ["BS...
import argparse import logging import sys from aoc import __version__ import numpy as np __author__ = "Miguel Á. Lobato" __copyright__ = "Miguel Á. Lobato" __license__ = "MIT" _logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) def is_card_winner(numbers, card): t_mark_success = np.f...
{"hexsha": "39f0f563a355b50237f032a504875fef1c47dee0", "size": 1746, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/aoc/day4.py", "max_stars_repo_name": "miguellobato84/aoc2021", "max_stars_repo_head_hexsha": "c7651c7b273b513ed9399b6bcdc212655e481e98", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
#!/usr/bin/env python """ Larch Tests Version 1 """ import unittest import time import ast import numpy as np from sys import version_info from ut_base import TestCase from larch import Interpreter class TestEval(TestCase): '''testing of asteval''' def test_function1(self): "test function definition ...
{"hexsha": "4117e3c6dbfbbeb4052fcd5cccaac1bbed7b6f20", "size": 5950, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unittest_funccalls.py", "max_stars_repo_name": "xraypy/_xraylarch_attic", "max_stars_repo_head_hexsha": "a78a2d257bccb081ad15c43c831dee51d0b4845a", "max_stars_repo_licenses": ["BSD-3-Clause"...
[STATEMENT] lemma correctCompositionIn_prop1: assumes "subcomponents PQ = {P,Q}" and "correctCompositionIn PQ" and "x \<in> (ins PQ)" shows "(x \<in> (ins P)) \<or> (x \<in> (ins Q))" [PROOF STATE] proof (prove) goal (1 subgoal): 1. x \<in> ins P \<or> x \<in> ins Q [PROOF STEP] using assms [PROOF STAT...
{"llama_tokens": 220, "file": "CryptoBasedCompositionalProperties_Secrecy", "length": 2}
% Options for packages loaded elsewhere \PassOptionsToPackage{unicode}{hyperref} \PassOptionsToPackage{hyphens}{url} \PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor} % \documentclass[ ]{krantz} \usepackage{lmodern} \usepackage{amssymb,amsmath} \usepackage{ifxetex,ifluatex} \ifnum 0\ifxetex 1\fi\ifluatex 1\...
{"hexsha": "ea09bbf300bd4523443d21f4f4a2bd95e694c427", "size": 113277, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "_book/bookdown.tex", "max_stars_repo_name": "dstanley4/psyc3250bookdown", "max_stars_repo_head_hexsha": "1623b074092bd36d4a31bda05fd5525d9c91dd22", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
export capacity, sample, SumTree import StatsBase: sample """ SumTree(capacity::Int) Efficiently sample and update weights. For more detals, see the post at [here](https://jaromiru.com/2016/11/07/lets-make-a-dqn-double-learning-and-prioritized-experience-replay/). Here we use a vector to represent the binary tree...
{"hexsha": "d0b669fc321890bc641f8e8e6bfa35efa8c2a6a3", "size": 3819, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Utils/sum_tree.jl", "max_stars_repo_name": "UnofficialJuliaMirror/ReinforcementLearning.jl-158674fc-8238-5cab-b5ba-03dfc80d1318", "max_stars_repo_head_hexsha": "5c10dba7fd85b15c8e10e826425c5be6...
import mindboggle.guts import numpy import os.path import scipy.io import glob import functools from . import MultiprocPipeline as Pipeline def read_vtk(filename) : points, indices, lines, faces, depths, scalar_names, npoints, input_vtk = mindboggle.mio.vtks.read_vtk(filename) return numpy.array(points), num...
{"hexsha": "5a68f3f6454c134e760f103f08cfc14763aa11ba", "size": 3339, "ext": "py", "lang": "Python", "max_stars_repo_path": "mindboggle/x/test_zernike/multiproc/test.py", "max_stars_repo_name": "cemlyn007/mindboggle", "max_stars_repo_head_hexsha": "947d4b3f41fb7a24c079550c7255c4d16939d740", "max_stars_repo_licenses": ["...
module type_model_wrapper use type_model, only: model_t implicit none !> A wrapper enabling arrays of abstract model_t classes. !! !! @author Nathan A. Wukie !! @date 11/29/2016 !! !! !-------------------------------------------------------------------- type, public :: mo...
{"hexsha": "16d5054675f393c29acb8650e0a57e1239319e01", "size": 516, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/equations/type_model_wrapper.f90", "max_stars_repo_name": "wanglican/ChiDG", "max_stars_repo_head_hexsha": "d3177b87cc2f611e66e26bb51616f9385168f338", "max_stars_repo_licenses": ["BSD-3-Claus...
\section{Dataset sources}\label{sec:dataset-sources} This dataset is composed of 10 English instruction manuals with 453 pages detailing assembly operations of alternators, engines and gearboxes (more details shown in \cref{tab:dataset-sources_dataset-overview}). These object categories were selected because they have...
{"hexsha": "9ee87ecc9c39b466c14055e5108424d593a0049b", "size": 5117, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "article/tex/sections/dataset-sources.tex", "max_stars_repo_name": "carlosmccosta/Assembly-Named-Entity-Recognition-Dataset", "max_stars_repo_head_hexsha": "9dfc09f15ede9cfe9f819c7ef6b652a52f298100",...
# This is modified from Upenn MEAM 620 course: # https://alliance.seas.upenn.edu/~meam620/wiki/index.php import numpy as np import torch import matplotlib.pyplot as plt class qd_object: """ Struct to hold qd information """ def __init__(self): self.pos = 0 self.vel = 0 self.eule...
{"hexsha": "fd8089dc9ca153cb33a12e45cf1f6813f72c6617", "size": 11440, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/quadrotor/controller_utils.py", "max_stars_repo_name": "thaipduong/SE3HamiltonianDynsLearning", "max_stars_repo_head_hexsha": "caf385cf810055e88314e6e4b39b566f9a0be419", "max_stars_repo_...
struct Gtilde{Y<:AbstractVector{<:Real}, A<:Dirichlet, B<:Union{Normal, <:OrderedNormalMeanPrior}, C<:Real, D<:LogNormal, E<:Normal, F<:Gamma} <: MCMC.Model yC::Y # finite log expressions from control group yT::Y # finite log expressions from treatment group K::Int # number of mixt...
{"hexsha": "e9f953264d29ab7d088171c962250ad06e0ba44e", "size": 4268, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/models/Gtilde.jl", "max_stars_repo_name": "luiarthur/CytofDiffDensity.jl", "max_stars_repo_head_hexsha": "11370917a13a8291e096fe2dcb81644ba01d399b", "max_stars_repo_licenses": ["MIT"], "max_sta...
import os from sklearn.model_selection import train_test_split import numpy as np from tensorflow.keras.preprocessing.image import ImageDataGenerator from tensorflow.keras.utils import to_categorical from tensorflow.keras.layers import Conv2D, Dense, Dropout, Flatten, Input, Add, GlobalAveragePooling2D, DepthwiseConv2D...
{"hexsha": "b1043c734834d1a40af4682e03d47229a1c8307a", "size": 8370, "ext": "py", "lang": "Python", "max_stars_repo_path": "asl.py", "max_stars_repo_name": "dexhunter/ObfGAN", "max_stars_repo_head_hexsha": "5b20c4e79eb52923a9d69e3d0584165829f611c9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_star...
# -*- coding: utf-8 -*- """Evaluating NoTram models from the National Library of Norway: NER and POS Copyright 2020 &copy; National Library of Norway Evaluating NoTram models from the National Library of Norway: NER and POS """ # Dependencies # !pip -q install https://github.com/huggingface/transformers/archive/0ecbb...
{"hexsha": "a1a69d4202e840d450d57f491459aca93ee80ce2", "size": 29742, "ext": "py", "lang": "Python", "max_stars_repo_path": "evaluation/notram_eval.py", "max_stars_repo_name": "NbAiLab/notram", "max_stars_repo_head_hexsha": "0c90d6b28008df514c4ac847e4c9d68f4709a181", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
import pickle from pathlib import Path import cv2 import numpy as np __all__ = ["Camera", "CALIBRATION_DATA_PATH"] CALIBRATION_DATA_PATH = "camera_cal/calibration.dat" class Camera: @staticmethod def undistort(distorted_img, calibration_data, **kwargs): (_, mtx, dist, _, _) = calibration_data ...
{"hexsha": "d9f442331818a0ec483e964d991690839ff5a926", "size": 1840, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/camera.py", "max_stars_repo_name": "yashgorana/lane-detection-advanced", "max_stars_repo_head_hexsha": "83201bc275e7a767220fb478dd902e3b96b39e68", "max_stars_repo_licenses": ["MIT"], "max_star...
%!TEX root = TDT4265-Summary.tex \section{Representation and description} The results of image segmentation (Section \ref{sec:segmentation}) can be represented and described in certain ways to be useful for computers. For instance, a region can be represented by its boundary, and the boundary described by its lenght....
{"hexsha": "6bb53422a9ac707c6a0b996d5ff2a35d48bddf85", "size": 13908, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "TDT4265 Computer vision/11-representation-and-description.tex", "max_stars_repo_name": "jakoblover/ntnu-course-summaries", "max_stars_repo_head_hexsha": "8ba859de2349b93c5079ca10a4cf2ec49c1f5dc0", ...
module geos5_io_module use hdf5 implicit none contains subroutine find_geos5_bounds(istart, iend, jstart, jend, lat, lon) integer, intent(inout) :: istart, iend, jstart, jend real, dimension(:,:), intent(in) :: lat, lon real :: minLat, maxLat, minLon, maxLon real, parameter :: dlon = 5./16. real, ...
{"hexsha": "3d90379f3e09dadb980a47ff13db30d2cf0f64f5", "size": 3799, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/Components/MCARS/SFC_APP/geos5_io_module.f90", "max_stars_repo_name": "GEOS-ESM/AeroApps", "max_stars_repo_head_hexsha": "874dad6f34420c014d98eccbe81a061bdc0110cf", "max_stars_repo_licenses"...
# Copyright 2019 Google 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 in writing, ...
{"hexsha": "480b139569bfbfc4148fd6d7f172b96a83dedaa5", "size": 36395, "ext": "py", "lang": "Python", "max_stars_repo_path": "tensorflow_data_validation/statistics/generators/basic_stats_generator.py", "max_stars_repo_name": "brills/data-validation", "max_stars_repo_head_hexsha": "4f8a5d12b3d5db7383ae53d5fe184af1d781449...
import pandas as pd import numpy as np from sklearn.model_selection import StratifiedKFold from sklearn.model_selection import train_test_split from sklearn.model_selection import cross_val_score from sklearn.preprocessing import OneHotEncoder from sklearn.preprocessing import StandardScaler from sklearn.preprocessing...
{"hexsha": "d1ba5dca5b027c3924f9ffd187c16c576673c6d5", "size": 10208, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/visualizations.py", "max_stars_repo_name": "jeffreyhwatson/terry_stops_project", "max_stars_repo_head_hexsha": "9aa82ee4c2148e7f675d6eea5ab24409d0f2b129", "max_stars_repo_licenses": ["CC-BY-2...
#!/usr/bin/env python # coding: utf-8 import numpy as np import os import csv import datetime import pickle from PIL import Image import torch import torch.nn as nn from torch.utils.data import DataLoader, Dataset from torchvision import transforms class Conv4Net_1Channel_Narrow(nn.Module): def __init__(self, d...
{"hexsha": "5f8ccb16757c4eb69a95fcbc6b250afc656d0985", "size": 18882, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/models/CNNArchitectures.py", "max_stars_repo_name": "ianscottknight/leaf-count", "max_stars_repo_head_hexsha": "bfefadfdb6aaab141d526ad3bbdfc5f89138c60c", "max_stars_repo_licenses": ["FTL"], ...
(** 以下代码会预先导入关于整数的定义、证明以及自动证明指令。*) Require Import Coq.ZArith.ZArith. Require Import Coq.micromega.Psatz. Local Open Scope Z. (** * 归纳类型的又一个例子:二叉树 *) Inductive tree: Type := | Leaf: tree | Node (l: tree) (v: Z) (r: tree): tree. (** 这个定义说的是,一棵二叉树要么是一棵空树_[Leaf]_,要么有一棵左子树、有一棵右 子树外加有一个根节点整数标号。Coq中,我们往往可以使用递归函数定义归纳...
{"author": "gzqaq", "repo": "CS2612-PLaC", "sha": "fb7be0651785905b60d3e705324175daaadcc96b", "save_path": "github-repos/coq/gzqaq-CS2612-PLaC", "path": "github-repos/coq/gzqaq-CS2612-PLaC/CS2612-PLaC-fb7be0651785905b60d3e705324175daaadcc96b/assigns/assign0916/CoqInductiveType.v"}
""" A simple Python module to obtain energy levels of superconducting qubits by sparse Hamiltonian diagonalization. """ import numpy as np import sympy from scipy.sparse.linalg import * from abc import ABCMeta from abc import abstractmethod import logging import scqubits.core.constants as constants import scqubits.co...
{"hexsha": "fae4b25fa068c67fc699b3261df4c4a13e08971b", "size": 37408, "ext": "py", "lang": "Python", "max_stars_repo_path": "scqubits/core/circuit/circuit.py", "max_stars_repo_name": "IlyaLSMmisis/scqubits-1", "max_stars_repo_head_hexsha": "c4915c998c2d1ef3348db0e4c423e74c7181da40", "max_stars_repo_licenses": ["BSD-3-C...
@with_kw mutable struct MPCOptions{T} "Maximum horizon of the MPC" h::T=3.0 "Maximum number of MPC steps" M::Int=300 end mutable struct MPCStatistics{T} iter::Int t::T dt::Vector{T} traj::Vector{Algames.KnotPoint} end function MPCStatistics() iter = 0 t = 0.0 dt = zeros(0)...
{"hexsha": "909b0e459b3e852ed463b1cb0cfd354da72da318", "size": 1526, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/mpc/mpc_struct.jl", "max_stars_repo_name": "simon-lc/AlgamesPlots.jl", "max_stars_repo_head_hexsha": "18851ea53168bbd1ab5c1c7f1116f8194d2c3091", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
import numpy as np from nbodykit.lab import cosmology as nbodykit_cos from power_spectrum import PowerSpec from rescale import Rescale from scipy.optimize import minimize class Cosmo(object): """ Cosmology class, used for finding a set of rescaled cosmological parameters Args: z: snapshot...
{"hexsha": "0d188b47ad8eb059d03b15285b8ac453ed90fe52", "size": 5358, "ext": "py", "lang": "Python", "max_stars_repo_path": "get_cosmo.py", "max_stars_repo_name": "amjsmith/rescale-cosmology", "max_stars_repo_head_hexsha": "1980fa89a4acc95e2a1effb3b0939af8e8dca275", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star...
SUBROUTINE PD_CAPE ( zbot, ztop, thbot, thtop, thpbot, thptop, + cape, cins ) C************************************************************************ C* PD_CAPE ( ZBOT, ZTOP, THBOT, THTOP, THPBOT, THPTOP, CAPE, CINS ) * C* * C* This routine calculates CAPE & CINS for a specifie...
{"hexsha": "baca7426a6f30a5d75295a6a1e75279b2f9042a2", "size": 1977, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "gempak/source/diaglib/pd/pdcape.f", "max_stars_repo_name": "oxelson/gempak", "max_stars_repo_head_hexsha": "e7c477814d7084c87d3313c94e192d13d8341fa1", "max_stars_repo_licenses": ["BSD-3-Clause"], ...
/////////////////////////////////////////////////////////////////////////////// // BSD 3-Clause License // // Copyright (C) 2019-2020, LAAS-CNRS, New York University, Max Planck Gesellschaft, // University of Edinburgh // Copyright note valid unless otherwise stated in individual files. // All ...
{"hexsha": "92f6f00632fc47516818c330a66742b34f011e2d", "size": 2545, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "include/crocoddyl/core/solvers/kkt.hpp", "max_stars_repo_name": "pFernbach/crocoddyl", "max_stars_repo_head_hexsha": "cbf81a329e3abaf4ce1b4a8fab1431f93cd9a5c8", "max_stars_repo_licenses": ["BSD-3-Cl...
""" chain = mcmc(θ, reps, burnin, Prior, lnL, Proposal) Simple MH MCMC You must set the needed functions, e.g.,: Prior = θ -> your_prior(θ, whatever other args) lnL = θ -> your_log_likelihood(θ, whatever other args) Proposal = θ -> your_proposal(θ, whatever other args) (optionally) mcmcPr...
{"hexsha": "04a4043045ee1904c059aab413bb5a89ca0b9e34", "size": 4540, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Bayesian/mcmc.jl", "max_stars_repo_name": "mcreel/Econometrics", "max_stars_repo_head_hexsha": "f87efde84de6121afa9908b64961ca97e53e251c", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
import numpy as np from matplotlib import pyplot as plt from scipy import stats import figlatex sigma = 1 c = 0.99 * sigma ** 2 deltau = sigma / 100 N = 5 * sigma / deltau u = np.linspace(0, 5 * sigma, 1000) ########################### def pcross0(u, sigma): return stats.norm.sf(u, scale=sigma) def pcross1(u, ...
{"hexsha": "7ce98346f17a47e0eea749cc1a1b9ad98e06f7f3", "size": 1482, "ext": "py", "lang": "Python", "max_stars_repo_path": "figthesis/figcrossingprob.py", "max_stars_repo_name": "Gattocrucco/sipmfilter", "max_stars_repo_head_hexsha": "74215d6c53b998808fc6c677b46030234d996bdf", "max_stars_repo_licenses": ["CC-BY-4.0", "...
#!/usr/bin/env python3 # # Copyright (c) Bo Peng and the University of Texas MD Anderson Cancer Center # Distributed under the terms of the 3-clause BSD License. import os import sys import unittest from ipykernel.tests.utils import execute, wait_for_idle from sos_notebook.test_utils import (get_display_data, get_std...
{"hexsha": "d0b38e6212d597d6af5a3aa4f4413eb431766e54", "size": 10640, "ext": "py", "lang": "Python", "max_stars_repo_path": "test/test_sos_magics.py", "max_stars_repo_name": "aadithpm/sos-notebook", "max_stars_repo_head_hexsha": "62ac5d56a12b4ce2d4aaf4c60311e6a85c197baa", "max_stars_repo_licenses": ["BSD-3-Clause"], "m...
from worldBuilderTest import Rectangle from naiveRules import * import numpy as np #OLD but works. Will be replaced soon. # Cross space is a transformation from icon space. Here instead of keepeing track of where # icons are, it keeps track of the connections between icons. # This space will further be used as for ...
{"hexsha": "7b228c49e9a80ceb0ab3d7d6a2d6d7a34fde81b3", "size": 2299, "ext": "py", "lang": "Python", "max_stars_repo_path": "NaivecrossStateSpace.py", "max_stars_repo_name": "Sjokoladepapir/iconbounce", "max_stars_repo_head_hexsha": "74a868aff9e4da49a952b98f3e6738d3aa4eda56", "max_stars_repo_licenses": ["MIT"], "max_sta...
import numpy as np def solve(puzzle: np.ndarray) -> np.ndarray: return puzzle
{"hexsha": "a22f13c3253ab1b6cff98d414d7699238bdadcc8", "size": 84, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/decrypter/solver.py", "max_stars_repo_name": "headma5ter/decrypter", "max_stars_repo_head_hexsha": "35cce659caa87943cc5586181f0b5df0f2ea43f3", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
"""Contains the n dimensional inverted pendulum environment.""" import warnings from typing import Optional import matplotlib.pyplot as plt import numpy as np from numpy import ndarray from polytope import polytope from scipy.integrate import ode from scipy.spatial.qhull import ConvexHull from ..utils import assert_s...
{"hexsha": "b6f376b60a00ab17f19cd60c626a3bd2ccf60f7f", "size": 12589, "ext": "py", "lang": "Python", "max_stars_repo_path": "safe_exploration/environments/ndpendulum.py", "max_stars_repo_name": "oscarkey/safe-exploration", "max_stars_repo_head_hexsha": "32f0582a7b54ab7d4c1d415afbcf5e9554e8bcec", "max_stars_repo_license...
#pragma once #include "boost_defs.hpp" #include "logger.hpp" #include <boost/functional/hash.hpp> #include <cstdint> #include <ostream> namespace krbn { class mouse_key final { public: mouse_key(void) : x_(0), y_(0), vertical_wheel_(0), horizontal_wheel_(...
{"hexsha": "e2669eb22ef9b1092c5839a47e76fa0037318f0b", "size": 4889, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/share/types/mouse_key.hpp", "max_stars_repo_name": "cyrusccy/Karabiner-Elements", "max_stars_repo_head_hexsha": "90f83e487a0b6c671bc76f48c01e91fb28ae67c2", "max_stars_repo_licenses": ["Unlicense...
from keras.utils import Sequence import numpy as np from dataset import convert_corpus class BatchGenerator(Sequence): "Generator for Keras" def __init__(self): self.vectors = MagitudeVectors(emdim).load_vectors() with open(self.input_file, 'r', encoding="utf-8") as f: ...
{"hexsha": "c9d68ad5f0dd54ac7a6d3cebe9db147d3b347118", "size": 1282, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/batch_generator.py", "max_stars_repo_name": "gajanlee/V-net", "max_stars_repo_head_hexsha": "feba60bdb2688041fb4fe2c6970ca1b1505e0a65", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_co...
import numpy as np import matplotlib.pyplot as plt import pandas as pd from scipy.spatial import distance from sklearn.cluster import KMeans class Pattern: def __init__(self, img, num_colors): self.img = img self.num_colors = num_colors def import_colormap(self): clr_df = pd.re...
{"hexsha": "c6243afc8a1c9885af27d948bb71d7ff92d452fe", "size": 3744, "ext": "py", "lang": "Python", "max_stars_repo_path": "Pattern/pattern.py", "max_stars_repo_name": "lransohoff/CrossStitchPatternGen", "max_stars_repo_head_hexsha": "5ac17ab60aefaf439c640baea1b9657f8d263880", "max_stars_repo_licenses": ["MIT"], "max_s...
SUBROUTINE SOLGEN(KCOORD,TSEC50,RSUN,IFLAG) IMPLICIT REAL*8(A-H,O-Z) C C CALCULATE THE POSITION OF THE SUN IN A SPECIFIED COORDINATE SYSTEM C C VARIABLE TYPE I/O DESCRIPTION C -------- ---- --- ----------- C C KCOORD I*4 I FLAG IDICATING WHICH COORDINATE SYSTEM IS WANTED. C C = 1, GEO...
{"hexsha": "9ec4db19c9d9882b393a88e0d0395448f1be8598", "size": 1576, "ext": "for", "lang": "FORTRAN", "max_stars_repo_path": "gsc-13083/solgen.for", "max_stars_repo_name": "SteveDoyle2/nasa-cosmic", "max_stars_repo_head_hexsha": "c8015a9851a04f0483b978d92c2cbaee31c81fe3", "max_stars_repo_licenses": ["BSD-Source-Code"],...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2020 Patrick Lumban Tobing (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division from distutils.util import strtobool import argparse import logging import math import os import sys import time import...
{"hexsha": "53b61fb2c004b0aa1d4bbd07dc9c752b4a6d0dda", "size": 13984, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/bin/decode_wavernn_dualgru_compact_lpc.py", "max_stars_repo_name": "ml-applications/cyclevae-vc-neuralvoco", "max_stars_repo_head_hexsha": "a1976c127eaf9d2a3ef7a8a783839743ffb69c5c", "max_sta...
\documentclass[main.tex]{subfiles} \begin{document} \section{Chapter 1} This is Chapter 1, provided in a sub file. \end{document}
{"hexsha": "9b3f38f589fd6c73f26f744838705158b58e80ed", "size": 134, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Tests/files/command/sub-file-chapter-1.tex", "max_stars_repo_name": "zspitz/PandocFilters", "max_stars_repo_head_hexsha": "a73d25afa28e5db69cddcd66822ed93cc637be8b", "max_stars_repo_licenses": ["MIT"...
import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F from dgl import topological_nodes_generator from copy import deepcopy from collections import OrderedDict # # # class resnet(nn.Module): def __init__(self, in_dim, hidden_dim, out_dim=None): super(resnet, self).__...
{"hexsha": "b5761c8a4db70fae1444780db584634dd3ecfaa1", "size": 17501, "ext": "py", "lang": "Python", "max_stars_repo_path": "PFPO/model/bignn.py", "max_stars_repo_name": "phillipcpark/PredictiveFPO", "max_stars_repo_head_hexsha": "1fbbccd8b01056ef124960e5a0d214690a007dc3", "max_stars_repo_licenses": ["MIT"], "max_stars...
# Licensed under a 3-clause BSD style license - see LICENSES import numpy as np import pytest import sncosmo try: from matplotlib.figure import Figure HAS_MATPLOTLIB = True except: HAS_MATPLOTLIB = False @pytest.mark.skipif('not HAS_MATPLOTLIB') class TestPlotLC: def setup_class(self): # Crea...
{"hexsha": "3de8ffac99f1985844cbe4a8eea8e05a93b3c642", "size": 791, "ext": "py", "lang": "Python", "max_stars_repo_path": "sncosmo/tests/test_plotting.py", "max_stars_repo_name": "rbiswas4/sncosmo", "max_stars_repo_head_hexsha": "813b707044fd21e8e35e7a1cdc650b48417f0ebc", "max_stars_repo_licenses": ["BSD-3-Clause"], "m...
""" PyTorch의 LSTM을 사용해보기 위한 연습용 코드 Usage: python PyTorch_LSTM_Sample.py """ import torch import torch.nn as nn import numpy as np import torch.optim as optim import os, sys import matplotlib.pyplot as plt class Net(nn.Module): """ 신경망 구성 클래스 """ def __init__(self, input_size, hidden_...
{"hexsha": "b9315bec2aea6ba77978ed3005f9756a72c92629", "size": 3611, "ext": "py", "lang": "Python", "max_stars_repo_path": "library_review/PyTorch_LSTM_Sample.py", "max_stars_repo_name": "zzong2006/space-filling-curve-with-RF-learning", "max_stars_repo_head_hexsha": "30823745dae91240c0977185fb1831c9b4771a40", "max_star...
# ****************************************************************************************** # Notices: # # Copyright © 2022 United States Government as represented by the Administrator of the # National Aeronautics and Space Administration. All Rights Reserved. # # Disclaimers # # No Warranty: THE SUBJECT SOFTWARE IS...
{"hexsha": "eb4076cef2bb038b79e967a9ced90498b1f1b5d6", "size": 7485, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/solvers/global/SoftActorCritic/src/distributed.jl", "max_stars_repo_name": "NASA-SW-VnV/AdaStress.jl", "max_stars_repo_head_hexsha": "a8802eeb2c7890a100ff87470853b7d1acda03fb", "max_stars_repo_...
// Copyright 2020 Gareth Cross #pragma once #include <gtest/gtest.h> #include <Eigen/Dense> // Numerical tolerances for tests. namespace tol { static constexpr double kDeci = 1.0e-1; static constexpr double kCenti = 1.0e-2; static constexpr double kMilli = 1.0e-3; static constexpr double kMicro = 1.0e-6; static conste...
{"hexsha": "3382278225503799d75021496afad7ca0b9426de", "size": 3765, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "test/test_utils.hpp", "max_stars_repo_name": "gareth-cross/geometry_utils", "max_stars_repo_head_hexsha": "cc687d19559c2055b68e7f8708af3595e7f93917", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
# Test that basic function works and that it doesn change the mean @test all(findcenteredmean(m, only_positive = true) .>= 0) @test all(getmean(m) .== means) # Try different centers and changing the mean @test isa(findcenteredmean(m, center = :analytic), Vector) @test all(findcenteredmean(m, center = :analytic, only_p...
{"hexsha": "968b424db99068203b9f06ac12b0cdc37fa68f0d", "size": 576, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/find_center.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/FlexibilityAnalysis.jl-a86d3b49-e43c-5f8d-b693-d32ec726be17", "max_stars_repo_head_hexsha": "25cea23289e03630a293d6b96d9f...
/**************************************************************************\ | | Copyright (C) 2009 Marc Stevens | | 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 3 of...
{"hexsha": "3178b009b12517685346f413f1326b9858c81afa", "size": 5637, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/md5backward/backward.cpp", "max_stars_repo_name": "killua4564/hashclash", "max_stars_repo_head_hexsha": "f780f17ef579e4bb246f5c47f31765f665dab74f", "max_stars_repo_licenses": ["MIT"], "max_stars...
''' ResourceAllocationTasks.py : basic resource allocation tasks Cem Karaoguz, 2020 MIT License ''' import numpy as np class JacksCarRental: N_CARS_MAX_REQUESTS = 7 N_CARS_MAX_RETURNS = 7 def __init__(self, nCarsMaxA=20, nCarsMaxB=20, nCarsMaxRelocate=5, lambdaCarRequestA=3, lambdaCarRequestB=4, lamb...
{"hexsha": "b97ad6578fbb8213036f3d2f0d3c793ed77ba302", "size": 10214, "ext": "py", "lang": "Python", "max_stars_repo_path": "IRL/environments/ResourceAllocationTasks.py", "max_stars_repo_name": "cemkaraoguz/reinforcement-learning-an-introduction-second-edition", "max_stars_repo_head_hexsha": "735bfa6b66ffb52b7cf0396616...
'''IO functions for various formats used: trace, sinex etc ''' import glob as _glob import re as _re import zlib from io import BytesIO as _BytesIO import logging import numpy as _np import pandas as _pd from p_tqdm import p_map as _p_map from p_tqdm.p_tqdm import tqdm as _tqdm from ..gn_const import PT_CATEGORY, TY...
{"hexsha": "7df67fafb03f2398938ce729a863154edb893aa5", "size": 17221, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/gn_lib/gn_io/sinex.py", "max_stars_repo_name": "umma-zannat/ginan", "max_stars_repo_head_hexsha": "a4d1a3bb8696267f23d26e8c6a2f6080b87bb494", "max_stars_repo_licenses": ["Apache-2.0"], "m...
[STATEMENT] lemma proots_within_iff[simp]: "x\<in>proots_within p s \<longleftrightarrow> poly p x=0 \<and> x\<in>s" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (x \<in> proots_within p s) = (poly p x = (0::'a) \<and> x \<in> s) [PROOF STEP] unfolding proots_within_def [PROOF STATE] proof (prove) goal (1 subgoa...
{"llama_tokens": 204, "file": "Budan_Fourier_BF_Misc", "length": 2}
import os import torch import random from data_utils.utils import numpy_seed from torch.utils import data import numpy as np from data_utils import indexed_dataset class CLMTaskDataset(data.Dataset): def __init__(self, path, tokenizer, batch_size, max_tokens, world_size=1, max_lens=510, seed=512, no_cache=Fals...
{"hexsha": "b5244d5403fe13778966721fd1f0c7456168afe3", "size": 6142, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_utils/test_gpt_datasets.py", "max_stars_repo_name": "initc/gpt-lm", "max_stars_repo_head_hexsha": "941f2816d7a749ea3a3e0c574b35fc3fc67e94e3", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
# -*- coding: utf-8 -*- """ Created on Thu May 14 06:55:06 2020 @author: lcovarrubias, eledgarmurillo """ # TEST Variance import pylab as pylab import numpy as numpy import minoritymodel as minmod fig = pylab.figure(1,figsize=(6,4)) for n in range(5): sim = minmod.System(T=1000,N=101, m=3,s=2) sim.run() ...
{"hexsha": "0e466f172d3dd85bedd62b4728a8329e2117b352", "size": 1773, "ext": "py", "lang": "Python", "max_stars_repo_path": "test_variance_vs_m.py", "max_stars_repo_name": "LeoCovarrubias/MinorityGame", "max_stars_repo_head_hexsha": "c923db08649804b94c1aae68f822f3b1d770e41a", "max_stars_repo_licenses": ["MIT"], "max_sta...
from __future__ import division, print_function import os import numpy as np import yaml from visual_dynamics import envs from visual_dynamics import policies from visual_dynamics.utils.config import ConfigObject from visual_dynamics.utils.rl_util import do_rollouts, discount_returns class Algorithm(ConfigObject):...
{"hexsha": "2d2367e87bc938d85374d4cf539eee31f69aea99", "size": 6445, "ext": "py", "lang": "Python", "max_stars_repo_path": "visual_dynamics/algorithms/base.py", "max_stars_repo_name": "alexlee-gk/visual_dynamics", "max_stars_repo_head_hexsha": "90227bb0d0aebb1989117b5c25ca311655ca7cc7", "max_stars_repo_licenses": ["MIT...
import re import math import bisect import warnings import time from datetime import datetime, timedelta from inspect import signature, getsourcelines from collections import namedtuple import numpy as np from scipy import integrate from scipy import linalg import matplotlib.pyplot as plt from mpl_toolkit...
{"hexsha": "1f4ea8a97319a38ca4c99298e2caec53769108f4", "size": 4816, "ext": "py", "lang": "Python", "max_stars_repo_path": "Test2.py", "max_stars_repo_name": "fakeAEmajorRosen/RocketPy_Rosen", "max_stars_repo_head_hexsha": "27211e7952891bdffa71a4ecca29070d98056794", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
# ------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # ----------------------------------------------------------------------...
{"hexsha": "f141bfd235754189a3823a985d387b3a8c16c5d6", "size": 7781, "ext": "py", "lang": "Python", "max_stars_repo_path": "PyStationB/libraries/GlobalPenalisation/gp/base/sequential.py", "max_stars_repo_name": "BrunoKM/station-b-libraries", "max_stars_repo_head_hexsha": "ea3591837e4a33f0bef789d905467754c27913b3", "max...
Require Import Coq.ZArith.ZArith. Require Import Coq.Lists.List. Require Import Coq.Strings.String. Require Import Crypto.Bedrock.Field.Common.Types. Require Import Crypto.Bedrock.Field.Translation.Expr. Require Import Crypto.Language.API. Require Import Crypto.Util.Option. Require Import Crypto.Util.Notations. Import ...
{"author": "dip-proto", "repo": "fiat-crypto", "sha": "fc3a9280c51f413943c167cc9292e953b8e42c02", "save_path": "github-repos/coq/dip-proto-fiat-crypto", "path": "github-repos/coq/dip-proto-fiat-crypto/fiat-crypto-fc3a9280c51f413943c167cc9292e953b8e42c02/src/Bedrock/Field/Translation/Cmd.v"}
import numpy as np #----------------------------------------- # VMF model class Metrics(object): def __init__(self): pass from collections import Counter class Multinomial(object): def __init__(self, train, n_states=21): self.vmf = [dict(Counter(row)) for row in train.T] self.n_state...
{"hexsha": "7c546fb481deb391a278fe9f8cced7ccba2fefe7", "size": 2801, "ext": "py", "lang": "Python", "max_stars_repo_path": "multinom/mult.py", "max_stars_repo_name": "smoitra87/deepnet", "max_stars_repo_head_hexsha": "c4f89c65f78298d846bd6dc0654b9c8f5e223f2b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_cou...
# Autogenerated wrapper script for LAME_jll for powerpc64le-linux-gnu export lame, libmp3lame JLLWrappers.@generate_wrapper_header("LAME") JLLWrappers.@declare_executable_product(lame) JLLWrappers.@declare_library_product(libmp3lame, "libmp3lame.so.0") function __init__() JLLWrappers.@generate_init_header() JL...
{"hexsha": "1fa8123e8db8f2d39066b9234e787f7ca41dd4ab", "size": 585, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wrappers/powerpc64le-linux-gnu.jl", "max_stars_repo_name": "JuliaBinaryWrappers/LAME_jll.jl", "max_stars_repo_head_hexsha": "188394f057ccb647fde57abd4eba52f9fba7faf2", "max_stars_repo_licenses":...
#!/usr/bin/python3 # -*- coding: UTF-8 -*- __author__ = 'zd' import numpy as np import jieba from jieba import analyse import joblib import global_parameters as config from data_loader import get_sentences import data_utils def sentence_vector(sentence, stop_words, model): """ 生成句向量方法 根据词向量模型 和 给定句子 生成句...
{"hexsha": "dc1be3b82bc7b48e1e41e1edc8d94efaa5e61288", "size": 3918, "ext": "py", "lang": "Python", "max_stars_repo_path": "\u6587\u672c\u6458\u8981/text_rank/model_utils.py", "max_stars_repo_name": "zhangdddong/beautifulNLP", "max_stars_repo_head_hexsha": "295987cc03c9afb52008917d9d141fdb2eb66ba5", "max_stars_repo_lic...
"""ODE solver by Euler method""" from numbers import Real """ # notes $$a_1 \equiv 1 - h_i^{guess}\partial_{x}F|_{\left(t_{i},x_{i}\right)}$$ $$a_2 \equiv 1 - h_i^{guess}\partial_{x}F|_{\left(t_{i}+h_{i}^{guess},x_{i}\right)}$$ $a_1$ and $a_2$ should be positive. """ def get_stepsize(ti, xi, Fx, dxFx, hi_max...
{"hexsha": "937625f35a9986b8a258a98ff7cd791c35b757e9", "size": 7113, "ext": "py", "lang": "Python", "max_stars_repo_path": "bohm/ode/euler.py", "max_stars_repo_name": "jam31118/bohm", "max_stars_repo_head_hexsha": "f842aa716f48240ceafacc6f815ae0687a965f5d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
import os import sys import cv2 import numpy as np from copy import deepcopy from scipy.spatial.transform import Rotation as rot import torch, torchvision from time import time import math import h5py import json import random import argparse from const import KPTS_15, SMPL_KPTS_15 from data_utils import sample_projec...
{"hexsha": "ef8b70f419321ba24f9ab7e0b7009b36c73c9673", "size": 20881, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/prepare_datasets.py", "max_stars_repo_name": "kristijanbartol/gender-classifier", "max_stars_repo_head_hexsha": "6eccd89722989e0d1f3c6a2fbf59a4e3f40349c7", "max_stars_repo_licenses": ["MIT"],...
import pandas import matplotlib.pyplot as plt import numpy import sympy # plt.style.use("grayscale") plt.rcParams.update({'font.size': 16}) def calculate_reciprocals(n): return [1/i for i in range(1, n + 1)] def calculate_harmonic_series(n): series = [1] for i in range(1, n): series.append(series[i - 1] + 1 / (...
{"hexsha": "c08fee31d48b70ae3fd571de074a039a3a90c84a", "size": 2650, "ext": "py", "lang": "Python", "max_stars_repo_path": "harmonic_numbers.py", "max_stars_repo_name": "bernatfogarasi/coupon-collector", "max_stars_repo_head_hexsha": "91fd9bce0b2a98d8f6fa58cf9fc774513d43123e", "max_stars_repo_licenses": ["MIT"], "max_s...
(* Author: Mohammad Abdulaziz, Fred Kurz *) theory STRIPS_Representation imports State_Variable_Representation begin section "STRIPS Representation" (*<*) type_synonym ('variable) strips_state = "('variable, bool) state" (*>*) text \<open> We start by declaring a \isakeyword{record} for STRIPS operators. This wh...
{"author": "zabihullah331", "repo": "barakzai", "sha": "793257c1d71ec75a299fc6b5843af756ead2afb0", "save_path": "github-repos/isabelle/zabihullah331-barakzai", "path": "github-repos/isabelle/zabihullah331-barakzai/barakzai-793257c1d71ec75a299fc6b5843af756ead2afb0/thys/Verified_SAT_Based_AI_Planning/STRIPS_Representatio...
#!/home/zhuqingjie/env/py3_tf_low/bin/python ''' @Time : 07.08 0008 下午 07:25 @Author : zhuqingjie @User : zhu @FileName: modelbuilder.py @Software: PyCharm ''' import json import numpy as np import os import tensorflow as tf import time from train import G os.environ['CUDA_VISIBLE_DEVICES'] = '' # param model...
{"hexsha": "0bcbd5ab779e6b1e70021986dfceea6721ad1fda", "size": 1900, "ext": "py", "lang": "Python", "max_stars_repo_path": "modelbuilder.py", "max_stars_repo_name": "azzhu/deeps", "max_stars_repo_head_hexsha": "dda178497be3d62067a2f2a7a0a5aa1d793a89bc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_sta...
import numpy as np class ParticulatesEmissionsModel: """ Calculate particulates emissions based on the method described in: https://www.eea.europa.eu/ds_resolveuid/6USNA27I4D and further disaggregated in: https://doi.org/10.1016/j.atmosenv.2020.117886 Include emission from: - brake wear...
{"hexsha": "a789f1e8edf56c257b306cd226ad2e9da5958239", "size": 6621, "ext": "py", "lang": "Python", "max_stars_repo_path": "carculator/particulates_emissions.py", "max_stars_repo_name": "vishalbelsare/carculator", "max_stars_repo_head_hexsha": "44516a5f3e7f7f42f0d0d7a5c2bd5af3d17d0fd4", "max_stars_repo_licenses": ["BSD...
using Pkg.Artifacts using Pkg.BinaryPlatforms using URIs function tectonic() pkgname = "tectonic" origin = "https://github.com/tectonic-typesetting/tectonic/releases/download" version = v"0.8.0" build = 1 downloads = Dict( "$origin/tectonic%40$version/tectonic-$version-x86_64-unknown-linux...
{"hexsha": "6d16cbfed156be167499b11f7da460d181258341", "size": 4269, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "build.jl", "max_stars_repo_name": "MichaelHatherly/Tectonic.jl", "max_stars_repo_head_hexsha": "2e242fcbe63ab9631ed5fc8a8c374d9f5338512f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 19,...
from __future__ import print_function, absolute_import from numba import unittest_support as unittest from numba.ocl.ocldrv.driver import driver as cl from numba.ocl.ocldrv.devices import _runtime as rt from numba.ocl.ocldrv import spirv from numba.ocl.ocldrv import spir2 sample_spir = """ ; ModuleID = 'kernel.out.bc...
{"hexsha": "464cb13554ef69aa3956873449a2dc4614e35458", "size": 2305, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba/ocl/tests/ocldrv/test_spir_loading.py", "max_stars_repo_name": "SPIRV/NUMBA", "max_stars_repo_head_hexsha": "6b93f44c923e7bf8cd9f95cc5188bba3aea4e75d", "max_stars_repo_licenses": ["BSD-2-Cla...
from typing import List, Optional, Union import numpy as np import sympy from openfermion import IsingOperator, QubitOperator from openfermion.utils import count_qubits from overrides import overrides from zquantum.core.circuits import Circuit, H, create_layer_of_gates from zquantum.core.circuits.symbolic import natur...
{"hexsha": "3e2863fec9afe2274174878f30fb753895cf50c2", "size": 5263, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python/zquantum/qaoa/ansatzes/farhi_ansatz.py", "max_stars_repo_name": "zapatacomputing/z-quantum-qaoa", "max_stars_repo_head_hexsha": "a13a99939ee41c760fdfb302e5f4944e087a09a7", "max_stars_re...
''' This program reads a FAMUS file, (should run shift-idx.py first) and a list of changes (u,v,w,m). It finds the (u,v) tower and changes the w-th slice to value m where (u,v) are indices as defined by mag-map.py contours and w indexes slices from [1,N]. The m value sets pho, a scalar between...
{"hexsha": "07e42c0467be5d0825cd148a666c63703315851d", "size": 2261, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/3d-zot/3d-zot.py", "max_stars_repo_name": "tmqian/MUSE", "max_stars_repo_head_hexsha": "164e3ad8c7345f55ef4c8f0584155a2d3d7fbe2f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,...
from .function import ( abs, max, min, log, exp, relu, sigmoid, softmax, tanh, ) from .random import ( normal, normal_like, uniform, uniform_like, ) from .tensor import ( Tensor, tensor, as_tensor, stack, zeros, zeros_like, ones, ones_like, add, sub, neg, mul, truediv, matmul, power, dot, ...
{"hexsha": "de51b289e7b627a9690d5febc1d1dfbf0cd4364c", "size": 502, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dpln/autograd/__init__.py", "max_stars_repo_name": "shizuku/dpln", "max_stars_repo_head_hexsha": "d6f62e97073313a92ba492bbf1b9cd57842a8369", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
export SU2 """ Represents SU(2). fields: u and v. """ struct SU2 a::Real v::Complex end
{"hexsha": "8ddda0b4132ede6b0c3460f48243e03bac7ef1ae", "size": 103, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/symmetrygroups_tests/su3_tests.jl", "max_stars_repo_name": "SimonDanisch/Porta.jl", "max_stars_repo_head_hexsha": "70a5b6586b74f5d76d3add8c9f305071dea13b6c", "max_stars_repo_licenses": ["MIT"],...
from cnn import Env import torch import numpy as np import matplotlib.pyplot as plt def train_model(model, criterion, optimizer, train_loader, valid_loader, model_name='model.pt'): valid_loss_min = np.inf for epoch in range(1, Env.epochs + 1): train_loss = 0.0 valid_loss = 0.0 ########...
{"hexsha": "81ede7466a3958ad5a25dc1fbafee1b59849c8c0", "size": 4380, "ext": "py", "lang": "Python", "max_stars_repo_path": "helper.py", "max_stars_repo_name": "omtripathi786/MLP", "max_stars_repo_head_hexsha": "37c766590524b274c30057bc94c28e0c41ba1e14", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "max_sta...
#!/usr/bin/env python """ACTIVE LEARNING This is an open source example to accompany Chapters 3 and 4 from the book: "Human-in-the-Loop Machine Learning" This example tries to classify news headlines into one of two categories: disaster-related not disaster-related """ import torch import torch.nn as nn impor...
{"hexsha": "89775ffce2b9b85283daec42d7b8e22a6d961833", "size": 28320, "ext": "py", "lang": "Python", "max_stars_repo_path": "active_learning.py", "max_stars_repo_name": "sthagen/pytorch_active_learning", "max_stars_repo_head_hexsha": "4d97ad42d95f73f564d05357389b97b45d4972a2", "max_stars_repo_licenses": ["MIT"], "max_s...
from fem import DofHandler, Basis, QuadFE from gmrf import GaussianField, Covariance from assembler import Form, Assembler from mesh import Mesh1D, QuadMesh from plot import Plot from function import Nodal import numpy as np from scipy import sparse as sp import matplotlib.pyplot as plt """ Goal: Investigate opt...
{"hexsha": "7b11fadd70f36e6c34db6989a9ecbfa73999ff98", "size": 13614, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/multiscale_gmrf/ex04/ex04.py", "max_stars_repo_name": "hvanwyk/drifter", "max_stars_repo_head_hexsha": "a08df0cef81bc6ca76084ae8cac089644e2bd56b", "max_stars_repo_licenses": ["MIT"], ...
import tensorflow as tf config = tf.ConfigProto() config.gpu_options.allow_growth = True import numpy as np import scipy import os import scipy.io import sys try: import cPickle except: import _pickle as cPickle # Syspath for the folder with the utils files #sys.path.insert(0, "/media/data/srebuffi") import ut...
{"hexsha": "b53a4241ccb4f57c1cca4481d5a8cf7777d9756f", "size": 12339, "ext": "py", "lang": "Python", "max_stars_repo_path": "iCaRL-Tensorflow/main_resnet_tf.py", "max_stars_repo_name": "augustoolucas/iCaRL", "max_stars_repo_head_hexsha": "dcad835c10f726e68cf83298fd96a32fe2949a5d", "max_stars_repo_licenses": ["MIT"], "m...