text
stringlengths
0
1.25M
meta
stringlengths
47
1.89k
# -*- coding: utf-8 -*- """ Generate angle list and plot numbers of sensors for each angle on a cubemap Allow to manually tune overlap for best coverage versus number of measurements @author: Brice Dubost Copyright 2020 Brice Dubost Licensed under the Apache License, Version 2.0 (the "License"); you may not...
{"hexsha": "0baa63aca8a56f668d4a9e4b2642f016c784f973", "size": 8056, "ext": "py", "lang": "Python", "max_stars_repo_path": "robot_optimize_angles.py", "max_stars_repo_name": "brice-digilus/Infrared_Analysis", "max_stars_repo_head_hexsha": "614a14b832f130f9cca9ea3659c08e40fb3d1b1c", "max_stars_repo_licenses": ["Apache-2...
import numpy as np from numpy import ma from scipy.optimize import bisect # This code was modified slightly from superplot; some functionality was depreciated, so this filled in the blanks # URL to original code is below: # https://github.com/michaelhb/superplot/blob/master/superplot/statslib/two_dim.py def posterior...
{"hexsha": "a2b26366ee20f007e34302188848b0f8ef062cbd", "size": 8019, "ext": "py", "lang": "Python", "max_stars_repo_path": "Plotting/plottingUtils/statUtils.py", "max_stars_repo_name": "jnhoward/SU2LDM_public", "max_stars_repo_head_hexsha": "67db9142cbb67946e273ac940d13906d0a39bf58", "max_stars_repo_licenses": ["MIT"],...
[STATEMENT] lemma LIMSEQ_le_const2: "X \<longlonglongrightarrow> x \<Longrightarrow> \<exists>N. \<forall>n\<ge>N. X n \<le> a \<Longrightarrow> x \<le> a" for a x :: "'a::linorder_topology" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>X \<longlonglongrightarrow> x; \<exists>N. \<forall>n\<ge>N. X n \<l...
{"llama_tokens": 169, "file": null, "length": 1}
import numpy as np import pandas as pd from munch import Munch from plaster.run.prep import prep_fixtures from plaster.run.prep.prep_worker import triangle_dytmat, dyt_to_seq from plaster.run.priors import PriorsMLEFixtures, MLEPrior from plaster.run.sim_v2 import sim_v2_worker from plaster.run.sim_v2.sim_v2_params imp...
{"hexsha": "7c92f6f2420585a3c10ad1731b0110b8e74b7f7d", "size": 18488, "ext": "py", "lang": "Python", "max_stars_repo_path": "plaster/run/sim_v2/zests/zest_sim_v2_worker.py", "max_stars_repo_name": "erisyon/plaster", "max_stars_repo_head_hexsha": "20af32aed2365c6351fe3c26293308960099152b", "max_stars_repo_licenses": ["M...
"""Copyright © 2020-present, Swisscom (Schweiz) AG. All rights reserved.""" from subprocess import call import numpy as np from codi.codi_utils import create_speech_data, create_unlabelled_speech_data, save_ids from codi.speech_trainer import SpeechTrainer def train_codi(labelling='naive', threshold=None): """ ...
{"hexsha": "5cb5b377224582a6e8dcf445da8eb77b5e8f8c9a", "size": 2784, "ext": "py", "lang": "Python", "max_stars_repo_path": "main_speech.py", "max_stars_repo_name": "swisscom/ai-research-data-valuation-repository", "max_stars_repo_head_hexsha": "bcb45b7d8b84674f12e0a3671260290d98257c9f", "max_stars_repo_licenses": ["Apa...
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy import scipy import os import pylab import networkx as nx pylab.ion() ######################## # Computes which pairs are highly cross # correlated and highly PLV (Phase Locking Value) # correlated ######################## path=os....
{"hexsha": "83157194aafba52d0d0584cdb04f78042ebcb5c0", "size": 4243, "ext": "py", "lang": "Python", "max_stars_repo_path": "TEST_1/Analysis/Classification_Synchronization_Types_Network.py", "max_stars_repo_name": "dmalagarriga/PLoS_2015_segregation", "max_stars_repo_head_hexsha": "949afedf96945c11ee84b1a6c9842e5257fb5b...
Christianity is a relatively popular religion in town. Besides churches, there are a number of local businesses and services that either cater specifically to Christians or that operate under a Christian philosophy. Retail Davis Christian Bookroom Integrity Windows & Doors Christian Education Davis Communi...
{"hexsha": "1df3e611faa09db06875d1679f029045ed86ae3b", "size": 469, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "lab/davisWiki/Christian_Businesses_and_Services.f", "max_stars_repo_name": "voflo/Search", "max_stars_repo_head_hexsha": "55088b2fe6a9d6c90590f090542e0c0e3c188c7d", "max_stars_repo_licenses": ["MIT...
From Categories Require Import Essentials.Notations. From Categories Require Import Essentials.Types. From Categories Require Import Essentials.Facts_Tactics. From Categories Require Import Category.Main. From Categories Require Import Functor.Functor Functor.Functor_Ops Functor.Representable.Hom_Func. From Cat...
{"author": "amintimany", "repo": "Categories", "sha": "1839108875df0107fa4f6061c654003decda2d49", "save_path": "github-repos/coq/amintimany-Categories", "path": "github-repos/coq/amintimany-Categories/Categories-1839108875df0107fa4f6061c654003decda2d49/KanExt/LocalFacts/ConesToHom.v"}
#!/usr/bin/python import argparse import random import os import subprocess import math import sys import time import copy from numpy.random import choice as choices from WES_simulator import * from snp_rate import * def main(): parser = argparse.ArgumentParser(description='Simulator for WES or WGS data', \ forma...
{"hexsha": "5d4223c91f7bf46447cea8a9767abe84d0c7fee5", "size": 15517, "ext": "py", "lang": "Python", "max_stars_repo_path": "SECNVs.py", "max_stars_repo_name": "YJulyXing/SECNVs-SimulateCNVs-2.0-", "max_stars_repo_head_hexsha": "e1a4a7fe6ca4370e9fe3d7b92ecdf3ec5c55cbd4", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
module Dh_allDs ! contains functions that compute the dh/dsigma matrices of the material model ! and one main (model-indepenent) function that calls all dh/dsigma functions of the model ! and returns the function values as a matrix use constants use material_info use derived_types implicit none contains ...
{"hexsha": "493282eeec93523004b4a8c46ac828128d97f30c", "size": 1800, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "return_mapping/model_components_all/Dh_allDs.f90", "max_stars_repo_name": "yuyong1990/TsaiWu-Fortran", "max_stars_repo_head_hexsha": "a111ca1717adfbbaf3e9e34f4189a441e16441b8", "max_stars_repo_l...
"""Dataloader for language generation""" from collections import Counter from itertools import chain import numpy as np from .._utils.unordered_hash import UnorderedSha256 from .._utils.file_utils import get_resource_file_path from .dataloader import BasicLanguageGeneration from ..metric import MetricChain, Perplexit...
{"hexsha": "b9c3d38a94d15c33de7b5812e5cf1089508886fd", "size": 7988, "ext": "py", "lang": "Python", "max_stars_repo_path": "contk/dataloader/language_generation.py", "max_stars_repo_name": "GentleSmile/contk", "max_stars_repo_head_hexsha": "14c86b16e064c3034f64f6c48a267a0a31f0c463", "max_stars_repo_licenses": ["Apache-...
import math from typing import Tuple import numpy as np import torch import torch.nn as nn import torch.optim as optim from torch import Tensor from data import GenericTranslationDataset, BATCH_SIZE class EncoderDecoderTransformer(nn.Module): def __init__( self, d_model: int, ...
{"hexsha": "ab7f6887d17a792025f739f1f1ac9b4bd8477fb8", "size": 8354, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/transformer.py", "max_stars_repo_name": "RyanElliott10/PyTorch-Transformer", "max_stars_repo_head_hexsha": "4ac9842712a9c0fa9a2396684ca92ef0d048fd05", "max_stars_repo_licenses": ["MIT"], "max_...
from molsysmt._private_tools.exceptions import * import numpy as np from molsysmt.elements import entities types = ["water", "ion", "cosolute", "protein", "peptide", "rna", "dna", "lipid", "small molecule"] def _aux(item): from molsysmt import get from numpy import empty, full entities = {} n_entit...
{"hexsha": "871288dea14fbf1468e93863e963abf1ebecfc8a", "size": 9609, "ext": "py", "lang": "Python", "max_stars_repo_path": "molsysmt/elements/entity.py", "max_stars_repo_name": "uibcdf/MolSysMT", "max_stars_repo_head_hexsha": "9866a6fb090df9fff36af113a45164da4b674c09", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
import numpy as np from matplotlib import pyplot as plt import advec_diff plt.yscale("log") runner = advec_diff.AdvecDiffRunner() def case_sdc(): runner.variant = "sdc" runner.coarse_factor = 1 runner.run() t, r, rr, e, re = runner.results() i = np.arange(0, len(r)) plt.plot(i, r, "^-", labe...
{"hexsha": "e90a66cad3d6944a78a3370ea749ebd49de583b5", "size": 1396, "ext": "py", "lang": "Python", "max_stars_repo_path": "advec_diff/coarse_factor.py", "max_stars_repo_name": "f-koehler/pfasst-analysis", "max_stars_repo_head_hexsha": "5a55fc6d4f5c7fd7ceec6c6c6354ad8231d361f3", "max_stars_repo_licenses": ["MIT"], "max...
\documentclass{standalone} \begin{document} \chapter*{Conclusions}\addcontentsline{toc}{chapter}{Conclusions} \markboth{Conclusions}{Conclusions} In this work of thesis, I have developed, implemented and tested an automated pipeline for the identification of Ground Glass Opacities and Consolidation in chest CT sc...
{"hexsha": "5289b6277907cfcba1182c55ec98a7fa2251425e", "size": 2308, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "tex/conclusions.tex", "max_stars_repo_name": "RiccardoBiondi/SCDthesis", "max_stars_repo_head_hexsha": "2506df1995e5ba239b28d2ca0b908ba55f81761b", "max_stars_repo_licenses": ["MIT"], "max_stars_coun...
module TestProject using StaticArrays function dot(x) v = SVector(x...) return v'v end end # module
{"hexsha": "e9b246345cc58a3e4375a4bae893646c14b2595e", "size": 111, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/TestProject/src/TestProject.jl", "max_stars_repo_name": "jondeuce/MATDaemon.jl", "max_stars_repo_head_hexsha": "6a1de76acd835991e24f07067dd8c43c59e5e380", "max_stars_repo_licenses": ["MIT"], "m...
using QMTK using Compat.Test @testset "Utils" begin using QMTK.Consts.Pauli @test kronprod(sigmax, sigmax, sigmai) == kron(kron(sigmax, sigmax), sigmai) @test sigmax ⊗ sigmay ⊗ sigmaz == kron(kron(sigmax, sigmay), sigmaz) h = @kron sigmax[1] ⊗ sigmaz[3] + sigmax[2] ⊗ sigmay[4] ans = kronprod(σ₁, σ₀, σ₃, σ₀) + kronp...
{"hexsha": "626dde69536bfc9840e62ad0e82421daf7c5f9e8", "size": 622, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/Utils.jl", "max_stars_repo_name": "Roger-luo/QMTK.jl", "max_stars_repo_head_hexsha": "90987261588fc8a4aefa73df2b1fb5d0c5a3f9d5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 12, "max_...
# Copyright (c) Facebook, Inc. and its affiliates.import math import os import torch import numpy as np from tqdm import tqdm_notebook import imageio import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt from skimage import img_as_ubyte import pdb import glob import natsort from torch.au...
{"hexsha": "d0ed0a91b61572a0c16f1ccf22d91e901abef6a6", "size": 10443, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocess/visualize_data.py", "max_stars_repo_name": "ChicyChen/my_d3d", "max_stars_repo_head_hexsha": "efe3eb1f8c270ca371f628b1d6eface3042ac9a7", "max_stars_repo_licenses": ["BSD-3-Clause"], "m...
import csv import json from glob import glob from pprint import pprint import pandas from numpy import mean files = glob('*.json') results = {} for file in files: name = file.split(".")[0].split("_") name = name[1] + " " + name[2] data = json.load(open(file)) accuracy = mean([max(run["acc"]) for run i...
{"hexsha": "5dc9588f1fcd00666770295f6b042f9b947245d9", "size": 711, "ext": "py", "lang": "Python", "max_stars_repo_path": "nldrp/dnn/models/aggregate_scores.py", "max_stars_repo_name": "etzinis/nldrp", "max_stars_repo_head_hexsha": "3b6e24aa86a6d43bfd6f753b346739c00c282de3", "max_stars_repo_licenses": ["MIT"], "max_sta...
import tensorflow as tf import numpy as np import logging import hypertune import argparse import shutil import os def parse_tfrecord(example_data): parsed = tf.io.parse_single_example(example_data, { 'size': tf.io.VarLenFeature(tf.int64), 'ref': tf.io.VarLenFeature(tf.float32), 'time': tf...
{"hexsha": "da8b97f0026747c44386e0560814c1c0bd681c13", "size": 6880, "ext": "py", "lang": "Python", "max_stars_repo_path": "02_data_representation/weather_search/wxsearch/train_autoencoder.py", "max_stars_repo_name": "fanchi/ml-design-patterns", "max_stars_repo_head_hexsha": "6f686601d2385a11a517f8394324062ec6094e14", ...
import numpy as np from pyspark.conf import SparkConf from pyspark.context import SparkContext conf = SparkConf().setAppName("HW3").setMaster("local[2]") sc = SparkContext(conf=conf) # Map the data to a tuple of (hour, (project code, page name), page views) # We combine project code and page name with a delimeter of...
{"hexsha": "e0d97f8f79b2ce209adda70eb053e48fe98fdb84", "size": 2276, "ext": "py", "lang": "Python", "max_stars_repo_path": "Spark/2a.py", "max_stars_repo_name": "bcspragu/Machine-Learning-Projects", "max_stars_repo_head_hexsha": "b6832cbb9bb27d7e8253300f97a3ab84b1a555dc", "max_stars_repo_licenses": ["MIT"], "max_stars_...
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab /* * Ceph - scalable distributed file system * * Copyright (C) 2012 Inktank Storage, Inc. * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * Lic...
{"hexsha": "f816ff41db0bd9a3f023e12fc055825880bae9af", "size": 8975, "ext": "cc", "lang": "C++", "max_stars_repo_path": "common/util.cc", "max_stars_repo_name": "liucxer/ceph-msg", "max_stars_repo_head_hexsha": "2e5c18c0c72253b283bfd3d0576033c0b515ce55", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_count": nul...
import numpy as np import networkx as nx from tqdm import tqdm from numpy.linalg import inv from sklearn.decomposition import TruncatedSVD class BANE(object): """ Binarized Attributed Network Embedding Class (ICDM 2018). """ r"""An implementation of `"BANE" <https://arxiv.org/abs/1403.6652>`_ from ...
{"hexsha": "1e8e8aa92ef0e474d6cd5214d63750cd1bf77e4d", "size": 3955, "ext": "py", "lang": "Python", "max_stars_repo_path": "karateclub/node_embedding/attributed/bane.py", "max_stars_repo_name": "Laeyoung/ainized-karateclub", "max_stars_repo_head_hexsha": "26d8e10d9cb15a7ae6bf43db6ec338a6ae4f9aa0", "max_stars_repo_licen...
import pickle import numpy as np import matplotlib.pyplot as plt cumulative_rewards = pickle.load(open('cum_rewards_history-12.pkl', 'rb')) epsilons = pickle.load(open('epsilon_history-12.pkl', 'rb')) # Set general font size plt.rcParams['font.size'] = '24' ax = plt.subplot(211) plt.title("Cumulative Rewards over E...
{"hexsha": "704f55e74a79f652ec4729e05812129ec5c77041", "size": 755, "ext": "py", "lang": "Python", "max_stars_repo_path": "simulation/dqn-simulation/final/visualizer.py", "max_stars_repo_name": "pgabriela/dqn-jitsi-autoscaler", "max_stars_repo_head_hexsha": "b39eb335e584095ef66a9941dbe0b2ea21a02d4a", "max_stars_repo_li...
#================================ # RESEARCH GROUP PROJECT [RGP] #================================ # This file is part of the COMP3096 Research Group Project. # System import logging # Gym Imports import gym from gym.spaces import Box, Discrete, Tuple # PySC2 Imports from pysc2.lib.actions import FUNCTIONS, Function...
{"hexsha": "72a1ba23557b588ec99e22b25ee684eded2010a2", "size": 3929, "ext": "py", "lang": "Python", "max_stars_repo_path": "sc2g/sc2g/env/movement/multi_movement_directed.py", "max_stars_repo_name": "kiriphorito/COMP3096---MARL", "max_stars_repo_head_hexsha": "5e05413b0980d60f4a3f2a17123178c93bb0b763", "max_stars_repo_...
# helpers to calc features / cols importance import matplotlib.pyplot as plt import numpy as np def collapse_values(importance, features): """collapse cols w/ values (A_A, A_B, A_C for example into just A w/ sum(A_weights))""" assert len(importance) == len(features) assert abs(sum(importance) - 1) < 1e-1...
{"hexsha": "04ea84827feff513f1aacb388e05b3a23712457b", "size": 2361, "ext": "py", "lang": "Python", "max_stars_repo_path": "util_cols_importance.py", "max_stars_repo_name": "pbogomolov1967/ml_features_importance", "max_stars_repo_head_hexsha": "b3b60de2810bf6660a583bec24635593afb12507", "max_stars_repo_licenses": ["Apa...
[STATEMENT] lemma set_zip_tr[simp]: "(s, s') \<in> set (zip ss (tr_ss_f T ss)) \<longrightarrow> s' = tr_s_f T s" [PROOF STATE] proof (prove) goal (1 subgoal): 1. (s, s') \<in> set (zip ss (tr_ss_f T ss)) \<longrightarrow> s' = tr_s_f T s [PROOF STEP] by (induct ss, auto)
{"llama_tokens": 124, "file": "LightweightJava_Lightweight_Java_Equivalence", "length": 1}
import numpy as np from rl687.environments.gridworld import Gridworld import matplotlib.pyplot as plt import time def problemA(): """ Have the agent uniformly randomly select actions. Run 10,000 episodes. Report the mean, standard deviation, maximum, and minimum of the observed discounted returns. ...
{"hexsha": "4964ec04144fb812fb44dff61db3fa95c8b4b426", "size": 4757, "ext": "py", "lang": "Python", "max_stars_repo_path": "homeworks/homework1.py", "max_stars_repo_name": "anshuman1811/cs687-reinforcementlearning", "max_stars_repo_head_hexsha": "cf30cc0ab2b0e515cd4b643fc55c60cc5f38a481", "max_stars_repo_licenses": ["M...
from __future__ import annotations """A module containing the core class to specify a Factor Graph.""" import collections import copy import functools import inspect import typing from dataclasses import asdict, dataclass from types import MappingProxyType from typing import ( Any, Callable, Dict, Fro...
{"hexsha": "c0b4f0960ae7b8b4173a8fb52f73303a0c3e3b30", "size": 41946, "ext": "py", "lang": "Python", "max_stars_repo_path": "pgmax/fg/graph.py", "max_stars_repo_name": "StannisZhou/PGMax", "max_stars_repo_head_hexsha": "58fbe9516342eb79eee7a12c99ba84bb91d97520", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu...
import streamlit as st # Import libraries | Standard import numpy as np import pandas as pd pd.set_option('display.max_columns', None) import os import datetime import warnings warnings.filterwarnings("ignore") # ignoring annoying warnings from time import time from rich.progress import track # Import ...
{"hexsha": "726b3a2a6aa1363a1c1c76f05594a0960db6280c", "size": 14570, "ext": "py", "lang": "Python", "max_stars_repo_path": "case/solution-1/data_eda_with_streamlit_app.py", "max_stars_repo_name": "7125messi/streamlit-web-ml", "max_stars_repo_head_hexsha": "903d528e561d045d5f6c1dabdb0b78b28e32191c", "max_stars_repo_lic...
subroutine my_sub(input_file) implicit none character(len=*), intent(in) :: input_file logical :: is_file inquire(file=input_file, exist=is_file) if (is_file.EQV..TRUE.) then write(*,'(A)') "Input file: '"//trim(input_file)//"'" else write(*,'(A)') "Input file: '"//trim(input_fi...
{"hexsha": "30882ecd9b92730a62e84acc4789da4dc15217ed", "size": 731, "ext": "f03", "lang": "FORTRAN", "max_stars_repo_path": "src/template.f03", "max_stars_repo_name": "nathanielng/code-templates", "max_stars_repo_head_hexsha": "cb2aae1ec4462aaccdb313b8cd574ed57c685aa2", "max_stars_repo_licenses": ["Apache-2.0"], "max_s...
from __future__ import absolute_import, division, print_function, unicode_literals import functools import numpy as np import pandas as pd import tensorflow as tf from tensorflow import keras import matplotlib.pyplot as plt import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' fashion_mnist = keras.datasets.fashion_mni...
{"hexsha": "c226f4067199a303cefc23907f26a5707926e2ea", "size": 2281, "ext": "py", "lang": "Python", "max_stars_repo_path": "k_nearest_neighbors.py", "max_stars_repo_name": "NikPyth/KNN", "max_stars_repo_head_hexsha": "62c04b30fb24f135193d22986587a93b31acd212", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null...
[STATEMENT] lemma support_upd[simp]: "support z A (f(x := z)) = support z A f - {x}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. support z A (f(x := z)) = support z A f - {x} [PROOF STEP] unfolding support_def [PROOF STATE] proof (prove) goal (1 subgoal): 1. {xa \<in> A. (f(x := z)) xa \<noteq> z} = {x \<in> A. ...
{"llama_tokens": 168, "file": null, "length": 2}
import numpy as np import support from algorithm.algabc import GSA, Options from problem.testfunc import TestFunction # TODO: добавить воздможность выбора метода останова (по умолчанию - итерации) среднеквадратичное откл от лучшей точки class GSAOptions(Options): _alias_map = { 'g_idx': ['gi', 'g_index']...
{"hexsha": "2da003991e941459fde1ad4e6629475d2d1b85f0", "size": 8890, "ext": "py", "lang": "Python", "max_stars_repo_path": "algorithm/gsa.py", "max_stars_repo_name": "redb0/gotpy", "max_stars_repo_head_hexsha": "b3f2e12aff429e0bff0faa079a3694378293c974", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_count": 3...
# -*- coding: latin-1 -*- from __future__ import division import ast import numpy as np from PyQt4 import QtGui from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure from functools import partial import banco.bd_sensores as bd_sensores import banco.bd_perf...
{"hexsha": "1f2406ab16fccfcd77b52639ecfc1ad6a39f4804", "size": 9936, "ext": "py", "lang": "Python", "max_stars_repo_path": "source/graficos.py", "max_stars_repo_name": "Atzingen/controleForno-interface", "max_stars_repo_head_hexsha": "6a8968527f8b76c7d0c7ea26f8c8aca728fe4d2d", "max_stars_repo_licenses": ["MIT"], "max_s...
import cv2 import time import argparse import numpy as np def blur_face(image, face_detector): """ Runs the face detector, extracts face regions and blurs them Args: image: Input image or video frame face_detector: Path to the face haarcascade file Returns: The processed image with face blurred """ ...
{"hexsha": "d3f09b4c01847d61df4ada2940f948ae2b57f5f3", "size": 2533, "ext": "py", "lang": "Python", "max_stars_repo_path": "face_blur.py", "max_stars_repo_name": "GSNCodes/Blur-Face", "max_stars_repo_head_hexsha": "63134c4e63052da464331a725c685422c1c633be", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
// test/wwwc/css_syntax/parsing.cpp #include <boost/test/unit_test.hpp> #include <wordring/wwwc/css_syntax/parsing.hpp> #include <wordring/wwwc/selectors/grammar.hpp> #include <algorithm> #include <any> #include <iterator> #include <string> #include <typeindex> #include <vector> namespace { inline std::u32string...
{"hexsha": "1ccff2762e65369835cbef86aac440ecbdd47620", "size": 27588, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "test/wwwc/css_syntax/parsing.cpp", "max_stars_repo_name": "wordring/wordring", "max_stars_repo_head_hexsha": "e2c9c2ed66010537efd78694521312c5b63f0510", "max_stars_repo_licenses": ["Unlicense"], "m...
// Copyright 2020, Beeri 15. All rights reserved. // Author: Roman Gershman (romange@gmail.com) // #include "util/uring/http_handler.h" #include <boost/beast/core.hpp> // for flat_buffer. #include <boost/beast/http.hpp> #include "base/logging.h" namespace util { using namespace http; using namespace std; using na...
{"hexsha": "e8058c24a2cb2c7ce057b47e9e08d36537a53280", "size": 3796, "ext": "cc", "lang": "C++", "max_stars_repo_path": "util/uring/http_handler.cc", "max_stars_repo_name": "ekatz-quotient/gaia", "max_stars_repo_head_hexsha": "63305f443416deccf96fd8ec2fb60bcb560e232b", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_...
""" .. Copyright (c) 2014-2017, Magni developers. All rights reserved. See LICENSE.rst for further information. Module providing utilities for control of plotting using `matplotlib`. The module has a number of public attributes which provide settings for colormap cycles, linestyle cycles, and marker cycle...
{"hexsha": "c4f23e73523d15d6fb896f9510f070e11dd67e63", "size": 9480, "ext": "py", "lang": "Python", "max_stars_repo_path": "magni/utils/plotting.py", "max_stars_repo_name": "SIP-AAU/Magni", "max_stars_repo_head_hexsha": "6328dc98a273506f433af52e6bd394754a844550", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_...
import numpy as np AGGREGATE_MAP = { 'mean': np.mean, 'min': np.min, 'median': np.median, 'max': np.max, }
{"hexsha": "b2600b1f17ce40988a6f406209f5ebd2c1205d89", "size": 124, "ext": "py", "lang": "Python", "max_stars_repo_path": "summarizer/util.py", "max_stars_repo_name": "stungkit/bert-extractive-summarizer", "max_stars_repo_head_hexsha": "84f27333aef33629444589c24933b76448777d4f", "max_stars_repo_licenses": ["MIT"], "max...
@testset "Test time series data application" begin sys = PSB.build_system(PSB.PSITestSystems, "c_sys5") pmi_data = PMI.get_pm_data(sys) mn_data = PMI.apply_time_series(pmi_data, sys, last(PSY.get_forecast_initial_times(sys)), 3:5) @test mn_data["multinetwork"] @test length(mn_data["nw"]) ...
{"hexsha": "33e4b6ff9f2b80b6781c2d1297f27186a70ea5aa", "size": 862, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/test_apply_time_series.jl", "max_stars_repo_name": "NREL-SIIP/PowerModelsInterface", "max_stars_repo_head_hexsha": "b4b589db5e276d71973ba169db29437fb9b5cb14", "max_stars_repo_licenses": ["BSD-3...
import streamlit as st import pandas as pd from pyvis.network import Network import networkx as nx import matplotlib.pyplot as plt import bz2 import pickle import _pickle as cPickle # Load any compressed pickle file def decompress_pickle(file): data = bz2.BZ2File(file, 'rb') data = cPickle.load(data) return data ...
{"hexsha": "69e9b6ac19b84d4d1032896ae0625c658ace113a", "size": 4779, "ext": "py", "lang": "Python", "max_stars_repo_path": "streamlit/Autodidact/myapp_old.py", "max_stars_repo_name": "rts1988/IntelligentTutoringSystem_Experiments", "max_stars_repo_head_hexsha": "b2f797a5bfff18fb37c7a779a19a72a75db7eeef", "max_stars_rep...
import numpy as np from PIL import Image import matplotlib.pyplot as plt from wordcloud import WordCloud, STOPWORDS # Load a text file as a string. with open('hound.txt') as infile: text = infile.read() # Load an image as a NumPy array. mask = np.array(Image.open('holmes.png')) # Get stop words as a set and add ...
{"hexsha": "0c013e5790891e8d52ad2a6bd2d348ade5bf44be", "size": 1512, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter_3/wc_hound.py", "max_stars_repo_name": "Soccertanker/Real_World_Python", "max_stars_repo_head_hexsha": "5a0671ec11e5b5522c8ee4683bac880b92d8ac12", "max_stars_repo_licenses": ["FTL"], "max_...
# -*- coding: utf-8 -*- """ Created on Tue Jul 18 11:49:51 2017 @author: Jalen Morgan, Taylor Paskett """ import numpy as np import sympy from stablab.finite_difference_code import pde from sympy import Matrix from stablab.finite_difference_code import approximate """Used for both pdes and odes""" def ...
{"hexsha": "b626a8ffbd0ec12f9200254a44e603ed3984a212", "size": 12004, "ext": "py", "lang": "Python", "max_stars_repo_path": "stablab/finite_difference.py", "max_stars_repo_name": "nonlinear-waves/stablab_python", "max_stars_repo_head_hexsha": "101724f8bcefc34e90cf70d0813919188e08cb8a", "max_stars_repo_licenses": ["MIT"...
# -*- coding: utf-8 -*- from math import exp, factorial import numpy as np from numpy.linalg import matrix_power from scipy.stats import poisson from scipy.linalg import norm, null_space, solve, solve_sylvester, expm, inv import matplotlib.pyplot as plt import sys, warnings from tqdm import tqdm ''' ̄W comb...
{"hexsha": "042b6c618e166c57fe87055bb5450f3bd936d13d", "size": 12472, "ext": "py", "lang": "Python", "max_stars_repo_path": "queue-def.py", "max_stars_repo_name": "Gravifer/queue-sdp", "max_stars_repo_head_hexsha": "0541d2460e4cfd7a75d3578378d19cb0926bfbfe", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, ...
# -*- coding: utf-8 -*- from __future__ import print_function # identifying str and unicode on Python 2, or str on Python 3 from six import string_types, text_type import os, sys import time from abc import ABCMeta, abstractmethod import re import itertools import glob import csv from text_unidecode import unidecode ...
{"hexsha": "99fbaeca5bffcdbb792214eb480fa143ad07c827", "size": 131423, "ext": "py", "lang": "Python", "max_stars_repo_path": "femlAlgorithms.py", "max_stars_repo_name": "athenarc/ToponymPairClassification", "max_stars_repo_head_hexsha": "41dd487ad5f9ba4c0f60342d1af0a1c56c3e4136", "max_stars_repo_licenses": ["MIT"], "ma...
context("Immutable") # Create smaller subset of baseball data (for speed) bsmall <- subset(baseball, id %in% sample(unique(baseball$id), 20))[, 1:5] bsmall$id <- factor(bsmall$id) bsmall <- bsmall[sample(rownames(bsmall)), ] rownames(bsmall) <- NULL test_that("idf is immutable", { #Since idf are constructed by scr...
{"hexsha": "176338a30edc07c2dadb6593018157b22815a3d1", "size": 2191, "ext": "r", "lang": "R", "max_stars_repo_path": "source/gdaexperience6/plyr/tests/testthat/test-idf.r", "max_stars_repo_name": "lalaithan/developer-immersion-data", "max_stars_repo_head_hexsha": "b48d291ad5a03d56c0228d00e0b290b638d50194", "max_stars_r...
from typing import Any, Callable, Dict, List, Optional, Tuple import configparser import logging import os # from packaging.version import parse, Version import torch from catalyst.tools.frozen_class import FrozenClass logger = logging.getLogger(__name__) IS_CUDA_AVAILABLE = torch.cuda.is_available() NUM_CUDA_DEVIC...
{"hexsha": "078340ff999026914d1535eabf04e34cb8752000", "size": 17426, "ext": "py", "lang": "Python", "max_stars_repo_path": "catalyst/settings.py", "max_stars_repo_name": "stjordanis/catalyst-1", "max_stars_repo_head_hexsha": "93eedf0b9520bf1f83f63b13d6818df2a1e85b33", "max_stars_repo_licenses": ["Apache-2.0"], "max_st...
module TwoDGridWorldUtils using SparseArrays using Distributions import ..TMazeCumulantSchedules import ..ContGridWorldParams import ..ContGridWorld import ..Learner import ..check_goal import ..range_check import ..get_action_probs import ..GVFHordes import ..update import ..Curiosity import ..GVFSRHordes import ..S...
{"hexsha": "b912089d2940bc1ea0ce8b49ed73d6989e6f1ecd", "size": 12956, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/utils/2d-gridworld.jl", "max_stars_repo_name": "MatthewMcLeod/curiosity", "max_stars_repo_head_hexsha": "7b452cb296c36a2e7b2f01763177c097bae8011c", "max_stars_repo_licenses": ["MIT"], "max_sta...
class DataAveraging: @staticmethod def add_sensor_data_to_total(sensor_data, previous_total): new_total = previous_total for i in range(0,len(sensor_data)): data_point = sensor_data[i] if type(data_point) == int or type(data_point) == float: new_total[i] ...
{"hexsha": "d1b1a658f60e42e0c81c15d0dfb3c3fd161f1c9f", "size": 4634, "ext": "py", "lang": "Python", "max_stars_repo_path": "house_code/main_programs/PSUPozyx/modules/data_averaging.py", "max_stars_repo_name": "mukobi/Pozyx-Gabe", "max_stars_repo_head_hexsha": "a8b444c2013b1df5043cd25106b72562409b5130", "max_stars_repo_...
from scipy.sparse import csr_matrix, coo_matrix, diags from scipy.sparse import isspmatrix import random class WordSaladMatrixBuilder(): """Aids in the construction of a WordSaladMatrix. The WordSaladMatrix object has some finicky requirements and this object helps construct one in a reasonably efficient ...
{"hexsha": "5177f3b273ed335088934e0af031e3e6d9383613", "size": 8170, "ext": "py", "lang": "Python", "max_stars_repo_path": "markovchaintest.py", "max_stars_repo_name": "skurmedel/wordsalad", "max_stars_repo_head_hexsha": "5feaf29bf8b9c88624b783cd087a6589ea0ab48a", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ...
# Export DynamicLinks API export DynamicLinks, getindex, endof, length, start, next, done, eltype, handle, header # Export Dynamic Link API export DynamicLink, DynamicLinks, handle, path # Export RPath API export RPath, handle, rpaths, canonical_rpaths, find_library """ ...
{"hexsha": "950155fe8d24e55163a292250a6d59621e505ffc", "size": 4425, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Abstract/DynamicLink.jl", "max_stars_repo_name": "Keno/ObjectFile.jl", "max_stars_repo_head_hexsha": "98d7b327448456df024ab87243520f972c715e16", "max_stars_repo_licenses": ["MIT"], "max_stars_c...
\lab{Object-Oriented Programming}{Object Oriented Programming} \label{lab:OOP} \objective{Teach object-oriented programming in Python.} \section*{Introduction} Writing readable code is an important skill for computer programmers. Well-written code is easy to understand and modify. An important part of readable code i...
{"hexsha": "1c6c36fda53e6290a3ed336685f077f2ddcb1d23", "size": 14721, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Python/OOP/ObjectOriented.tex", "max_stars_repo_name": "jessicaleete/numerical_computing", "max_stars_repo_head_hexsha": "cc71f51f35ca74d00e617af3d1a0223e19fb9a68", "max_stars_repo_licenses": ["CC-...
import faiss import random import os import torch import numpy as np import torch.nn.functional as F from tqdm.auto import tqdm from torch.utils.data import DataLoader, TensorDataset, SequentialSampler from datasets import load_from_disk from transformers import AdamW, get_linear_schedule_with_warmup class DenseRetr...
{"hexsha": "dc4b231d162f705a1f11a66d69c0a6e40cc2bbc5", "size": 11191, "ext": "py", "lang": "Python", "max_stars_repo_path": "deprecated/dpr/code/dense_retrieval.py", "max_stars_repo_name": "eunaoeh/mrc-level2-nlp-01", "max_stars_repo_head_hexsha": "caa893ca7d689200b3528377901d59fa9ca452ac", "max_stars_repo_licenses": [...
\documentclass[a4paper,10pt]{article} \usepackage[utf8]{inputenc} \usepackage[margin=1in]{geometry} \usepackage{graphicx} \usepackage{listings} \usepackage{hyperref} \begin{document} \begin{titlepage} \begin{center} \vspace*{1cm} \huge{\textbf{Music Genre Classification}} \vspace{0.5cm} CS725 Project \vspace{3.5cm...
{"hexsha": "89fa80bf5674f66cab58161bae938280a5e2419d", "size": 2800, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Project Proposal/Music Genre Classification.tex", "max_stars_repo_name": "anshulgupta0803/ipl-match-prediction", "max_stars_repo_head_hexsha": "955cf539b307c1a2b0d93f6dfc7036f379902678", "max_stars_...
"""Tests for writers.record.""" import numpy as np import tensorflow as tf import pytest import deepr as dpr @pytest.mark.parametrize("shape", [[1], [2], [2, 3], [None, 3], [2, 3, 4], [None, 3, 4]]) @pytest.mark.parametrize("dtype", [tf.int64, tf.float32]) @pytest.mark.parametrize("chunk_size", [None, 2]) def test_...
{"hexsha": "b9f2ea2ffe8c4b176390b015e564ee938e8d13f0", "size": 1485, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/unit/writers/test_writers_record.py", "max_stars_repo_name": "drohde/deepr", "max_stars_repo_head_hexsha": "672772ea3ce9cf391f9f8efc7ae9c9d438957817", "max_stars_repo_licenses": ["Apache-2.0...
[STATEMENT] lemma merge_eq: "xs\<noteq>[] \<or> ys\<noteq>[] \<Longrightarrow> merge xs ys = ( if ys=[] \<or> (xs\<noteq>[] \<and> hd xs < hd ys) then hd xs # merge (tl xs) ys else hd ys # merge xs (tl ys) )" [PROOF STATE] proof (prove) goal (1 subgoal): 1. xs \<noteq> [] \<or> ys \<noteq> [] \<Longrightarrow> m...
{"llama_tokens": 215, "file": "IMP2_doc_Examples", "length": 1}
\SecDef{minimal}{Minimal and Maximal Zero-Sum Sets} In this section we study zero-sum sets of particular rank $n$ and prove results on their existence. We are particularly interested in the smallest of such sets, defined in the following sense. \begin{definition} We denote by $\minzs{n}{d}$ the minimum number $m \in \...
{"hexsha": "6cf1fc677cc55b968b28d956350edbe4bbf6c99f", "size": 27122, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "thesis-source/9niLinear/4minimal.tex", "max_stars_repo_name": "hellman/thesis", "max_stars_repo_head_hexsha": "6ba1c2b241e63c07cf76108481c1b67f21a50f12", "max_stars_repo_licenses": ["MIT"], "max_st...
#ifndef BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_VERSION_HPP_20100608 #define BOOST_NETWORK_PROTOCOL_HTTP_MESSAGE_MODIFIERS_VERSION_HPP_20100608 // Copyright 2010 (c) Dean Michael Berris // Copyright 2010 (c) Sinefunc, Inc. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LI...
{"hexsha": "bb16abb0129c076f6bcf765de6ae563b9892f3ef", "size": 1302, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "boost/network/protocol/http/message/modifiers/version.hpp", "max_stars_repo_name": "yhager/cpp-netlib", "max_stars_repo_head_hexsha": "540ed7622be3f9534709036522f86bde1e84829f", "max_stars_repo_lice...
function gauss_quadrature(y::Array{<:Number},GLweights::AbstractArray{<:Real,1}) # Assume that y is evaluated at the zeros # I = Σ wi*y(zi) where zi are the roots of Pl of the appropriate order return squeeze(sum(GLweights.*y,1),1) :: Array{<:Number} end function clenshaw_curtis_quadrature(y::Array{<:Real})::Array{...
{"hexsha": "45970cc45c30e90663af764aeba2c086ba02f0af", "size": 4672, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/periodic_integrals.jl", "max_stars_repo_name": "jishnub/NumericallyIntegrateArrays.jl", "max_stars_repo_head_hexsha": "96d11436753909b8d0c992055cb1696503b92b24", "max_stars_repo_licenses": ["MI...
# -*- coding: UTF-8 -*- import cv2 import numpy as np import matplotlib.pyplot as plt # 颜色变换(色调,明暗,直方图和Gamma曲线) def img_color(imgPath): original_img = cv2.imread(imgPath) img = cv2.resize(original_img,None,fx=0.8,fy=0.8, interpolation=cv2.INTER_AREA) # 图像缩小 Make_border_im...
{"hexsha": "6f18e52a0d0215bcebedd70876bcae19b7964808", "size": 2161, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python-opencv/001-base/test_004_change_color.py", "max_stars_repo_name": "bjlhx15/python-algorithm", "max_stars_repo_head_hexsha": "bbd162e194359a01806922d73b709fe64fcfa422", "max_stars_repo_l...
""" Class to manage building, loading, and saving features for an action recognition CNN over the NTURGB dataset Features Implemented -------------------- - 3D voxel flow - 3D image as voxel grid """ import sys, os import numpy as np from ntu_rgb import NTU from sysu_dataset import SYSU from tqdm import tqdm, trang...
{"hexsha": "c73366d5a1ea9b216f335a781eda6d2c320685c0", "size": 4517, "ext": "py", "lang": "Python", "max_stars_repo_path": "feature_manager.py", "max_stars_repo_name": "mpeven/ntu_rgb", "max_stars_repo_head_hexsha": "4a8b43c521500907d2f241e4b440381cf8c62350", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 19, "...
#!/usr/bin/python # -*- coding:utf-8 -*- # @author : East # @time : 2019/7/14 18:03 # @file : 02.2d_laplace.py # @project : fempy # software : PyCharm import numpy as np import matplotlib.pyplot as plt from fempy.mesh import Mesh2D from fempy.fem2d import FEM2D from fempy.femplot.plot2d import tri_mesh, tri_tri...
{"hexsha": "58ccf255a3fd7c4ef454db9e7e8ae67a6f364a14", "size": 5067, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/02.2d_laplace/02.2d_laplace.py", "max_stars_repo_name": "EastMagica/fempy", "max_stars_repo_head_hexsha": "5f16fe458a63ede5a49925a691924fbbbea767ec", "max_stars_repo_licenses": ["MIT"], "...
import sys # insert at 1, 0 is the script path (or '' in REPL) sys.path.insert(1, '/home/austin/Github/natural-selection-simulator/lib/') from pylive.pylive import live_plotter import numpy as np size = 100 x_vec = np.linspace(0,1,size+1)[0:-1] y_vec = np.random.randn(len(x_vec)) line1 = [] while True: rand_val = ...
{"hexsha": "b16b485f47bb21c3d1b7d40016bfd1044175d024", "size": 444, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/pylive_test.py", "max_stars_repo_name": "austinmdillow/natural-selection-simulator", "max_stars_repo_head_hexsha": "01c7d3ba310a3629a04f1a7e67c04a1b87ee4f09", "max_stars_repo_licenses": ["MIT...
import os import pandas as pd import numpy as np import matplotlib.pyplot as plt import seaborn as sns # Method to merge all .csv files into one, so we can enter all data def merge_data(): data = [files for files in os.listdir(os.path.join('..', '..', 'data','raw')) if files.endswith('.csv')] dataFrames = [] fo...
{"hexsha": "8ec07d175cf607d7cd81be96dd888cb4eaa5f5f0", "size": 2400, "ext": "py", "lang": "Python", "max_stars_repo_path": "analysis/scripts/project_functions.py", "max_stars_repo_name": "data301-2020-winter2/course-project-group_1007", "max_stars_repo_head_hexsha": "3918515b3f6622d732d10cfae7d0c7bc30a2b449", "max_star...
import matplotlib.pyplot as plt import numpy as np def MB_speed(v, m, T): """ :param v: velocidades das moléculas :param m: massa da molécula estudada :param T: temperatura da atmosfera :return: função de densidade de probabilidade Calcula a distribuição de velocidades para um gás ideal co...
{"hexsha": "5d0d85a593e2df880376a4f35024ad2311982560", "size": 1288, "ext": "py", "lang": "Python", "max_stars_repo_path": "dist-Maxwell-Boltzmann.py", "max_stars_repo_name": "Gabriel-Scheffel/dist-vel-Maxwell-Boltsmann", "max_stars_repo_head_hexsha": "6e45e255c79c7b8aa745e7330ebf5e226a1bc1fa", "max_stars_repo_licenses...
# Copyright 2019 The Cirq Developers # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
{"hexsha": "ba26fd8bf682a846ba26effcd170c57fb911a27c", "size": 4203, "ext": "py", "lang": "Python", "max_stars_repo_path": "cirq/ops/linear_combinations.py", "max_stars_repo_name": "rickyHong/Quantum-cirq-repl", "max_stars_repo_head_hexsha": "fca994bb8184be96354c0c4bc64dbcad6df517f1", "max_stars_repo_licenses": ["Apach...
""" Structure featurizers generating a matrix for each structure. Most matrix structure featurizers contain the ability to flatten matrices to be dataframe-friendly. """ import numpy as np import scipy.constants as const from sklearn.exceptions import NotFittedError from pymatgen.core import Structure from pymatgen.co...
{"hexsha": "df49ba793e6d458e21db40b9ccc898c1237e7245", "size": 18794, "ext": "py", "lang": "Python", "max_stars_repo_path": "matminer/featurizers/structure/matrix.py", "max_stars_repo_name": "ncfrey/matminer", "max_stars_repo_head_hexsha": "5a688de8f2c7eaf5109d34d58ab7875cfe980e48", "max_stars_repo_licenses": ["BSD-3-C...
import pickle import librosa import numpy as np from tensorflow import keras class ser: def mfcc(self): file = "./Audios/Dataset/1092_Help_FEA_XX.wav" data, sampling_rate = librosa.load(file) X = [] mfcc_feature = np.mean(librosa.feature.mfcc(y=data, sr=sampling_rate, ...
{"hexsha": "da46238f108dfcfb858d6698dab931a501014d4f", "size": 977, "ext": "py", "lang": "Python", "max_stars_repo_path": "Source Code/Speech Emotion Dection/ser.py", "max_stars_repo_name": "GALI-SAI-SHANKAR/Threat-Alert-AI", "max_stars_repo_head_hexsha": "f50743c23c05684d6e32ff52799dc4cc24dcd98f", "max_stars_repo_lice...
import pickle import glob import numpy as np def print_stats(data): returns = [] path_lengths = [] print("num trajectories", len(data)) for path in data: rewards = path["rewards"] returns.append(np.sum(rewards)) path_lengths.append(len(rewards)) print("returns") print...
{"hexsha": "ce20ffe52de5597a4618268be84969ec69785382", "size": 3393, "ext": "py", "lang": "Python", "max_stars_repo_path": "experiments/ashvin/icml2020/process_data/consolidate.py", "max_stars_repo_name": "Asap7772/railrl_evalsawyer", "max_stars_repo_head_hexsha": "baba8ce634d32a48c7dfe4dc03b123e18e96e0a3", "max_stars_...
#! /usr/bin/env python # # File Name : generate_grid_mrf_model.py # Created By : largelymfs # Creation Date : [2016-01-20 14:42] # Last Modified : [2016-01-20 14:50] # Description : the pyscripts to generate mrf grid model # def output_2d...
{"hexsha": "79cd0f819d43c93f8a9c2e5c308bde2f2f576e0a", "size": 1188, "ext": "py", "lang": "Python", "max_stars_repo_path": "Grid_MRF/generate_grid_mrf_model.py", "max_stars_repo_name": "YoungLew/NoiseContrastiveLearning", "max_stars_repo_head_hexsha": "2abff09651e17af4370319ca63a4c090097f914f", "max_stars_repo_licenses...
# Copyright 2019-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
{"hexsha": "9f600b2cd72d5db5ac46f4312b17f0ad0c1c69fe", "size": 3215, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/common/test_run/ascend/equal_count_run.py", "max_stars_repo_name": "tianjiashuo/akg", "max_stars_repo_head_hexsha": "a9cbf642063fb1086a93e8bc6be6feb145689817", "max_stars_repo_licenses": ["A...
[STATEMENT] lemma is_pseudonatural_equivalence: shows "pseudonatural_equivalence V\<^sub>C H\<^sub>C \<a>\<^sub>C \<i>\<^sub>C src\<^sub>C trg\<^sub>C V\<^sub>D H\<^sub>D \<a>\<^sub>D \<i>\<^sub>D src\<^sub>D trg\<^sub>D F \<Phi>\<^sub>F H \<Phi>\<^sub>H map\<^sub>0 map\<^sub>1" [PROOF STATE] proof (pr...
{"llama_tokens": 261, "file": "Bicategory_PseudonaturalTransformation", "length": 1}
#!/usr/bin/env python import sys import re # plotting import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages net_re = re.compile('^net:.*/train_val_(.*)\.prototxt') model_re1 = re.compile('Finetuning from models/bvlc_reference_...
{"hexsha": "4a93015f558880a2c2ec8fd1a30e572c00ab26ba", "size": 3170, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/bvlc_reference_caffenet/plot_accuracy_sparsity.py", "max_stars_repo_name": "IntelLabs/SkimCaffe", "max_stars_repo_head_hexsha": "27df6a8796a012da722c3e2673739350133c1779", "max_stars_repo_l...
import numpy as np from io import BytesIO from typing import List def bytes2numpy(data: bytes) -> np.ndarray: ''' TODO: Annotation ''' nda_bytes = BytesIO(data) nda = np.load(nda_bytes, allow_pickle=False) return nda def numpy2bytes(data: np.ndarray) -> bytes: ''' TODO: Annotation ...
{"hexsha": "9a636f72c17a81ff647429f88d4cea62389aeaf7", "size": 716, "ext": "py", "lang": "Python", "max_stars_repo_path": "rls/distribute/utils/numpy.py", "max_stars_repo_name": "yisuoyanyudmj/RLs-1", "max_stars_repo_head_hexsha": "a336b57e804507bca23cbadc3b5af1924c80d942", "max_stars_repo_licenses": ["Apache-2.0"], "m...
""" This code is used for plotting annual anomalies of radiative fluxes for the model mean of CMIP5 and CMIP6 models. """ import matplotlib.pyplot as plt import xarray as xr import numpy as np import seaborn as sns import pandas as pd import scipy as sc #=== Import SEB Anomalies ==== #from seasonal_SEB_components im...
{"hexsha": "18ef83c1f753fe7adab926cd75f2860562adb06f", "size": 17854, "ext": "py", "lang": "Python", "max_stars_repo_path": "plot_scripts/SEB_rad_flux_annual.py", "max_stars_repo_name": "idunnam/Thesis", "max_stars_repo_head_hexsha": "a567a25aa037c949de285158804a6ee396fc0e6c", "max_stars_repo_licenses": ["MIT"], "max_s...
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
{"hexsha": "9c5bff552a8ce2f0f9911588c5e77a7b2ea7d1b5", "size": 7447, "ext": "py", "lang": "Python", "max_stars_repo_path": "jax/experimental/compilation_cache/compilation_cache.py", "max_stars_repo_name": "manifest/jax", "max_stars_repo_head_hexsha": "d82341d95f418fe2a03cfe691b21813e4309eff7", "max_stars_repo_licenses"...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Unit tests for finite_diff library """ import unittest import random from math import pi import numpy as np import finitediff class TestFiniteDiff(unittest.TestCase): """Unit test class for the finitediff library""" order = 4 # Order of the derivatives ...
{"hexsha": "a65f39ef854ba9a4bb94c8cf08a568806963b135", "size": 7416, "ext": "py", "lang": "Python", "max_stars_repo_path": "finitediff/unit_tests.py", "max_stars_repo_name": "jolyonb/finitediff", "max_stars_repo_head_hexsha": "fb6d05490fcf8a7a7603e68aec165b9fb931ba3a", "max_stars_repo_licenses": ["MIT"], "max_stars_cou...
import math import torch import torch.nn as nn import torch.nn.functional as F import numpy as np # custom libs import utils import model_funcs as mf class BasicBlockWOutput(nn.Module): expansion = 1 def __init__(self, in_channels, channels, params, stride=1): super(BasicBlockWOutput, self).__init__...
{"hexsha": "2401076cdf2cf6907b78559096b790608881b365", "size": 8996, "ext": "py", "lang": "Python", "max_stars_repo_path": "networks/SDNs/ResNet_SDN.py", "max_stars_repo_name": "Sanghyun-Hong/DeepSloth", "max_stars_repo_head_hexsha": "92b3d0d3ef3f974d8bce7b4b4a1828776227e3c6", "max_stars_repo_licenses": ["MIT"], "max_s...
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # Copyright (c) Megvii, Inc. and its affiliates. import random import cv2 import numpy as np from yolox.utils import adjust_box_anns from ..data_augment import box_candidates, random_perspective from .datasets_wrapper import Dataset class MosaicDetection(Dataset): ...
{"hexsha": "0c9aa6ee46f2c4ca782f44660535fa0de1e29423", "size": 8829, "ext": "py", "lang": "Python", "max_stars_repo_path": "yolox/data/datasets/mosaicdetection.py", "max_stars_repo_name": "vghost2008/YOLOX", "max_stars_repo_head_hexsha": "37b3cba0756907679ff25a4e5cc96eaad3b6f988", "max_stars_repo_licenses": ["Apache-2....
from sklearn.linear_model import LogisticRegression import sklearn from sklearn.model_selection import cross_val_score from scipy.sparse import lil_matrix import numpy as np import json from time import time import sklearn from sklearn.manifold import TSNE import matplotlib.pyplot as plt import random colorset = dict(...
{"hexsha": "7659812b5b963fb7ebf0e41af5ec83822dddbd7d", "size": 2411, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/experiment/network visualization.py", "max_stars_repo_name": "MGitHubL/MNCI", "max_stars_repo_head_hexsha": "6651a59ba30dd8c588aa26580411d8d01571c296", "max_stars_repo_licenses": ["MIT"], "ma...
# -*- coding: utf-8 -*- """ Created on Thu Jan 16 12:12:57 2020 @author: ssterl """ ################################### ######### REVUB core code ######### ################################### # REVUB model © 2019 CIREG project # Author: Sebastian Sterl, Vrije Universiteit Brussel # This code accompanies the paper "T...
{"hexsha": "727975efd0c13eaca12b7ae369e2e5d571d283c7", "size": 133662, "ext": "py", "lang": "Python", "max_stars_repo_path": "code/REVUB_Python_B_Suriname_Sterl_etal_2020.py", "max_stars_repo_name": "VUB-HYDR/2020_Sterl_etal_RSER", "max_stars_repo_head_hexsha": "672adf4f7676cb2e8be77e441a8a407f59930437", "max_stars_rep...
# -*- coding: utf-8 -*- # Author: Daniel Yang <daniel.yj.yang@gmail.com> # # License: BSD 3 clause #from ..datasets import public_dataset from sklearn.naive_bayes import BernoulliNB, MultinomialNB, GaussianNB from sklearn.pipeline import Pipeline from sklearn.feature_extraction.text import CountVectorizer, TfidfTra...
{"hexsha": "4adec05c97f6517f1bad563b0a2f16966d4b9e6f", "size": 33248, "ext": "py", "lang": "Python", "max_stars_repo_path": "machlearn/naive_bayes/_naive_bayes.py", "max_stars_repo_name": "daniel-yj-yang/pyml", "max_stars_repo_head_hexsha": "2328ae1d73eab39f2774331fcfaa10e8fa2fc0de", "max_stars_repo_licenses": ["BSD-3-...
"""decodes and serializes frames from vidoes in a given directory into TFRecord files to improve parallelized I/O and provide prefetching benefits. The program expects the folder containing the videos to have the following structure: -- class_name_1 -- video_1.mp4 -- video_2.mp4 -- cl...
{"hexsha": "8523d8bd49c628a29704d22e2ad03b227939f5a0", "size": 7968, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/create_tfrecords.py", "max_stars_repo_name": "Chianugoogidi/X3D-tf", "max_stars_repo_head_hexsha": "45935c227896b83492b3c923af37d9746ab8a3c0", "max_stars_repo_licenses": ["MIT"], "max_sta...
from .OBJET import OBJET import numpy as np class Objet(object): """OBJET""" def __init__(self, path_to_meta_json, width=500, height=500): self._OBJET = OBJET(path_to_meta_json, width, height) self.width = width self.height = height def draw(self, ): self._OBJET.Draw() ...
{"hexsha": "87ac45215be36e7193a736c3acd7ac26e8d704b8", "size": 1189, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyobjet/objet.py", "max_stars_repo_name": "MahanFathi/Objet", "max_stars_repo_head_hexsha": "c6e2366327852c18b30dbf2f439931860dc26bf9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null,...
abstract type AbstractScheduler end struct StepDecay <: AbstractScheduler xmax xmin Δ T end (d::StepDecay)(t) = max(d.xmin, d.xmax - div(t, d.T) * d.Δ) d = StepDecay(1.0, 0.1, 0.1, 5) plot(1:100, d.(1:100)) struct ExponentialDecay <: AbstractScheduler xmax xmin ρ end (d::ExponentialDe...
{"hexsha": "ecdd89f5d69a4d0178d65283371d3ada85e191ab", "size": 419, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/schedulers.jl", "max_stars_repo_name": "cswaney/Minerva.jl", "max_stars_repo_head_hexsha": "5a925de2d2b483c317efd286eb81aa2d64d9a5a6", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null...
/* Copyright (C) 2012-2019 IBM Corp. * This program is 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 a...
{"hexsha": "590fbbc29a6577b81fa544ca21977aed63372e58", "size": 8862, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/PermNetwork.cpp", "max_stars_repo_name": "patrick-schwarz/HElib", "max_stars_repo_head_hexsha": "cd267e2ddc6e92886b89f3aa51c416d5c1d2dc59", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_...
""" ``` set_regime_val!(p::Parameter{S}, i::Int, v::S; override_bounds::Bool = false) where S <: Real set_regime_val!(p::Parameter{S}, model_regime::Int, v::S, d::AbstractDict{Int, Int}; override_bounds::Bool = false) where S <: Real ``` sets the value in regime `i` of `p` to be `v`. By default, we enforce t...
{"hexsha": "0ecb5c56d7f4636f6278b5067c5270df710260d0", "size": 16984, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/regimes.jl", "max_stars_repo_name": "FRBNY-DSGE/ModelConstructors", "max_stars_repo_head_hexsha": "3c8e6ebbfd3a1c1ed8851bd84e876e595f3a9145", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_...
import os from typing import Tuple, Sequence, Callable import csv import cv2 import numpy as np import pandas as pd from PIL import Image from sklearn.model_selection import KFold import torch import torch.optim as optim from torch import nn, Tensor from torch.nn import functional as F from torch.utils.data import Dat...
{"hexsha": "d76a24d4b71e0652608398790a1c77acbfc07ad0", "size": 7153, "ext": "py", "lang": "Python", "max_stars_repo_path": "kaggle/leaves/tta.py", "max_stars_repo_name": "ioyy900205/PyTorch_mess-around", "max_stars_repo_head_hexsha": "90d255e17158699fd7902f7746b35fa18975112e", "max_stars_repo_licenses": ["MIT"], "max_s...
import logging import re import numpy as np import torch from datasets import Metric, load_metric from transformers import PreTrainedTokenizer __all__ = [ "CodeGenerationEvaluator" ] # From https://github.com/neulab/external-knowledge-codegen/blob/datasets/conala/conala_eval.py#L94 special_chars = re.compile(r'(...
{"hexsha": "3b83d694b4ca68c6c4e7d1e85f86876cb5400d8e", "size": 5410, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/evaluation/seq_to_seq.py", "max_stars_repo_name": "jhk16/stackoverflow-encourages-cheating", "max_stars_repo_head_hexsha": "425fa92e7defc783d34f4bd3366cd96990d3c037", "max_stars_repo_licenses"...
! ! Copyright (c) 2019, NVIDIA CORPORATION. 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 required by app...
{"hexsha": "00657496791229ce8c40efc924cd1d021209d259", "size": 1956, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "indevelopment/module8/English/Fortran/cublas/Solution/main.f90", "max_stars_repo_name": "mozhgan-kch/openacc-training-materials", "max_stars_repo_head_hexsha": "099643c50f41415943035daa64a698db7...
from astropy.table import Table import yaml import os from db_tables import load_connection, open_settings SETTINGS = yaml.load(open(os.path.join(os.environ['HOME'], 'dd_configure.yaml'))) print SETTINGS Session, engine = load_connection(SETTINGS['CONNECTION_STRING'], echo=False) results = engine.execute("""SELECT ...
{"hexsha": "67a2ba11699dd45bcf12448d269edf764d04fc91", "size": 1663, "ext": "py", "lang": "Python", "max_stars_repo_path": "pull.py", "max_stars_repo_name": "justincely/disk_detective_data", "max_stars_repo_head_hexsha": "5e8ceadf5708a525287357f83ca927edd519b0dd", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars...
from xml.dom import minidom import re import numpy as np from BezierCurve import GetBezierPoints as bp import pygame import time import triangulate import stl from stl import mesh import copy import earcut # import geopandas as gpd from shapely.geometry import Polygon import pathlib # read the SVG file file_name = "ne...
{"hexsha": "4c1081c73b13dcd9367e522df99a7efdb5a3283a", "size": 21275, "ext": "py", "lang": "Python", "max_stars_repo_path": "SvgToStl.py", "max_stars_repo_name": "daekwon00/SvgToStl", "max_stars_repo_head_hexsha": "170d81ea689b505dbba9e2293b2dbe0e723da6ea", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "...
import numpy as np import pandas as pd import seaborn as sns from abc import ABC, abstractmethod from matplotlib import pyplot as plt from typing import Generic, TypeVar, List, Union, Dict, Sequence, Optional from ...util.string import ToStringMixin, dictString from ...vector_model import VectorModel # Note: in the 2...
{"hexsha": "48ee2cc91cc5a2948143eea2e7037d786c47e9dc", "size": 8955, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/sensai/evaluation/eval_stats/eval_stats_base.py", "max_stars_repo_name": "schroedk/sensAI", "max_stars_repo_head_hexsha": "a2d6d7c6ab7bed9ccd5eac216dd988c49d69aec7", "max_stars_repo_licenses":...
function [ f,qualMeasOut] = PCSD(proj,geo,angles,maxiter,varargin) %PCSD solves the reconstruction problem using projection-controlled steepest descent method % % PCSD(PROJ,GEO,ALPHA,NITER) solves the reconstruction problem using % the projection data PROJ taken over ALPHA angles, corresponding to the % geometry ...
{"author": "CERN", "repo": "TIGRE", "sha": "8df632662228d1b1c52afd95c90d0f7a9f8dc4b3", "save_path": "github-repos/MATLAB/CERN-TIGRE", "path": "github-repos/MATLAB/CERN-TIGRE/TIGRE-8df632662228d1b1c52afd95c90d0f7a9f8dc4b3/MATLAB/Algorithms/PCSD.m"}
[STATEMENT] lemma start_end_implies_terminating: assumes "has_start_points x" and "has_end_points x" shows "terminating x" [PROOF STATE] proof (prove) goal (1 subgoal): 1. terminating x [PROOF STEP] using assms [PROOF STATE] proof (prove) using this: has_start_points x has_end_points x goal (1 subgoal): ...
{"llama_tokens": 141, "file": "Relational_Paths_Paths", "length": 2}
## testing function (for notebooks e.g.) function __plot_check(dfcart,plotdir,plotfile, showplot=true) cart= DataFrame(X=dfcart.data[1,:], Y=dfcart.data[2,:], Z=dfcart.data[3,:]) println("## check plot subtraction ...") PyPlot.plt.figure(figsize=(9.0,8.0)) PyPlot.plt.subplot(1, 1, 1 , xlim=[-100,100]...
{"hexsha": "8898ddea603d38d60f53559b05a388c7870e4a83", "size": 1032, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/testing.jl", "max_stars_repo_name": "bosscha/gaia-shock", "max_stars_repo_head_hexsha": "61327854c998651e16a9a020a6008439e2217620", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 1, "ma...
import pytest from cfl.density_estimation_methods.condExpMod import CondExpMod import tensorflow as tf # tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) import visual_bars.generate_visual_bars_data as vbd from cfl.dataset import Dataset import os import numpy as np ############################### SETUP...
{"hexsha": "b494882e0a6c6e7c4f37f9834831d3cbf83f95b9", "size": 7156, "ext": "py", "lang": "Python", "max_stars_repo_path": "testing/test_condExpBase.py", "max_stars_repo_name": "eberharf/cfl", "max_stars_repo_head_hexsha": "077b99a05824f1371ac47d76dfed6bb160222668", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_sta...
import numpy as np from deformations.utility.mesh3d import mesh3d from deformations.utility.bernstein import get_bernstein_polynomial def get_min_max(x, *args, **kwargs): return np.min(x, *args, **kwargs), np.max(x, *args, **kwargs) def stu_to_xyz(stu_points, stu_origin, stu_axes): return stu_origin + s...
{"hexsha": "fd4624f972eff8e01efaf0e95613b6060436638e", "size": 2393, "ext": "py", "lang": "Python", "max_stars_repo_path": "implementation/deformations/utility/deform.py", "max_stars_repo_name": "saurabbhsp/mesh-3d-reconstruction", "max_stars_repo_head_hexsha": "c52312bce7e3121643189f6b67192ffe28b08565", "max_stars_rep...
import Data.Vect -- Exercise 1 myPlusCommutes : (n : Nat) -> (m : Nat) -> n + m = m + n myPlusCommutes Z m = rewrite plusZeroRightNeutral m in Refl myPlusCommutes (S k) m = rewrite myPlusCommutes k m in rewrite plusSuccRightSucc m k in Refl -- Exercise 2 reverseProof_nil : (acc : Vect n1 a) ...
{"hexsha": "9926e25b80dc673445dabbadb28dddda0f881ae9", "size": 778, "ext": "idr", "lang": "Idris", "max_stars_repo_path": "TypeDrivenDevelopment/Chapter08/Exercises/ex_8_2.idr", "max_stars_repo_name": "lambdaxymox/type-driven-development-with-idris", "max_stars_repo_head_hexsha": "e5e55715cd7418f3e6fab8e5658d7518da3fdc...