text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
import pickle import numpy as np from PIL import Image import torch.utils.data from torchvision import transforms transform_train = transforms.Compose([ transforms.RandomCrop(32, padding=4), transforms.RandomHorizontalFlip(), transforms.ToTensor(), transforms.Normalize((0.4914, 0.4822, 0.4465), (0.202...
{"hexsha": "3014339a5a38db737e56cb3c14ed8ff5af6ab13a", "size": 3136, "ext": "py", "lang": "Python", "max_stars_repo_path": "classification/generate_dataset.py", "max_stars_repo_name": "Chen-Junbao/NeuralNetwork", "max_stars_repo_head_hexsha": "7d8f764e6d3e8364f5a2e87aa4651ab577553d5d", "max_stars_repo_licenses": ["MIT"...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import random eps = 1e-7 # CE and LDAM are supported # If you would like to add other losses, please have a look at: # Focal Loss: https://github.com/kaidic/LDAM-DRW # CRD, PKT, and SP Related Part: https://github.com/HobbitLong/R...
{"hexsha": "62543538e2b26018f7cbc8cd1b6a346e66016f54", "size": 27953, "ext": "py", "lang": "Python", "max_stars_repo_path": "model/loss.py", "max_stars_repo_name": "mitming/OpenLT", "max_stars_repo_head_hexsha": "33fa2a91fd04ecd2c2bcc399c985ed276a42a22e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 37, "max_...
# -*- coding: utf-8 -*- import numpy as np def _plot_dep(plt, func): _max = 1.8 dom = np.linspace(0, _max, 200) linear = dom.copy() ours = func(dom) plt.plot(dom, linear, "--", label="no distortion") plt.plot(dom, ours, "-", label="distortion") plt.set_xlim(0, _max) plt.set_ylim(0, _ma...
{"hexsha": "a5e86f0d51e6df7332206f432ec71dd9ea775a72", "size": 425, "ext": "py", "lang": "Python", "max_stars_repo_path": "doc/scripts/common.py", "max_stars_repo_name": "matejak/antibarrel", "max_stars_repo_head_hexsha": "d3c16c6f84388af0d2f9e74cecb644e6e23b2a9b", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star...
using Pkg if isfile("Project.toml") Pkg.activate(".") end
{"hexsha": "768c0a275dfbcaca373a3f6f31368b67e630b927", "size": 61, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "julia_config/startup.jl", "max_stars_repo_name": "RodrigoZepeda/docker-julia", "max_stars_repo_head_hexsha": "c77a9be4405778fe82a2f729ca1f994674a91275", "max_stars_repo_licenses": ["MIT"], "max_stars...
# Code for "TDN: Temporal Difference Networks for Efficient Action Recognition" # arXiv: 2012.10071 # Limin Wang, Zhan Tong, Bin Ji, Gangshan Wu # tongzhan@smail.nju.edu.cn import argparse import time import os import torch.nn.parallel import torch.optim from sklearn.metrics import confusion_matrix from ops.dataset im...
{"hexsha": "40ba451ddb26af2b805906dd60c5063d8d9624f6", "size": 4412, "ext": "py", "lang": "Python", "max_stars_repo_path": "pkl_to_results.py", "max_stars_repo_name": "hardik01shah/TDN", "max_stars_repo_head_hexsha": "fcae164736271943528876e5f81fd79e38d884b9", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count...
import numpy as np import matplotlib.pyplot as plt from PIL import Image im = Image.open('dataset/jaffe/KA.AN2.40.tiff') (w, h) = im.size bags = [] pos_patch = lambda n: [ (0, 0, n//2, n//2), (n//2, 0, n, n//2), (0, n//2, n//2, n), (n//2, n//2, n, n) ] sub_image = lambda image, dim: [image.crop(patch) for ...
{"hexsha": "70da953a7ba3e466240ddbf66ef2f90015407142", "size": 1119, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "adadesions/AdaDynamics", "max_stars_repo_head_hexsha": "5251a739fdf457f7371ae8818d90d310c3094fb9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m...
import numpy as np from pathlib import Path import torch import torch.nn as nn import torch.nn.functional as F from tensorboardX import SummaryWriter from envs import MGEnv, CleanupEnv, HarvestEnv, GridWorldEnv,GridWorldAdaptiveEnv, MGSingleEnv, MGAdaptiveEnv from algorithm.ppo import PPO from algorithm.mod...
{"hexsha": "9e6a1c0b2fbbfa926d0522f401035d5442f53964", "size": 9958, "ext": "py", "lang": "Python", "max_stars_repo_path": "GridWorld/scripts/eval/eval.py", "max_stars_repo_name": "staghuntrpg/rpg", "max_stars_repo_head_hexsha": "78901f0cb2505b08d7d09603d46515ef292a0784", "max_stars_repo_licenses": ["MIT"], "max_stars_...
""" Copyright (C) 2020 Shandong University This program is licensed under the GNU General Public License 3.0 (https://www.gnu.org/licenses/gpl-3.0.html). Any derivative work obtained under this license must be licensed under the GNU General Public License as published by the Free Software F...
{"hexsha": "40f24078683863615afbd62c36c5a754f5a22db2", "size": 2047, "ext": "py", "lang": "Python", "max_stars_repo_path": "torchhelper/tune/rampup.py", "max_stars_repo_name": "sailist/TorchHelper", "max_stars_repo_head_hexsha": "7a0b18e9a60f24e71d69290cb5712973af7fcc23", "max_stars_repo_licenses": ["Apache-2.0"], "max...
""" The classes contained in this module are supposed to be agnostic to recording format and encapsulate some generic mechanisms for producing things like spike timing autocorrelograms, power spectrum calculation and so on """ import numpy as np from scipy import signal, spatial, misc, ndimage, stats, io from scipy.si...
{"hexsha": "7f7319ee1d227f3142df1b53d9222ba762fe46c0", "size": 77192, "ext": "py", "lang": "Python", "max_stars_repo_path": "ephysiopy/common/ephys_generic.py", "max_stars_repo_name": "hwpdalgleish/ephysiopy", "max_stars_repo_head_hexsha": "6dd8ea9fa253e2711d29cf0c50bcded352115897", "max_stars_repo_licenses": ["MIT"], ...
\subsection{Saving the Measurement Results Automatically} When you have a time series sequence and you want to measure multiple signals with multiple parameters in each frame, measurement results in each frame needs to be somehow saved. Here, we learn how to export measurement results in your hard disk automatically...
{"hexsha": "d98826bde0e81a56e0477687ef5bac527156ad54", "size": 5972, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "assets/experimentalTools/ImageJ/reference/cmci-ij_textbook2-d852848/sections/io/macroIO_resultsSaving.tex", "max_stars_repo_name": "mistltoe/mistltoe.github.io", "max_stars_repo_head_hexsha": "2e465...
import cv2 from more_itertools import unique_everseen import numpy as np ##### Right ########### # 큰 리벳 검출할 영역(관심영역)을 지정 (start point to end point of Rectangle Box). ROI_list = [ [(5, 90), (500, 950)], ] # 작은 리벳 검출할 영역(관심영역)을 지정 (start point to end point of Rectangle Box). ROI_list_small = [ [(550, 90), (72...
{"hexsha": "0e858def968e8ffd86c5d7be722e196adffbdcfa", "size": 7446, "ext": "py", "lang": "Python", "max_stars_repo_path": "AceVision/old/AceVision_GUI_EXE_conversion/version_0.1_Gige_cam_190326/build_exe/test/circle_find.py", "max_stars_repo_name": "lyj911111/OpenCV_Project", "max_stars_repo_head_hexsha": "9acbfbf6661...
from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np import autograd.numpy.random as npr from autograd import grad from autograd.util import quick_grad_check from six.moves import range from six.moves import zip from neural_net_utilities import WeightsParser, make_...
{"hexsha": "59c1dd275b76064662b5d86a17bf7f21b71fc73b", "size": 8445, "ext": "py", "lang": "Python", "max_stars_repo_path": "chord2vec/CBOW.py", "max_stars_repo_name": "czhuang/ChordRipple", "max_stars_repo_head_hexsha": "1d7f1f05cc895983101865665d5df18aeff99d7f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2...
import numpy as np import matplotlib.pyplot as plt ''' Here defines a class that implements a simple discrete distribution that is used to keep track of the confidence distribution of the interested parameter. ''' class Simple_Dist: # param = [(x,density)] # constructed left-to-right on [init[0][0],end...
{"hexsha": "bb0d99577a682fdd5465e58837880e56d59e24b9", "size": 5647, "ext": "py", "lang": "Python", "max_stars_repo_path": "PTA algorithm/simpleDist.py", "max_stars_repo_name": "zrobertson466920/Probabilistic_Metric_Elicitation", "max_stars_repo_head_hexsha": "281a0ac85c8f0f637355f1ee5426e81b2f222fa5", "max_stars_repo_...
import Basic import Tangle open Brick structure Graph (α : Type) where V: List α E: List (α × α) deriving Repr namespace Graph def from_edges {α : Type} [BEq α] (e : List (α × α)) : Graph α := Graph.mk (e.foldr (fun n ns => match (ns.elem n.fst, ns.elem n.snd) with | (true, true) => ns ...
{"author": "shua", "repo": "leanknot", "sha": "5c50fc107c1e98978d2cd966d4c6b22348e1ee4a", "save_path": "github-repos/lean/shua-leanknot", "path": "github-repos/lean/shua-leanknot/leanknot-5c50fc107c1e98978d2cd966d4c6b22348e1ee4a/Graph.lean"}
using KernelAbstractions using KernelAbstractions.Extras using CUDA using CUDAKernels using Random123 using WormlikeChain using BenchmarkTools using FastClosures #BAOAB integration @kernel function simulate!(positions, velocities, externalforce!, ...
{"hexsha": "2c131e64fd75e7ec8f02e95881406cad1d4fd0f6", "size": 4294, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "simkernelproto.jl", "max_stars_repo_name": "nhz2/WormlikeChain.jl", "max_stars_repo_head_hexsha": "108c71d29c7015deaa586fe32443e0efd00e5ab1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
export marginalrule @marginalrule typeof(*)(:A_in) (m_out::NormalDistributionsFamily, m_A::PointMass, m_in::F) where { F <: NormalDistributionsFamily } = begin A = mean(m_A) W = A' * precision(m_out) * A b_in = convert(promote_variate_type(F, NormalWeightedMeanPrecision), A' * weightedmean(m_out), W) ...
{"hexsha": "47c9bcebabccc7acce84bc7a6ee1dac763930708", "size": 400, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/rules/multiplication/marginals.jl", "max_stars_repo_name": "albertpod/ReactiveMP.jl", "max_stars_repo_head_hexsha": "71c390e6b41e6890ba808640d0bf3ef2f66efc71", "max_stars_repo_licenses": ["MIT"]...
import skvideo.io import sys import numpy as np import hashlib import os from numpy.testing import assert_equal def hashfile(afile, hasher, blocksize=65536): buf = afile.read(blocksize) while len(buf) > 0: hasher.update(buf) buf = afile.read(blocksize) return hasher.hexdigest() def _vwrite...
{"hexsha": "18287585f7c0eca771dfda004fe3271f8bbaa1e8", "size": 1261, "ext": "py", "lang": "Python", "max_stars_repo_path": "venv/lib/python3.6/site-packages/skvideo/tests/test_vwrite.py", "max_stars_repo_name": "mesquitadev/grpc", "max_stars_repo_head_hexsha": "747660f2ed4e62e30999741f4359793192158cad", "max_stars_repo...
# ============================================================================================== # beg: basic imports and setup # ============================================================================================== from datetime import datetime from loguru import logger import joblib import numpy as np impor...
{"hexsha": "b8a0686ac5dcb30bb13bdcb8a2f5614d16ae7dd4", "size": 7350, "ext": "py", "lang": "Python", "max_stars_repo_path": "main.py", "max_stars_repo_name": "rakesh4real/stock-prediction", "max_stars_repo_head_hexsha": "ac363cd3dee3bf37aade4edbc9514ab54c9107cb", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1,...
""" .. _l-b-reducesumsquare: Compares implementations of ReduceSumSquare =========================================== This example compares the *numpy* for the operator *ReduceSumSquare* to :epkg:`onnxruntime` implementation. If available, :epkg:`tensorflow` and :epkg:`pytorch` are included as well. .. contents:: ...
{"hexsha": "132ce39687d67b406da9092611bcd5bbfe58fde7", "size": 7662, "ext": "py", "lang": "Python", "max_stars_repo_path": "_doc/examples/plot_op_reducesumsquare.py", "max_stars_repo_name": "henrywu2019/mlprodict", "max_stars_repo_head_hexsha": "4c09dc39d5ba7a7235fa321d80c81b5bf4f078ad", "max_stars_repo_licenses": ["MI...
import random from dataclasses import dataclass import numpy as np from dynaparse.parameters.base_parameter import BaseParameter str_with_none = lambda x: None if x == "None" else str(x) @dataclass class StringParameter(BaseParameter): default: str = None parameter_type: str = "str" def get_typefunc(s...
{"hexsha": "db440c9367e68bc5d3d5717c589e520a2e7da5a3", "size": 622, "ext": "py", "lang": "Python", "max_stars_repo_path": "dynaparse/parameters/string_parameter.py", "max_stars_repo_name": "kungfuai/dynaparse", "max_stars_repo_head_hexsha": "6c4001718b80deaf9552ffa95b69f961fee6ff89", "max_stars_repo_licenses": ["MIT"],...
/- Copyright (c) 2020 Yury G. Kudryashov. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov ! This file was ported from Lean 3 source module linear_algebra.affine_space.slope ! leanprover-community/mathlib commit 70fd9563a21e7b963887c9360bd29b2393e6225...
{"author": "leanprover-community", "repo": "mathlib4", "sha": "b9a0a30342ca06e9817e22dbe46e75fc7f435500", "save_path": "github-repos/lean/leanprover-community-mathlib4", "path": "github-repos/lean/leanprover-community-mathlib4/mathlib4-b9a0a30342ca06e9817e22dbe46e75fc7f435500/Mathlib/LinearAlgebra/AffineSpace/Slope.lea...
import time import numpy as np import sklearn.model_selection import torch from corai.src.classes.estimator.history.estim_history import Estim_history from corai.src.classes.training_stopper.early_stopper_vanilla import Early_stopper_vanilla from corai.src.train.history import translate_history_to_dataframe from cora...
{"hexsha": "2f74da7c4885bf9f09896e8f358455de46a96f43", "size": 13743, "ext": "py", "lang": "Python", "max_stars_repo_path": "corai/src/train/kfold_training.py", "max_stars_repo_name": "Code-Cornelius/python_libraries", "max_stars_repo_head_hexsha": "71c388da60e2aeb94369c3813faca93bf6a18ebf", "max_stars_repo_licenses": ...
module Import_Test using FactCheck, JNeuron facts() do myimport=input(string(dirname(Base.source_path()),"/../examples/data/cell2.asc")); @fact length(myimport.sections) --> 198 blank_neuron=instantiate(myimport); @fact length(blank_neuron.secs) --> 198 blank_neuron2=instantiate(string(dirname...
{"hexsha": "89195f22190bb0b061b938a7fe75827f50d66c56", "size": 657, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/import_test.jl", "max_stars_repo_name": "paulmthompson/JNeuron", "max_stars_repo_head_hexsha": "d6a389506e27df1955ac59eb08376795d20bb1b6", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_star...
""" The aim of this file is to give a standalone example of how an environment runs. """ import os import numpy as np from tgym.core import DataGenerator from tgym.envs.trading_tick import TickTrading from tgym.gens.deterministic import WavySignal, RandomGenerator from tgym.gens.csvstream import CSVStreamer gen_type ...
{"hexsha": "80f65f9822f34ecd1afa47685374539ee8afe90b", "size": 1730, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/trading_tick_env.py", "max_stars_repo_name": "ma-da/CryptoTGYM", "max_stars_repo_head_hexsha": "90218a2296030ef3f8e4925ce79a5264c2aecfb8", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
[STATEMENT] lemma hcomplex_mult_minus_one: "- 1 * z = - z" for z :: hcomplex [PROOF STATE] proof (prove) goal (1 subgoal): 1. - 1 * z = - z [PROOF STEP] by simp
{"llama_tokens": 74, "file": null, "length": 1}
// 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 the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, ...
{"hexsha": "10e8a8f56ae6fdcb0820569ade4b91838d21fe6d", "size": 101782, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tyrant_optimize.cpp", "max_stars_repo_name": "APN-Pucky/TestGit", "max_stars_repo_head_hexsha": "7de432b1ba3511d866239a4a0519c4d65c8066d8", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
import subprocess from setuptools import setup, Extension try: pandoc = subprocess.Popen(['pandoc', 'README.md', '--to', 'rst'], stdout=subprocess.PIPE) readme = pandoc.communicate()[0].decode() except OSError: with open('README.md') as f: readme = f.read() cmdclass...
{"hexsha": "63941acd5ea7c627eccf6daf6a03aa134aea7caf", "size": 1269, "ext": "py", "lang": "Python", "max_stars_repo_path": "setup.py", "max_stars_repo_name": "aaren/pharminv", "max_stars_repo_head_hexsha": "b3d3d11c81bafa40a72583aa98f51b05acec9835", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 12, "m...
import torch import numpy as np import configs.asrf_config as asrf_cfg import sys sys.path.append('./backbones/asrf') from libs.postprocess import PostProcessor def predict_refiner(model, main_backbone_name, backbones, split_dict, model_dir, result_dir, features_path, vid_list_file, epoch, actions_dict, devic...
{"hexsha": "86610a08d6cbc61b06959c77176b89007f807713", "size": 12544, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/predict.py", "max_stars_repo_name": "cotton-ahn/hasr_iccv2021", "max_stars_repo_head_hexsha": "c8994eb8db1fae78a41023414505297f49950646", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
""" A collection of metrics to evalaute agents with. """ import warnings import numpy as np from featureExtractor.drone_feature_extractor import dist_2d, angle_between def compute_trajectory_smoothness(trajectory): """ Returns the total and per step change in the orientation (in degrees) of the agent duri...
{"hexsha": "2af27d97bb1285b5d0be0e05fbb2402ce4248fdf", "size": 11400, "ext": "py", "lang": "Python", "max_stars_repo_path": "metrics/metrics.py", "max_stars_repo_name": "ranok92/deepirl", "max_stars_repo_head_hexsha": "88c7e76986243cf0b988d8d7dc0eef6b58e07864", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, ...
#!/usr/bin/env python3 # # # #====================================== import os import argparse import json import pdb import pickle import datetime import pandas as pd import numpy as np import matplotlib matplotlib.use("tkAgg") import matplotlib.pyplot as plt from matplotlib.colors import ListedColormap import seabor...
{"hexsha": "767da1a259a7900420199fbc21dc21db7460e55d", "size": 21151, "ext": "py", "lang": "Python", "max_stars_repo_path": "sleep_scorer/plt-trainmodels.py", "max_stars_repo_name": "focolab/sleep-classifier", "max_stars_repo_head_hexsha": "6a7eb376267c66d697782d49785ade6948a17a85", "max_stars_repo_licenses": ["MIT"], ...
[STATEMENT] lemma length_ge_Suc_imp_not_empty:"Suc n \<le> length xs \<Longrightarrow> xs \<noteq> []" [PROOF STATE] proof (prove) goal (1 subgoal): 1. Suc n \<le> length xs \<Longrightarrow> xs \<noteq> [] [PROOF STEP] by fastforce
{"llama_tokens": 90, "file": "List-Infinite_ListInf_List2", "length": 1}
PROGRAM F006 ! Copyright 2021 Melwyn Francis Carlo IMPLICIT NONE INTEGER :: N, N_SUM, SQUARE_OF_SUM, SUM_OF_SQUARE N = 100 N_SUM = (N * (N + 1)) / 2 SQUARE_OF_SUM = N_SUM * N_SUM; SUM_OF_SQUARE = (N * (N + 1) * ((2 * N) + 1)) / 6; PRINT ('(I0)'), SQUARE_OF_SUM - SUM_OF_SQUARE END P...
{"hexsha": "9057bade6bbda757765d56d7aea53cd5c7dc7a80", "size": 332, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "problems/006/006.f90", "max_stars_repo_name": "melwyncarlo/ProjectEuler", "max_stars_repo_head_hexsha": "c4d30ed528ae6de82232f3d2044d608c6e8f1c37", "max_stars_repo_licenses": ["MIT"], "max_stars_...
# Larger CNN for the MNIST Dataset import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense from tensorflow.keras.layers import Dropout from tensorflow.keras.layers import Flatten from tensorflow.keras.models import Model from tensorflow.keras.layers import Input ...
{"hexsha": "170753e61acda2b72039e367081c86257a9183fb", "size": 10639, "ext": "py", "lang": "Python", "max_stars_repo_path": "IRNET48_NEW.py", "max_stars_repo_name": "GuptaVishu2002/IRNET", "max_stars_repo_head_hexsha": "a430d17df3ececfe6cfd8ab469fff070e1c262e7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
function loadNeuralNet() path(s) = normpath("$(@__DIR__)/"*s) @load path("../models/agz_128_base.bson") bn @load path("../models/agz_128_value.bson") value @load path("../models/agz_128_policy.bson") policy @load path("../models/weights/agz_128_base.bson") bn_weights @load path("../models/weight...
{"hexsha": "9ff5118cbc452ae9ca534e7d46c08d063c5bf113", "size": 2107, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/helpers.jl", "max_stars_repo_name": "tejank10/AlphaGo.jl", "max_stars_repo_head_hexsha": "8a2651c7f705d7fe6d0818648ce9620fdb2cc704", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
C %W% %G% real function tzlead (t2, t1, dt, x0, x1, y0, ndivs) implicit none real t2, t1, dt, x0, x1, y0 integer ndivs c - solves a first order lead block: c sT2 c ------- c 1 + sT1 c c - Uses sub-time step logic if ndivs > 1 c c - subscript...
{"hexsha": "dd48ef270b4cbd5df00b710394519567fa19444b", "size": 1607, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "libtsp/tzlead.f", "max_stars_repo_name": "mbheinen/bpa-ipf-tsp", "max_stars_repo_head_hexsha": "bf07dd456bb7d40046c37f06bcd36b7207fa6d90", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 14...
import torch import sys import os # sys.path.append(os.path.dirname(os.path.dirname(__file__))) sys.path.insert(0,'..') # inorder to run within the folder import numpy as np import json from CarRacing.network import Actor as Actor from CarRacing.orca_env_function import getNFcollosionreward import car_racing_simulator...
{"hexsha": "9b21881595174e2d6e1689c6646144b42a8c2983", "size": 6408, "ext": "py", "lang": "Python", "max_stars_repo_path": "CarRacing/results.py", "max_stars_repo_name": "manish-pra/trcopo", "max_stars_repo_head_hexsha": "df8730f07ef554970c7a0aa653cc42d4886948ec", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
import torch as tr import sys, time import pickle as pk sys.path.append('../../envs') from blocks_world import BlocksWorldEnv, random_thing_below import block_stacking_problem as bp import neural_virtual_machine as nv from abstract_machine import make_abstract_machine, memorize_problem from nvm import virtualize from r...
{"hexsha": "3205c3705c629dd436b31f1ed91e68f40a1f2f28", "size": 16633, "ext": "py", "lang": "Python", "max_stars_repo_path": "pybullet/tasks/pick_and_place/nvm_rvm_compare.py", "max_stars_repo_name": "garrettkatz/poppy-muffin", "max_stars_repo_head_hexsha": "43ac00e6a151346ca7df005c009fcb762f16bd35", "max_stars_repo_lic...
#!/usr/bin/env sage import os import sys from shutil import rmtree from sage.all import * from sage.graphs.graph_input import from_graph6 if len(sys.argv) < 2: raise ValueError( "Nombre de sommets necessaires a passer en argument 1" ) n = int(sys.argv[1]) file = os.path.join("input", "graph%d.g6" % n...
{"hexsha": "a242dff57b2e8f8f1c35f15c1ab05472eae01e9b", "size": 1390, "ext": "py", "lang": "Python", "max_stars_repo_path": "filter_graphs.py", "max_stars_repo_name": "vbouquet/graph_tools", "max_stars_repo_head_hexsha": "7d25a8eadd5176b6e35abf47e5ec7ea2fde4be97", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n...
#!/usr/bin/env python from ATK.Core import DoubleInPointerFilter, DoubleOutPointerFilter from ATK.Adaptive import DoubleBlockLMSFilter from nose.tools import raises def filter(input, reference): import numpy as np output = np.zeros(input.shape, dtype=np.float64) infilter = DoubleInPointerFilter(input, False) ...
{"hexsha": "1646ad68e50a0fcb2c0a9fe7fa4627db721ef899", "size": 2111, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/Python/Adaptive/PyATKAdaptive_blocklms_test.py", "max_stars_repo_name": "D-J-Roberts/AudioTK", "max_stars_repo_head_hexsha": "accf009d7238f32702eb1d5ee23c5148fc68e3bd", "max_stars_repo_licen...
import cv2 import numpy as np #read the image image=cv2.imread('cameramannoise.jpg') #apply the 3*3 mean filter on the image kernel=np.ones((3, 3), np.float32) / 9 processed_image=cv2.filter2D(image, -1, kernel) #display image cv2.imshow('Mean Filter Processing', processed_image) #save image to disk cv2.imw...
{"hexsha": "f3e62a8f9b279ef6ac1847d8bf49d4fa85df519e", "size": 455, "ext": "py", "lang": "Python", "max_stars_repo_path": "CompVisionMedian filter.py", "max_stars_repo_name": "AneezaNiamat/ComputerVision", "max_stars_repo_head_hexsha": "35a584a4003dc814ca4db7539da757c0cf9d2a2b", "max_stars_repo_licenses": ["MIT"], "max...
function client(master, port, log_dir) jobid = ENV["SLURM_JOB_ID"] nodeid = parse(Int,ENV["SLURM_NODEID"]) localid = parse(Int,ENV["SLURM_LOCALID"]) open("$(log_dir)/client-$(jobid)-$(nodeid)-$(localid).log", "w+") do log_file client_logger = SimpleLogger(log_file, Logging.Debug) @debug...
{"hexsha": "7b4b6c2500b40042bddaae0455073b640862b48f", "size": 1115, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/client.jl", "max_stars_repo_name": "jagot/SlurmSweeps.jl", "max_stars_repo_head_hexsha": "2591ad2a570ad20de5acd2589eafa6aa5020fee9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
module Solvers export PoissonSolver, PoissonBCs, solve_poisson_3d!, BatchedTridiagonalSolver, solve_batched_tridiagonal_system! using Oceananigans.Grids using Oceananigans: @hascuda @hascuda using CUDAnative, CuArrays abstract type PoissonBCs end include("solver_utils.jl") include("poisson_solver_cpu.jl")...
{"hexsha": "bd4c16fdce391d3f0d260227436943a34c9a347c", "size": 400, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Solvers/Solvers.jl", "max_stars_repo_name": "arcavaliere/Oceananigans.jl", "max_stars_repo_head_hexsha": "588890004e69cfc7db10472b12a9840b8a9ad7b6", "max_stars_repo_licenses": ["MIT"], "max_star...
[STATEMENT] lemma isContD: "isCont f x \<Longrightarrow> f \<midarrow>x\<rightarrow> f x" [PROOF STATE] proof (prove) goal (1 subgoal): 1. isCont f x \<Longrightarrow> f \<midarrow>x\<rightarrow> f x [PROOF STEP] by (simp add: isCont_def)
{"llama_tokens": 91, "file": null, "length": 1}
[STATEMENT] lemma subset_union_same1 [backward]: "B \<subseteq> C \<Longrightarrow> A \<union> B \<subseteq> A \<union> C" [PROOF STATE] proof (prove) goal (1 subgoal): 1. B \<subseteq> C \<Longrightarrow> A \<union> B \<subseteq> A \<union> C [PROOF STEP] by auto
{"llama_tokens": 95, "file": "Auto2_HOL_HOL_Set_Thms", "length": 1}
import numpy as np import cv2 def imcv2_recolor(im, a=.1): # t = [np.random.uniform()] # t += [np.random.uniform()] # t += [np.random.uniform()] # t = np.array(t) * 2. - 1. t = np.random.uniform(-1, 1, 3) # random amplify each channel im = im.astype(np.float) im *= (1 + t * a) mx ...
{"hexsha": "f9b1eab90c0402599a4bf92ba610eae9b8a1e397", "size": 973, "ext": "py", "lang": "Python", "max_stars_repo_path": "DetJoint/yolo_v2/utils/im_transform.py", "max_stars_repo_name": "Tommy-Ngx/AutoGradingOA", "max_stars_repo_head_hexsha": "5e69bd38abaf01f03d8d837da68701a86bac1bb0", "max_stars_repo_licenses": ["MIT...
import os import pandas as pd import numpy as np import pickle import flask from flask import Flask, request, jsonify from ensemble import Ensemble import boto3 BUCKET_NAME = 'ff-inbound-videos' # replace with your bucket name s3 = boto3.resource('s3') DETECTOR_WEIGHTS_PATH = 'WIDERFace_DSFD_RES152.fp16.pth' VIDE...
{"hexsha": "b56914c148dfe06258af1013d5ca2721aefe755c", "size": 1738, "ext": "py", "lang": "Python", "max_stars_repo_path": "detectors/ntech/app.py", "max_stars_repo_name": "zhampel/FakeFinder", "max_stars_repo_head_hexsha": "2891a8649acc1dabdef07554d6acb346dd23dbae", "max_stars_repo_licenses": ["Apache-2.0"], "max_star...
import torch import numpy as np from collections import OrderedDict from torch import optim from itertools import chain #from .swapgan import SwapGAN from .twogan import TwoGAN from torch import nn class ACAIF3(TwoGAN): """ Fixed version of ACAI with min() formulation and the discriminator also on reconstr...
{"hexsha": "4f0cd60fdb8b18269f717a676c9262b98141c235", "size": 6308, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/acai_f3.py", "max_stars_repo_name": "christopher-beckham/amr", "max_stars_repo_head_hexsha": "1bd67b9b4fb2fcf07cc8faba3c863f5ad5d4c4c0", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st...
#!/usr/bin/env python3 import argparse import random import numpy as np import scipy.stats import sacrebleu from tqdm import trange from comet.models import download_model def load_file(fh): sentences = [] for line in fh: sentences.append(line.strip()) fh.close() return sentences def confi...
{"hexsha": "ae415b88e63b7a7120bbf850b48f76d5338b0d00", "size": 1914, "ext": "py", "lang": "Python", "max_stars_repo_path": "char_scripts/eval_with_bootsrap_resampling.py", "max_stars_repo_name": "jlibovicky/char-nmt-fairseq", "max_stars_repo_head_hexsha": "b883b437eef2331ab328978d0ed71bbffbf0aa22", "max_stars_repo_lice...
import numpy as np import torch import heat as ht from .test_suites.basic_test import TestCase class TestTypes(TestCase): def assert_is_heat_type(self, heat_type): self.assertIsInstance(heat_type, type) self.assertTrue(issubclass(heat_type, ht.datatype)) def assert_non_instantiable_heat_type...
{"hexsha": "91676650f8d32287ebc8482f126fa4b79b53bd86", "size": 16059, "ext": "py", "lang": "Python", "max_stars_repo_path": "heat/core/tests/test_types.py", "max_stars_repo_name": "Dhruv454000/heat", "max_stars_repo_head_hexsha": "885f686af1193d8b297a643249bb8ae1ca40b897", "max_stars_repo_licenses": ["MIT"], "max_stars...
PURE FUNCTION func_stderr(arr, dof) RESULT(ans) ! NOTE: See https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.sem.html USE ISO_FORTRAN_ENV IMPLICIT NONE ! Declare inputs/outputs ... INTEGER(kind = INT64), INTENT(in), OPTIONAL :: dof REAL(kind = R...
{"hexsha": "bb655e64fb4ea6b6c2dc7faf1b44840fca2ddc14", "size": 910, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "mod_safe/func_stderr.f90", "max_stars_repo_name": "Guymer/fortranlib", "max_stars_repo_head_hexsha": "30e27b010cf4bc5acf0f3a63d50f11789640e0e3", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
# -*- coding: utf-8 -*- """ Created on Fri Jul 5 18:48:21 2019 @author: Theodore """ # -*- coding: utf-8 -*- """ @author: Theodore """ import numpy as np API_KEY = "WWLN1J8UJ2I7Q8ML" # get data from worldtradingdata def stock_url(function, symbol, outputsize): url = (f"https://www.alphavantage.co/query?funct...
{"hexsha": "7d560031031e749b42746bab88ecdc97b611a1c6", "size": 846, "ext": "py", "lang": "Python", "max_stars_repo_path": "misc_function2.py", "max_stars_repo_name": "edotheodore/Thesis-Project", "max_stars_repo_head_hexsha": "5e36aea435fe1a5032e96b44792cec8c888240d2", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
[STATEMENT] lemma dvd_Lcm_fin: "a \<in> A \<Longrightarrow> a dvd Lcm\<^sub>f\<^sub>i\<^sub>n A" [PROOF STATE] proof (prove) goal (1 subgoal): 1. a \<in> A \<Longrightarrow> a dvd Lcm\<^sub>f\<^sub>i\<^sub>n A [PROOF STEP] by (induct A rule: infinite_finite_induct) (auto intro: dvd_trans)
{"llama_tokens": 128, "file": null, "length": 1}
# Math Some essential math ## Vectors Represented by a matrix `r` as: \begin{equation*} r = \begin{bmatrix} i \\ j \end{bmatrix} \end{equation*} The vector above has 2 components `i` and `j`. ### Vector Operations #### Scalar Multiplication \begin{equation*} A \times r = A \begin{bmatrix} r_i \\ r_j \end{bma...
{"hexsha": "2757340a0361fa489572eda0ed95c8d581093ffd", "size": 30338, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "machine-learning/math/LinearAlgebra.ipynb", "max_stars_repo_name": "sthaha/notes", "max_stars_repo_head_hexsha": "1866ba8e8d916d23d3d4f19413e27136421d6e39", "max_stars_repo_licenses"...
import dgl import torch as to import torch.nn as nn import matplotlib.pyplot as plt def get_device(): device = to.device('cuda' if to.cuda.is_available() else 'cpu') print('running on', device) return device def build_graph(): # edges: 0->1, 0->2, 1-2 src = [0, 0, 1] tar = [1, 2, 2] gra...
{"hexsha": "64834ea1ee93b7f26c52543fcf7a988e302a73bc", "size": 1596, "ext": "py", "lang": "Python", "max_stars_repo_path": "gcn_minimal.py", "max_stars_repo_name": "maet3608/ex-dl-graph-conv-1", "max_stars_repo_head_hexsha": "95801f1b216fa78b7baa4eb4add411fa6612b500", "max_stars_repo_licenses": ["Apache-2.0"], "max_sta...
import openmdao.api as om import numpy as np class NormalForceODE(om.ExplicitComponent): def initialize(self): self.options.declare('num_nodes', types=int) def setup(self): nn = self.options['num_nodes'] #constants self.add_input('M', val=0.0, desc='mass', units='kg') ...
{"hexsha": "0becc5639aafe9765cef2f80d9dff2ff9e130419", "size": 4654, "ext": "py", "lang": "Python", "max_stars_repo_path": "dymos/examples/racecar/normalForceODE.py", "max_stars_repo_name": "pwmdebuck/dymos-1", "max_stars_repo_head_hexsha": "0fb3e91e8c32b34fca41e8c1ec9bec66f31af341", "max_stars_repo_licenses": ["Apache...
abstract type AbstractAttenOp end abstract type AbstractAttenScoreOp end abstract type AbstractMixingOp end struct DotProductScore <: AbstractAttenScoreOp end (::DotProductScore)(args...) = dot_product_score(args...) struct ScaledDotProductScore <: AbstractAttenScoreOp end (::ScaledDotProductScore)(args...) = scaled_...
{"hexsha": "3e85408f25059e8d2b98bf598decec2ffaf05fce", "size": 1099, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/types.jl", "max_stars_repo_name": "foldfelis/NeuralAttentionlib.jl", "max_stars_repo_head_hexsha": "52cb258807c9b8d308e14db0f99ec0d3492607c9", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
[STATEMENT] lemma (in group) lift_closed[simp]: assumes cl: "f \<in> gens \<rightarrow> carrier G" and "x \<in> lists (UNIV \<times> gens)" shows "lift f x \<in> carrier G" [PROOF STATE] proof (prove) goal (1 subgoal): 1. lift f x \<in> carrier G [PROOF STEP] proof- [PROOF STATE] proof (state) goal (1 subgoa...
{"llama_tokens": 531, "file": "Free-Groups_FreeGroups", "length": 7}
#!/usr/bin/python import matplotlib.pyplot as plt from math import * from scipy import special from optparse import OptionParser def psi(n, x): a = sqrt(2.0 * n + 1.0) A = sqrt(2.0 / pi) g = x/a p = sqrt(fabs(2.0 * n + 1.0 - x**2)) if (x == a) or (x == -a): return 0 if (x < -a): ...
{"hexsha": "082b33b234e6549d1799aa6229ffd028429ad9ca", "size": 2947, "ext": "py", "lang": "Python", "max_stars_repo_path": "Teorphys/graph.py", "max_stars_repo_name": "ncos/hometasks", "max_stars_repo_head_hexsha": "9504ef7ed8fe30b5bc78ca1e423a2b85e46734a1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "ma...
function [out1,out2,out3] = ginput4(arg1) [out1,out2,out3] = ginput(arg1); return; %GINPUT Graphical input from mouse. % [X,Y] = GINPUT(N) gets N points from the current axes and returns % the X- and Y-coordinates in length N vectors X and Y. The cursor % can be positioned using a mouse (or by using the Ar...
{"author": "JzHuai0108", "repo": "ekfmonoslam", "sha": "443f6be744732453cdb90679abcaf5c962a6295e", "save_path": "github-repos/MATLAB/JzHuai0108-ekfmonoslam", "path": "github-repos/MATLAB/JzHuai0108-ekfmonoslam/ekfmonoslam-443f6be744732453cdb90679abcaf5c962a6295e/EKF_monoSLAM_1pRANSAC/matlab_code/matlabcalibration2ourca...
! { dg-do run } ! { dg-options "-fcray-pointer" } ! use iso_c_binding real target(10) real pointee(10) pointer (ipt, pointee) integer(c_intptr_t) :: int_cptr real :: x if (c_sizeof(ipt) /= c_sizeof(int_cptr)) call abort() if (c_sizeof(pointee) /= c_sizeof(x)*10) call abort() end
{"hexsha": "127a24ab6a4ffd6ba5535ddfaac80b73dff08430", "size": 280, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "gcc-gcc-7_3_0-release/gcc/testsuite/gfortran.dg/c_sizeof_5.f90", "max_stars_repo_name": "best08618/asylo", "max_stars_repo_head_hexsha": "5a520a9f5c461ede0f32acc284017b737a43898c", "max_stars_rep...
# -*- coding: utf-8 -*- from igakit.nurbs import NURBS from numpy import sqrt, zeros class opNURBS(object): """ this class implements a generic differential operator applied to a NURBS object. """ def __init__(self, nrb): """ creates a gradiant map from a NURBS object """ ...
{"hexsha": "9b9bbc6d6b7522edbe8f611f03722bc9e52f5786", "size": 24779, "ext": "py", "lang": "Python", "max_stars_repo_path": "caid/op_nurbs.py", "max_stars_repo_name": "ratnania/caid", "max_stars_repo_head_hexsha": "5bc5428007c8642412762f80c36e8531e56cd15e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max...
import unittest import numpy as np from blmath.numerics import vector_shortcuts as vx class TestVector(unittest.TestCase): def test_normalize(self): import math v = np.array([1, 1, 0]) expected = np.array([math.sqrt(2) / 2., math.sqrt(2) / 2., 0]) np.testing.assert_array_almost_eq...
{"hexsha": "18ff7bdc45a3ca07e777124956c2256a9d43b1a8", "size": 7847, "ext": "py", "lang": "Python", "max_stars_repo_path": "blmath/numerics/test_vector_shortcuts.py", "max_stars_repo_name": "metabolize/blmath", "max_stars_repo_head_hexsha": "8ea8d7be60349a60ffeb08a3e34fca20ef9eb0da", "max_stars_repo_licenses": ["BSD-2-...
from Source.HDFGroup import HDFGroup import collections import sys import warnings import numpy as np from numpy import matlib as mb import scipy as sp import datetime as datetime import copy from PyQt5 import QtWidgets from tqdm import tqdm import HDFRoot from MainConfig import MainConfig from AncillaryReader impor...
{"hexsha": "d29091fa828d7338b65e4de9e101d20a27d40da1", "size": 106136, "ext": "py", "lang": "Python", "max_stars_repo_path": "Source/ProcessL2.py", "max_stars_repo_name": "jackassruiz/T_Nasa", "max_stars_repo_head_hexsha": "f396c6be6014eb5cbe4a69ee27201f25c1284a1f", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
# basic library import os import shutil import math import time import menpo.io as mio import menpo3d.io as m3io import numpy as np import h5py import pandas as pd from menpo.shape import ColouredTriMesh, PointCloud from menpo.image import Image from menpo.transform import Homogeneous from menpo3d.rasterize import ras...
{"hexsha": "ab86adeeb6ec43314ea3eb8d156e8168a8fa91d9", "size": 10073, "ext": "py", "lang": "Python", "max_stars_repo_path": "deepmachine/contrib/training/keras_3DMM.py", "max_stars_repo_name": "yuxiang-zhou/deepmachine", "max_stars_repo_head_hexsha": "b8a64354f7d37664172ef79a66b1fc0a9fa0f493", "max_stars_repo_licenses"...
from typing import Optional from gym import Env import numpy as np from agents import AbstractAgent class SarsaAgent(AbstractAgent): def __init__(self, env: Env, epsilon: float = 1.0, epsilon_min: float = 0, epsilon_reduction: float = 0.0, alpha: float = 0.01, alpha_min: float = 0, ...
{"hexsha": "e60b3b6d8b598d303ef08362bd757edb034ddd82", "size": 2312, "ext": "py", "lang": "Python", "max_stars_repo_path": "agents/sarsa_agent.py", "max_stars_repo_name": "SeJV/ComparisonRLapproaches", "max_stars_repo_head_hexsha": "e1988a97ed5fab10c847350d607e9feafeced61e", "max_stars_repo_licenses": ["MIT"], "max_sta...
import numpy as np import math import scipy.ndimage def frequest(im, orientim, kernel_size, minWaveLength, maxWaveLength): """ Based on https://pdfs.semanticscholar.org/ca0d/a7c552877e30e1c5d87dfcfb8b5972b0acd9.pdf pg.14 Function to estimate the fingerprint ridge frequency within a small block of a fi...
{"hexsha": "ec4e9680b01c8c4515e5813cd1418903e96f66e1", "size": 3461, "ext": "py", "lang": "Python", "max_stars_repo_path": "utils/frequency.py", "max_stars_repo_name": "bglezseoane/fingerprint_recognition", "max_stars_repo_head_hexsha": "f670d2fd42ab7b5d7e471a9a16a5490ddd1f9b2d", "max_stars_repo_licenses": ["MIT"], "ma...
import tkinter as tk from tkinter import * from tkinter import filedialog, Text import os from PIL import Image, ImageTk import numpy as np from tkinter.font import Font from tkinter.messagebox import * import time import first_face_dataset, registeruser, third_face_recognition image1='' main = Tk() dir_path = os.path...
{"hexsha": "aedace9527d762a9f0d40376c2843bdd7fdee22f", "size": 1600, "ext": "py", "lang": "Python", "max_stars_repo_path": "app.py", "max_stars_repo_name": "Nipun4338/mynotebook", "max_stars_repo_head_hexsha": "58f949b2986bee8b541eb026d3bbd906a1cd6d6e", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_...
using AcuteML using Dates: Time, Date export MRDHeader @enm PatientGender M F O @aml mutable struct SubjectInformation "~" patientName::UN{String}=nothing, "~" patientWeight_kg::UN{Float32}=nothing, "~" patientID::UN{String}=nothing, "~" patientBirthdate::UN{Date}=nothing, "~" patientGender::U...
{"hexsha": "ebc2d887482e60be0e8261564b50ce8fd3de2cc5", "size": 5996, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/MRDHeader.jl", "max_stars_repo_name": "dchansen/Gadgetron.jl-1", "max_stars_repo_head_hexsha": "cc811e6e3a5638802d8c77d5f563a327b0143b5b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":...
[STATEMENT] lemma one_dim_iso_adjoint[simp]: \<open>cadjoint one_dim_iso = one_dim_iso\<close> [PROOF STATE] proof (prove) goal (1 subgoal): 1. one_dim_iso\<^sup>\<dagger> = one_dim_iso [PROOF STEP] apply (rule cadjoint_eqI) [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<And>x y. one_dim_iso x \<bullet>\<^sub>C y...
{"llama_tokens": 179, "file": "Complex_Bounded_Operators_One_Dimensional_Spaces", "length": 2}
function fahrenheit_to_celsius(temp_f) result(temp_c) implicit none real temp_f real temp_c temp_c = (temp_f - 32.0) * (5.0/9.0) end function fahrenheit_to_celsius temp_c = fahrenheit_to_celsius(100.0) write(*,*) temp_c
{"hexsha": "e5974a6013b98c7ea51d3738214ed916725833be", "size": 221, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "content/code/fortran/fahrenheit_to_celsius_pure.f90", "max_stars_repo_name": "transferorbit/coderefinery_testing", "max_stars_repo_head_hexsha": "b1011345cd6ed614e702b372bd2d987521bba130", "max_s...
""" Copyright MIT and Harvey Mudd College MIT License Summer 2020 Lab 6 - Sensor Fusion """ ######################################################################################## # Imports ######################################################################################## import sys import cv2 as cv import nu...
{"hexsha": "5bb9c746b4b114dc85003df992e8d5ce60918ed4", "size": 3817, "ext": "py", "lang": "Python", "max_stars_repo_path": "labs/lab6/lab6.py", "max_stars_repo_name": "MITLLRacecar/racecar-anhad", "max_stars_repo_head_hexsha": "c4f1fc727acf67d2bf1b0ad6ab7ea68b3c24c6fc", "max_stars_repo_licenses": ["MIT"], "max_stars_co...
function [ vX, mX ] = SolveLsL1ComplexCd( mA, vB, lambdaFctr, numIterations ) % ----------------------------------------------------------------------------------------------- % %[ vX, mX ] = SolveLsL1ComplexPgm( mA, vB, lambdaFctr, numIterations ) % Solves the 0.5 * || A x - b ||_2 + \lambda || x ||_1 problem using % ...
{"author": "RoyiAvital", "repo": "StackExchangeCodes", "sha": "d2a934616995fa8a9f4df1ca29029402435b9e6f", "save_path": "github-repos/MATLAB/RoyiAvital-StackExchangeCodes", "path": "github-repos/MATLAB/RoyiAvital-StackExchangeCodes/StackExchangeCodes-d2a934616995fa8a9f4df1ca29029402435b9e6f/Mathematics/Q1344369/SolveLsL...
import hypothesis_utils import numpy as np from hypothesis import assume, given, settings from autorad.feature_selection.selector import AnovaSelector class TestAnovaSelection: def setup_method(self): self.selector = AnovaSelector(n_features=5) @given(df=hypothesis_utils.medium_df()) @settings(m...
{"hexsha": "ba35546f27733494fbdfab50a4ec713da4a5b7a8", "size": 1044, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/autorad/test_feature_selector.py", "max_stars_repo_name": "pwoznicki/ClassyRadiomics", "max_stars_repo_head_hexsha": "07b6c39a8ea41d9bb18b1fbfe2a817736a26b5ed", "max_stars_repo_licenses": ["...
#include <gtest/gtest.h> #include <Eigen/Dense> #include <vector> #include "matrix.pb.h" #include "src/collectors/file_collector.h" #include "src/collectors/memory_collector.h" #include "src/utils/proto_utils.h" TEST(collectors, memory) { MemoryCollector coll; coll.start_collecting(); std::vector<Eigen::Vecto...
{"hexsha": "38da70caacfca1a4278a70a959ad2cc097e01964", "size": 1827, "ext": "cc", "lang": "C++", "max_stars_repo_path": "test/collectors.cc", "max_stars_repo_name": "mberaha/bayesmix", "max_stars_repo_head_hexsha": "4448f0e9f69ac71f3aacc11a239e3114790c1aaa", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count...
import torch import torch.nn as nn from torch.distributions.normal import Normal import numpy as np from config import cfg import time import os #from fast_weights import fast_weights_model from generate import Graph4D from torch.distributions.kl import kl_divergence import scores from tensorboardX import SummaryWrit...
{"hexsha": "92b11b9154520bd35a34f72bbeb14c826a3e57b4", "size": 9856, "ext": "py", "lang": "Python", "max_stars_repo_path": "TEM_simple_rnn.py", "max_stars_repo_name": "Victorwz/Generative-Hippocampal-entorhinal-System", "max_stars_repo_head_hexsha": "5f38b0fea364c1974ebaf25f16576777a35295e3", "max_stars_repo_licenses":...
# -*- coding: utf-8 -*- """ This module contains code to read and write FlyMovieFormat files, which end with extension .fmf. Users may like to use these classes: - :class:`~motmot.FlyMovieFormat.FlyMovieFormat.FlyMovie` : read .fmf files - :class:`~motmot.FlyMovieFormat.FlyMovieFormat.FlyMovieSaver` : write .fmf fi...
{"hexsha": "a9f85dd62c7355b5027d46f0bb3cbab72878aa9d", "size": 21528, "ext": "py", "lang": "Python", "max_stars_repo_path": "motmot/FlyMovieFormat/FlyMovieFormat.py", "max_stars_repo_name": "motmot/flymovieformat", "max_stars_repo_head_hexsha": "f6ce6043a46e4070dff8d76eba92e0e2a433ec8f", "max_stars_repo_licenses": ["BS...
import numpy as np import pymol import chempy import sys from pymol.cgo import * from pymol import cmd from random import randint ############################################################################# # # drawBoundingBox.py -- Draws a box surrounding a selection # # # AUTHOR: Jason Vertrees # DATE : 2/20/200...
{"hexsha": "95310d716e8f171d29e6b2d1d9f5d7051cf7cdb1", "size": 9936, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/py2/show_cavbox.py", "max_stars_repo_name": "akors/cavitylearn", "max_stars_repo_head_hexsha": "a03d159cbefce83d4c4c731a9c2573e7261faf91", "max_stars_repo_licenses": ["MIT"], "max_stars_count"...
# -*- coding: utf-8 -*- # Author: Aris Tritas <aris.tritas@u-psud.fr> # License: BSD 3-clause import matplotlib.pyplot as plt import networkx as nx import numpy as np def singleplot(data, horizon, title, filepath, xy_labels=None): """ Simple plot of a data array. :param data: Data array :param horizo...
{"hexsha": "00607a3c8ed11e01627185d0a0b4d0725b35c41d", "size": 2906, "ext": "py", "lang": "Python", "max_stars_repo_path": "bitl/utils/plot.py", "max_stars_repo_name": "tritas/bitl", "max_stars_repo_head_hexsha": "f394e633e38f983fed10c3e672af7be2883cbdbb", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count":...
using ArtificialBeeColony # initializer for bees' position function init() rand(1)*20 .- 10 # [-10, 10] end # target function function target(x::Vector{Float64}) x[1]^2+10*sin(2*x[1]) end N = 50 # the number of bees epoch = 100 # the number of iteration flag = true # time invariant flag abc = ABC...
{"hexsha": "1105ebe618c39420b46b50199b63175a323d0106", "size": 456, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "example/ex.jl", "max_stars_repo_name": "peakbook/ArtificialBeeColony.jl", "max_stars_repo_head_hexsha": "5185bb0ccfb9a3b9f24ed1407df60c7e398e0cf0", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
import os import numpy as np from PIL import Image from .seg_dataset import SegDataset from .voc_seg_dataset import VOCMetaInfo class CityscapesSegDataset(SegDataset): """ Cityscapes semantic segmentation dataset. Parameters: ---------- root : str Path to a folder with `leftImg8bit` and `...
{"hexsha": "e02b7c26bc6f209453c89e9af38e03aeda151f7b", "size": 5066, "ext": "py", "lang": "Python", "max_stars_repo_path": "pytorch/datasets/cityscapes_seg_dataset.py", "max_stars_repo_name": "naviocean/imgclsmob", "max_stars_repo_head_hexsha": "f2993d3ce73a2f7ddba05da3891defb08547d504", "max_stars_repo_licenses": ["MI...
struct ScaledDiagonallyDominantVariableBridge{T} <: AbstractVariableBridge side_dimension::Int variables::Vector{NTuple{3, MOI.VariableIndex}} psd2x2::Vector{MOI.ConstraintIndex{MOI.VectorOfVariables, PositiveSemidefinite2x2ConeTriangle}} end function add_variable_bri...
{"hexsha": "94eb7cb9976a0960104ea61efa455a511bc601f1", "size": 3390, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/scaled_diagonally_dominant_variable_bridge.jl", "max_stars_repo_name": "barpit20/SumOfSquares.jl", "max_stars_repo_head_hexsha": "8f64fca496ad29f2dc04241c864038ad2e2b78da", "max_stars_repo_lice...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as mpatches def type_to_color(info, i): if(info['TYPE'][i] == 'Minority'): return 'o' elif(info['TYPE'][i] == 'Implanted'): return 'd' else: return '^' data = pd.read_csv("AP_SCORES.csv...
{"hexsha": "511e8aaf957b8a72b14e954ff64f946e2826a480", "size": 3301, "ext": "py", "lang": "Python", "max_stars_repo_path": "Analysis Scripts/efficiency_plot.py", "max_stars_repo_name": "droubo/meta-level-analysis-of-anomaly-detectors", "max_stars_repo_head_hexsha": "a64671365b6c98ad14fc82f3430d3082b0455a6c", "max_stars...
\chapter*{Acknowledgments} \paragraph*{} It is a pleasure to thank all those who made this thesis possible. First of all, I would like to deeply thank my thesis advisor Dr. Yuan Xu for his continued support throughout the months that i worked on this Master Thesis at DAI Labor. \paragraph*{} The biggest thanks hav...
{"hexsha": "0454081bf0350a8d5da3e5cf45cc1fc6ff117d4a", "size": 1165, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "document/thesis/chapter/preface/acknowledgment.tex", "max_stars_repo_name": "AravinthPanch/gesture-recognition-for-human-robot-interaction", "max_stars_repo_head_hexsha": "42effa14c0f7a03f460fba5cd8...
import argparse import copy import logging import os import pickle import sys import time import gym from gym import logger as gym_logger import numpy as np import torch from torch.autograd import Variable import torch.nn as nn gym_logger.setLevel(logging.CRITICAL) parser = argparse.ArgumentParser() parser.add_argume...
{"hexsha": "b15f04138efdb78aba30159b76b8a3f6e8c69be3", "size": 1697, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/lander/play_pytorch.py", "max_stars_repo_name": "felix0901/Pytorch-NeuroEvolution", "max_stars_repo_head_hexsha": "e74fd90dc03343137fbcc47d6a41d9dfc5237c9b", "max_stars_repo_licenses": ["...
import numpy as np from rubin_sim.utils import (haversine, _raDecFromAltAz, _altAzPaFromRaDec, Site, ObservationMetaData, _approx_altAz2RaDec, _approx_RaDec2AltAz) import warnings from .utils import wrapRA from .interpComponents import (ScatteredStar, Airglow, LowerAtm, UpperAtm, MergedSpec...
{"hexsha": "2b25bf1f248cff42f0ca55a0ca10091eb3b74a6f", "size": 24339, "ext": "py", "lang": "Python", "max_stars_repo_path": "rubin_sim/skybrightness/skyModel.py", "max_stars_repo_name": "RileyWClarke/flarubin", "max_stars_repo_head_hexsha": "eb7b1ee21c828523f8a5374fe4510fe6e5ec2a2a", "max_stars_repo_licenses": ["MIT"],...
#pragma once #include <set> #include <atomic> #include <memory> #include <Qt> #include <QtGui> #include <QtWidgets> #include <boost/filesystem.hpp> #include <rai/common/errors.hpp> #include <rai/common/numbers.hpp> #include <rai/common/alarm.hpp> #include <rai/wallet/wallet.hpp> #include <rai/rai_wallet/config.hpp> n...
{"hexsha": "822dc6580019eb451288153642ddc7b7e56879e6", "size": 11274, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "rai/rai_wallet/qt.hpp", "max_stars_repo_name": "gokoo/Raicoin", "max_stars_repo_head_hexsha": "494be83a1e29106d268f71e613fac1e4033a82f2", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 94.0...
import os import shutil import numpy as np class SplitDatasetManager(object): def __init__(self, root_dir, classes_dir, include_hidden_files=False): self.root_dir = root_dir self.classes_dir = classes_dir self.include_hidden_files = incl...
{"hexsha": "3cf6fd68695fa3f4a4bc2b9537e3179324c80fa4", "size": 2631, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/split_data_into_datasets_manager.py", "max_stars_repo_name": "iglaweb/HippoYD", "max_stars_repo_head_hexsha": "da2c40be8017c43a7b7b6c029e2df30cf7d54932", "max_stars_repo_licenses": ["Apache-2....
using GenerativeAD using FileIO, BSON using ValueHistories, DistributionsAD using Flux using ConditionalDists using GenerativeModels using EvalMetrics using Plots using Statistics using DrWatson dataset = "arrhythmia" dataset = "wall-following-robot" dataset = "yeast" dataset = "letter-recognition" dataset = "kdd99_sm...
{"hexsha": "e9dad7699600005183d100188e36e37f0d5e9327", "size": 2146, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "scripts/clean_val/compute_tst_auc_vs_val_score.jl", "max_stars_repo_name": "aicenter/GMAD.jl", "max_stars_repo_head_hexsha": "fb7ba28c61703df713953ed2b28728f768562ad9", "max_stars_repo_licenses": [...
import cv2 import numpy as np import os import pandas as pd import Localization import Recognize import matplotlib.pyplot as plt def majority_vote(recognized_plates): N = len(recognized_plates) label_count = 0 labels = np.zeros((N, 1)) for i in range(N-1): ref_number = recognized_plates[i][0] t...
{"hexsha": "62ff88f1dc3b6166f2413e2b1e3437fc6ae8f645", "size": 9062, "ext": "py", "lang": "Python", "max_stars_repo_path": "CaptureFrame_Process.py", "max_stars_repo_name": "amaury-charlot/LicensePlateRecognition", "max_stars_repo_head_hexsha": "74a79c7911b85b205b18aee76b5aea03b34817d4", "max_stars_repo_licenses": ["FT...
theory flash109Rev imports flashPub begin section{*Main defintions*} lemma NI_FAckVsInv109: (*Rule0VsPInv0*) shows "invHoldForRule' s (inv109 ) (NI_FAck ) (invariants N)" (is " ?P1 s\<or>?P2 s\<or>?P3 s") by( auto) lemma NI_InvVsInv109: (*Rule1VsPInv0*) assumes a1:"iRule1 \<le> ...
{"author": "lyj238Gmail", "repo": "IsabelleCourse", "sha": "cd49d944d3504328ad8210fbd987abebdf192ed8", "save_path": "github-repos/isabelle/lyj238Gmail-IsabelleCourse", "path": "github-repos/isabelle/lyj238Gmail-IsabelleCourse/IsabelleCourse-cd49d944d3504328ad8210fbd987abebdf192ed8/flash/flash109Rev.thy"}
from skimage import draw, io import numpy as np ratio = 2 imgSize = 64*ratio img = np.zeros((imgSize, imgSize), dtype=np.uint8) x = np.array([0, 0, 18, 18])*ratio y = np.array([0, 32, 50, 0])*ratio x += (imgSize - (x.max()-x.min()))//2 y += (imgSize - (y.max()-y.min()))//2 # rr, cc = draw.polygon(x, y) rr, ...
{"hexsha": "395f134057462458d3d54577a8cca8fcce1d7c5f", "size": 524, "ext": "py", "lang": "Python", "max_stars_repo_path": "clump/diagramIn2d/drawAnEllipse.py", "max_stars_repo_name": "chua-n/particle", "max_stars_repo_head_hexsha": "faf966a381bef0b7206498c7c5419432348215b3", "max_stars_repo_licenses": ["Apache-2.0"], "...
def correlating_feature_filter(df_regprops,threshold): import numpy as np import pandas as pd import PySimpleGUI as sg # Actually finding the correlating features with pandas correlation_df = df_regprops.corr().abs() correlation_matrix = correlation_df.to_numpy() # using numpy to get the c...
{"hexsha": "bab11b5e968eefe02a8ec3c5ae58f2fe6abd6a9d", "size": 2955, "ext": "py", "lang": "Python", "max_stars_repo_path": "tribolium_clustering/feature_processing/_correlation_filter.py", "max_stars_repo_name": "Cryaaa/tribolium-clustering", "max_stars_repo_head_hexsha": "f5751ec8c007e95e8a9688d2d8e34508b04f0822", "ma...
""" Functions for working with shapefiles. """ from distutils.version import LooseVersion import warnings from pathlib import Path import os import collections import shutil import fiona from shapely.geometry import shape, mapping import numpy as np import pandas as pd import pyproj from pyproj.enums import WktVersion ...
{"hexsha": "13c6b424766269ed3564e45f2b69d02249c43490", "size": 16260, "ext": "py", "lang": "Python", "max_stars_repo_path": "python_packages_static/gisutils/shapefile.py", "max_stars_repo_name": "usgs/neversink_workflow", "max_stars_repo_head_hexsha": "acd61435b8553e38d4a903c8cd7a3afc612446f9", "max_stars_repo_licenses...
# coding:utf-8 # Copyright (c) 2020 PaddlePaddle Authors. 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/LICENSE-2.0 # # Unless req...
{"hexsha": "f857f1fd0e68b7e2a766e35eabf4130d54355a1f", "size": 2297, "ext": "py", "lang": "Python", "max_stars_repo_path": "paddlehub/datasets/minicoco.py", "max_stars_repo_name": "chunzhang-hub/PaddleHub", "max_stars_repo_head_hexsha": "c5cfd021f77fd59340fb26e223e09a592e6a345f", "max_stars_repo_licenses": ["Apache-2.0...
import pandas as pd import numpy as np from scipy.stats import entropy import matplotlib.pyplot as plt from matplotlib.lines import Line2D import seaborn as sn import mdscaling as mds # Loading Directed Bipartite Twitter graphs DG={} for country in ['chile','france']: DG[country] = mds.DiBipartite('datasets/twit...
{"hexsha": "67d119c951b2a7b4f687093b354ad2d93718ab9b", "size": 1675, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/twitter_example.py", "max_stars_repo_name": "jphcoi/MDScaling", "max_stars_repo_head_hexsha": "1ace349a195d1af2371d7db9e5ffb5467b06f117", "max_stars_repo_licenses": ["MIT"], "max_stars_count...
import numpy as np from . import augmentation_pool from . import utils class RandAugment: """ RandAugment class Parameters -------- nops: int number of operations per image magnitude: int maximmum magnitude alg: str algorithm name """ def __init__(self, nop...
{"hexsha": "2ae8f3f1f674b89c7b1eee4b835ec49b55f52201", "size": 1351, "ext": "py", "lang": "Python", "max_stars_repo_path": "cords/utils/data/datasets/SSL/augmentation/rand_augment.py", "max_stars_repo_name": "krishnatejakk/AUTOMATA", "max_stars_repo_head_hexsha": "fd0cf58058e39660f88d9d6b4101e30a497f6ce2", "max_stars_r...
using WoodburyMatrices using Test seed!(123) n = 5 for elty in (Float32, Float64, ComplexF32, ComplexF64, Int), AMat in (x -> Matrix(Diagonal(x)),) elty = Float64 a = rand(n); B = rand(n,2); D = rand(2,2); v = rand(n) if elty == Int v = rand(1:100, n) a = rand(1:100, n) B = rand...
{"hexsha": "5c38ef111cfae690fc33e823353b0dfe57a5f85a", "size": 4417, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests_sym.jl", "max_stars_repo_name": "UnofficialJuliaMirror/WoodburyMatrices.jl-efce3f68-66dc-5838-9240-27a6d6f5f9b6", "max_stars_repo_head_hexsha": "79fd736f5a0e4f380de661b85eed5ccd6e3d73...
''' @author: Kai Londenberg @TODO: * NoisyMax: Implement an efficient Noisy-Max PotentialTable with sparse parametrization as described in https://web.archive.org/web/20130622092203/http://www.ia.uned.es/~seve/publications/MAX.pdf * Particle List Message Passing: Create an efficient particle list...
{"hexsha": "97aa00317a06a1bb6b7c033af8de9137a8906f0b", "size": 15099, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/pypgmc/potential_tables.py", "max_stars_repo_name": "kadeng/pypgmc", "max_stars_repo_head_hexsha": "909445fa3a426b07b39b65d2cb8979b1db8cdfca", "max_stars_repo_licenses": ["Apache-2.0"], "max_...
The goal of this chapter is to provide a comprehensive treatment of the most relevant gradient and subgradient methods for convex optimization. We intend to cover the most robust methods with the fewest assumptions first, and then later move to methods which require more assumptions but have much better convergence ra...
{"hexsha": "d4c12aed9a42b8e5e5fc4fa0dd15ba68a98fddba", "size": 61635, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "6DL/SubgradientMethods.tex", "max_stars_repo_name": "liuzhengqi1996/math452", "max_stars_repo_head_hexsha": "635b6ce53cb792e316abf4f47396f2e4f0686815", "max_stars_repo_licenses": ["MIT"], "max_star...
#include <iostream> #include <boost/signals2.hpp> #include <boost/log/core.hpp> #include <boost/log/trivial.hpp> #include <boost/log/expressions.hpp> #include "copper/Engine.h" #include "copper/Operator/OpNode.h" #include "NodeItem.h" #include "NodeConnectionItem.h" #include "NodeFlowScene.h" namespace copper { n...
{"hexsha": "45b5ef40aab07b3971914edd8e05e6b33f8546b0", "size": 3270, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/copperfx/panels/NodeFlowViewPanel/NodeFlowScene.cpp", "max_stars_repo_name": "all-in-one-of/CopperFX", "max_stars_repo_head_hexsha": "9a50b69a57ebd6aa578d12456e34d792a7c51916", "max_stars_repo_l...