text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
import multiprocessing as mp
import os
import shutil
import cairo
import numpy as np
import tqdm
CUR_DIR = os.path.join(os.path.dirname(__file__))
OUTPUT_DIR = os.path.join(CUR_DIR, 'output')
WIDTH = 1920 * 2
HEIGHT = 1080 * 2
FPS = 60
# The dtype can be changed to use a different level precision for
# calculating ... | {"hexsha": "58216ab442dfb965a8a11597b32d826e77756d91", "size": 7600, "ext": "py", "lang": "Python", "max_stars_repo_path": "generate_frames.py", "max_stars_repo_name": "elliotwaite/times-table-animation", "max_stars_repo_head_hexsha": "4bff8521bae7314a0dd2189eee6518e87cf2a9b6", "max_stars_repo_licenses": ["MIT"], "max_... |
#include "potgen.hpp"
#include "vector.hpp"
#include "interpolation.hpp"
#include "fileIO.hpp"
#include "correlation.hpp"
#include "config.h"
#include <fstream>
#define BOOST_TEST_MODULE potgen_test
#include <boost/test/unit_test.hpp>
// declaration of compare function
/// \todo define some kind of test utility head... | {"hexsha": "1ffd01c122e13bd3b7e9a0b6f590fce4eb7af434", "size": 4293, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "src/potgen/test/potgen_test.cpp", "max_stars_repo_name": "ngc92/branchedflowsim", "max_stars_repo_head_hexsha": "d38c0e7f892d07d0abd9b63d30570c41b3b83b34", "max_stars_repo_licenses": ["MIT"], "max_s... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Author: J.A. de Jong - ASCEE
Description:
Class for plotting bars on a QGraphicsScene.
"""
from ..lasp_gui_tools import ASCEEColors, Branding
from PySide.QtGui import (
QGraphicsScene, QPen, QBrush, QGraphicsRectItem,
QGraphicsTextItem, QPainter, QImage, QPr... | {"hexsha": "29cc216d3e9e58e92fc4a2c63c6c5e774fce33b8", "size": 11948, "ext": "py", "lang": "Python", "max_stars_repo_path": "lasp/plot/bar.py", "max_stars_repo_name": "asceenl/lasp", "max_stars_repo_head_hexsha": "7cc77b073a91eb7470b449604544d9f57faf32e9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# __author__ : stray_camel
# __description__ : DIEN论文复现
# __date__: 2020/09/15 16
import csv
import io
import os
import pickle
import random
from concurrent.futures import (ALL_COMPLETED, ThreadPoolExecutor,
as_completed, wait)
import numpy as n... | {"hexsha": "6ef798e1cd3de53e38c44955986be0f86ac81d37", "size": 7874, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/models_tensorflow2/DIN_CTR/handler.py", "max_stars_repo_name": "Freen247/dj_blog", "max_stars_repo_head_hexsha": "f7df1a7b101d41835a334b78cddf3570968799e4", "max_stars_repo_licenses": ["Apach... |
#Load app and configuration
# create config variables (to be cleaned in the future)
from flasky import db
from flask_login import login_required, current_user
from config import config as config_set
from app.models import User
config=config_set['tinymrp'].__dict__
folderout=config['FOLDEROUT']
fileser... | {"hexsha": "01e784ed1695ad2df6634e0e001743acb8a3a8af", "size": 86585, "ext": "py", "lang": "Python", "max_stars_repo_path": "app/tinylib/models.py", "max_stars_repo_name": "pzetairoi/TinyMRP", "max_stars_repo_head_hexsha": "2d113a7ebc747d5a9cf082b4c6fad2ddb6b59ba8", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#! /usr/bin/env python2
import roslib
import sys
import rospy
import cv2
import numpy as np
from sensor_msgs.msg import Image
from rospy_tutorials.msg import Floats
from rospy.numpy_msg import numpy_msg
from cv_bridge import CvBridge, CvBridgeError
colors = []
class threshold_finder:
def __init__(self):
self.fr... | {"hexsha": "2e7bb58f9eb19d558f101e82375845db918c5698", "size": 2834, "ext": "py", "lang": "Python", "max_stars_repo_path": "ucf_sub_catkin_ros/src/sub_utils/src/picker.py", "max_stars_repo_name": "RoboticsClubatUCF/RoboSub", "max_stars_repo_head_hexsha": "47304c620f963a8762db57a7ed248d1df90190fb", "max_stars_repo_licen... |
# -*- coding: utf-8 -*-
'''
<Lenet Neural Network High Level Synthesis Lenet>
MIT License
Copyright (c) 2020 Filipe Maciel Lins
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restrictio... | {"hexsha": "736b2bc3e3775faf4127d3a6303917ccf65742b2", "size": 2251, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/generate_testdata.py", "max_stars_repo_name": "filipemlins/Neural-Network-High-Level-Synthesis-Lenet", "max_stars_repo_head_hexsha": "7c787ffb103880b55a6e9397cd4a24a82a69d45a", "max_stars_r... |
# -*- coding: utf-8 -*-
"""emocoes-em-video-comentado.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1nDpT7CZsvulmYnL4wfA9Y-T1wb62e-_s
# **Detecção de Emoções em Videos**
# **Importação as bibliotecas**
"""
import cv2
import numpy as np
import... | {"hexsha": "6b51349c69c430f6b22673d4598fcacd3c9a017a", "size": 8896, "ext": "py", "lang": "Python", "max_stars_repo_path": "emocoes_em_video.py", "max_stars_repo_name": "thelesson/Deteccao-de-Emocoes-em-Videos-com-TensorFlow", "max_stars_repo_head_hexsha": "1ed1b2c77ff0d70fbc983c13baf5c62dd1b31a47", "max_stars_repo_lic... |
from astropy import units as u
from astropy.coordinates import SkyCoord
__all__ = ['get_point_data', 'get_luminosity_data', 'get_velocity_data']
def get_point_data(data, longitude_attribute, latitude_attribute, alternative_attribute=None,
frame=None, alternative_unit=None):
x_coordinates = ""... | {"hexsha": "955df38fb0703a4b62e33efaa8a5942f9acb3c9d", "size": 2565, "ext": "py", "lang": "Python", "max_stars_repo_path": "glue_openspace_thesis/utils.py", "max_stars_repo_name": "aniisabihi/glue-openspace", "max_stars_repo_head_hexsha": "853a61e0d1b0b2e5ed9919379b0a9db6ed39b1d9", "max_stars_repo_licenses": ["BSD-3-Cl... |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
class NQueensProblem:
"""This class encapsulates the N-Queens problem
"""
def __init__(self, numOfQueens):
"""
:param numOfQueens: the number of queens in the problem
"""
self.numOfQueens = numOfQue... | {"hexsha": "e6fe7abf70c28005711da2e69f2f8c762575890d", "size": 3595, "ext": "py", "lang": "Python", "max_stars_repo_path": "Chapter05/queens.py", "max_stars_repo_name": "KonstantinKlepikov/Hands-On-Genetic-Algorithms-with-Python", "max_stars_repo_head_hexsha": "ee5e7c5f8274a7ce22c3b528f86fa2bb1695e686", "max_stars_repo... |
from __future__ import division, unicode_literals, print_function
import sys
import os
import copy
import operator
import traceback
from functools import cmp_to_key
import pandas as pd
import numpy as np
from itertools import groupby, combinations
from collections import OrderedDict, defaultdict
from sklearn.covaria... | {"hexsha": "9288cb1485da29db4ecf3607797348f730fb1fc2", "size": 86728, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyquant/worker.py", "max_stars_repo_name": "Chris7/pyquant", "max_stars_repo_head_hexsha": "56410060546bcdafdba83232d8119f23a28cac56", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 13, "... |
import unittest
import numpy as np
import pandas as pd
import baobab.sim_utils.metadata_utils as metadata_utils
class TestMetadataUtils(unittest.TestCase):
"""Tests for the metadata utils module used to convert between parameter definitions
"""
def test_g1g2_vs_gamma_psi_symmetry(self):
n_data = 1... | {"hexsha": "ca32da26fef819b8461ec0f047f34b924d80359d", "size": 1804, "ext": "py", "lang": "Python", "max_stars_repo_path": "baobab/tests/test_sim_utils/test_metadata_utils.py", "max_stars_repo_name": "aymgal/baobab", "max_stars_repo_head_hexsha": "960ddbd55fc4391f2b857f2232af38c45c809ae8", "max_stars_repo_licenses": ["... |
from sklearn.neural_network import MLPClassifier
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import learning_curve
from sklearn.metrics import accuracy_score
from sklearn.metrics import conf... | {"hexsha": "60a0b97b2d1faa50dba80f2b8c5ba8d35f68d0c6", "size": 5775, "ext": "py", "lang": "Python", "max_stars_repo_path": "chinese/mlp_dnn/MLP_CLASSFIER/MLP.py", "max_stars_repo_name": "Lyuyangdaisy/DS_package", "max_stars_repo_head_hexsha": "ca0f220598ee156028646fbefccde08b2ece62ea", "max_stars_repo_licenses": ["MIT"... |
from __future__ import (print_function, division, unicode_literals, absolute_import)
import numpy as np
import matplotlib.pyplot as plot
import matplotlib as mpl
import copy
import scipy
from scipy import ndimage
from astropy import log
from glob import glob
from nicer.values import *
from os import path
from astropy.t... | {"hexsha": "429c325559e81185db4b35fa8b78581f562ac760", "size": 30495, "ext": "py", "lang": "Python", "max_stars_repo_path": "nicer/plotutils.py", "max_stars_repo_name": "ZaynabGhazi/NICERsoft", "max_stars_repo_head_hexsha": "c1e467b807226f091e82cd0e3ab0ce6b7a476610", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
using Omega: withkernel, kseα
"Replica Exchange (Parallel Tempering)"
struct ReplicaAlg <: SamplingAlgorithm end
"Single Site Metropolis Hastings"
const Replica = ReplicaAlg()
softhard(::Type{ReplicaAlg}) = IsSoft{ReplicaAlg}()
defΩ(::ReplicaAlg) = Omega.LinearΩ{ID, UnitRange{Int64}, Vector{Real}}
defΩ(x, ::Replica... | {"hexsha": "bf3a250840939f9cf5bfff25eed4d9399b5dec7d", "size": 3290, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/inference/replica.jl", "max_stars_repo_name": "mrakgr/Omega.jl", "max_stars_repo_head_hexsha": "7338c5f4c5c6931d676db2f43f6fe41d05eb19ee", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
"""Revised simplex method for linear programming
The *revised simplex* method uses the method described in [1]_, except
that a factorization [2]_ of the basis matrix, rather than its inverse,
is efficiently maintained and used to solve the linear systems at each
iteration of the algorithm.
.. versionadded:: 1.3.0
Re... | {"hexsha": "7c535e2d792fe45341e84fbf086cc7e6c64a2fc1", "size": 22622, "ext": "py", "lang": "Python", "max_stars_repo_path": "scipy/optimize/_linprog_rs.py", "max_stars_repo_name": "Corallus-Caninus/scipy", "max_stars_repo_head_hexsha": "c734dacd61c5962a86ab3cc4bf2891fc94b720a6", "max_stars_repo_licenses": ["BSD-3-Claus... |
import pytest
import numpy as np
def test_ndarray():
from rfweblab.serialize import pack_ndarray, unpack_ndarray
from rfweblab.serialize import dtype_to_fmt
arr = np.random.rand(10) - 0.5
for dtype in dtype_to_fmt:
if not dtype.isbuiltin:
continue
obj = arr.astype(dtype)
... | {"hexsha": "333d30518f7ceb55aefdf5d94cffdc94c57a4746", "size": 1925, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_serialize.py", "max_stars_repo_name": "ivannz/pyRFWebLab", "max_stars_repo_head_hexsha": "2f0d8edcd7ee2396243ba06f2e0ae7d500b2111c", "max_stars_repo_licenses": ["MIT"], "max_stars_count... |
import numpy as np
class NMF:
"""
NMFの計算,値を保持する.
Attributes
----------
W, H: numpy.ndarray
計算で使用する行列
loss_LOG: list
目的関数の計算結果のログ
epsilon: float
ゼロ除算回避用の微小な値
"""
W = None
H = None
loss_LOG = None
# probdist_V = None
epsilon = None
def __... | {"hexsha": "92f58d61681f301e8c459ff407f23529b74f0b78", "size": 4063, "ext": "py", "lang": "Python", "max_stars_repo_path": "nmf/modules/nmf.py", "max_stars_repo_name": "nssuperx/irl334-research-srcs", "max_stars_repo_head_hexsha": "7b1cf0ca16541613740e22aad373c5169abd246e", "max_stars_repo_licenses": ["Unlicense"], "ma... |
/*
* Copyright 2019 GridGain Systems, Inc. and Contributors.
*
* Licensed under the GridGain Community Edition License (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.gridgain.com/products/software/community-edition... | {"hexsha": "aff1903591ebf866ece0ce3005b855d48a07317c", "size": 1277, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "modules/platforms/cpp/odbc-test/src/sql_system_functions_test.cpp", "max_stars_repo_name": "FedorUporov/gridgain", "max_stars_repo_head_hexsha": "883125f943743fa8198d88be98dfe61bde86ad96", "max_star... |
#include <sstream>
#include <array>
#include "bw64/bw64.hpp"
#define BOOST_TEST_MODULE ChunkTests
#include <boost/test/included/unit_test.hpp>
using namespace bw64;
BOOST_AUTO_TEST_CASE(rect_16bit) {
Bw64Reader bw64File("testfiles/rect_16bit.wav");
BOOST_TEST(bw64File.bitDepth() == 16);
BOOST_TEST(bw64File.sam... | {"hexsha": "de1ea1de0686c8dfed70542ee5f15345cb447363", "size": 2371, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tests/file_tests.cpp", "max_stars_repo_name": "rsjtaylor/libbw64", "max_stars_repo_head_hexsha": "487efc9cc421e93128f775597a77f8596eddd586", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
data = pd.read_csv('../ECGFiveDays_TRAIN', sep=',', header=None)
label = data.pop(data.columns[0])
def plot_motif(Ta, Tb, values, indexes, m):
from matplotlib import gridspec
plt.figure(figsize=(8,4))
plt.subplot(211)
plt.plot(Ta, l... | {"hexsha": "a9436286290799560b5be585eae342860d99921e", "size": 1346, "ext": "py", "lang": "Python", "max_stars_repo_path": "owlpy/test_motif_discovery.py", "max_stars_repo_name": "dschowta/owlpy", "max_stars_repo_head_hexsha": "c614aa89ae55256727db65867915126da585aa3c", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
[STATEMENT]
lemma set_partition_by_median:
"(l, m, r) = partition_by_median k ps \<Longrightarrow> set ps = set l \<union> set r"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. (l, m, r) = partition_by_median k ps \<Longrightarrow> set ps = set l \<union> set r
[PROOF STEP]
unfolding partition_by_median_def
[PROOF... | {"llama_tokens": 223, "file": "KD_Tree_Build", "length": 2} |
module f_python
use f_precisions, only: f_address
implicit none
!> Equivalent type than the numpy one, to be able
! to export a Fortran array into Python space.
type ndarray
integer(f_address) :: data
integer :: ndims
integer, dimension(7) :: shapes
character(len = 2) :: kind
end type... | {"hexsha": "f77326f02b36daa4f53b2b7fb3de31916215f2fe", "size": 6252, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "aiida_bigdft/futile/flib/fpython.f90", "max_stars_repo_name": "adegomme/aiida-bigdft-plugin", "max_stars_repo_head_hexsha": "dfd17f166a8cd547d3e581c7c3c9f4eb32bd2aab", "max_stars_repo_licenses":... |
using Distributions, StatsBase
using JLD, PyPlot
for set in ["set1", "set2", "set3", "set4"]
file = jldopen("res/power_$(set).jld", "r")
power = read(file, "power")
close(file)
fig = figure(figsize=(3.14961, 3.14961), dpi=1000)
scatter(-.75:.05:.75, power[1, :], s=5, marker="o")
scatter(-.75:... | {"hexsha": "5a6bee7e88d4ebb3f76256344e4be0dd76a3c019", "size": 671, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "exper/exper2/plot_res.jl", "max_stars_repo_name": "mlakolar/KLIEPInference.jl", "max_stars_repo_head_hexsha": "56b2979791b1b6d4e0c1f2f66ed27dfe86aa52e8", "max_stars_repo_licenses": ["MIT"], "max_sta... |
header {* \isaheader{SDG} *}
theory SDG imports CFGExit_wf Postdomination begin
subsection {* The nodes of the SDG *}
datatype 'node SDG_node =
CFG_node 'node
| Formal_in "'node \<times> nat"
| Formal_out "'node \<times> nat"
| Actual_in "'node \<times> nat"
| Actual_out "'node \<times> nat"
fun pare... | {"author": "Josh-Tilles", "repo": "AFP", "sha": "f4bf1d502bde2a3469d482b62c531f1c3af3e881", "save_path": "github-repos/isabelle/Josh-Tilles-AFP", "path": "github-repos/isabelle/Josh-Tilles-AFP/AFP-f4bf1d502bde2a3469d482b62c531f1c3af3e881/thys/HRB-Slicing/StaticInter/SDG.thy"} |
#!/usr/bin/python
import matplotlib
import csv
matplotlib.use('Agg') # This lets it run without an X backend
import matplotlib.pyplot as plt
import numpy as np
ring_x = []
ring_y = []
q_x = []
q_y = []
#fname = "vacation_durable_low_2048_unpinned"
#fname = "vacation_durable_low_2048_pinned"
#fname = "vacation_volati... | {"hexsha": "ae42372accb2d92bebe326b4544515015c39ad2b", "size": 1438, "ext": "py", "lang": "Python", "max_stars_repo_path": "ext/qstm/OF-QSTM/ptms/qstm/data/old/plot_pinning/plot-pinning.py", "max_stars_repo_name": "roghnin/Montage", "max_stars_repo_head_hexsha": "40dbd6bb5a506545f01931336bf37b24cdb72a64", "max_stars_re... |
"""
file_formats.py defines file outputs from input xarray objects
"""
import copy
import numpy as np
import pandas as pd
def load_pvnames(filename):
"""
Given a file with one pv on each line, return a list of pvs.
"""
with open(filename, "r") as f:
lines = f.readlines()
return [l[:-1] ... | {"hexsha": "53246c9f19ab5f8a902d83a81d71728450a94e70", "size": 4946, "ext": "py", "lang": "Python", "max_stars_repo_path": "archapp/file_formats.py", "max_stars_repo_name": "ZryletTC/archapp", "max_stars_repo_head_hexsha": "68299fa3e35c292cff33bba55a3a75e9ae568815", "max_stars_repo_licenses": ["BSD-3-Clause-LBNL"], "ma... |
# BSD 3-Clause License
#
# Copyright (c) 2020, IPASC
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of... | {"hexsha": "d8e475cfb6204ac23195dc6b133c63838f07b973", "size": 7603, "ext": "py", "lang": "Python", "max_stars_repo_path": "ipasc_test/tests/test_pa_data_class.py", "max_stars_repo_name": "IPASC/IPASC_DataConversionTool", "max_stars_repo_head_hexsha": "41c6176ed579d8c7778a9831dcc28ca3f93df82e", "max_stars_repo_licenses... |
import os, os.path
import pandas as pd
import numpy as np
import support_functions as sf
import data_structures as ds
# TEMP
import importlib
importlib.reload(sf)
importlib.reload(ds)
# setup some
dir_py = os.path.dirname(os.path.realpath(__file__))
dir_proj = os.path.dirname(dir_py)
# key subdirectories for the pr... | {"hexsha": "a89ff0c6a4301957f5098450951c35ea611589fc", "size": 808, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/.ipynb_checkpoints/setup_analysis-checkpoint.py", "max_stars_repo_name": "egobiernoytp/lac_decarbonization", "max_stars_repo_head_hexsha": "7b574c4c91a0b1341dfd97a203fc8477ba32a91d", "max_st... |
'''
This program detects aruco ar tags from
a camera stream
Next steps: perform transformation from
image coordinate system to global coordinate
system using extrinsic matrix
'''
import cv2
import cv2.aruco as aruco
import numpy as np
from io import BytesIO
import time
import os
from picamera import PiCamera
from pic... | {"hexsha": "863f8d2495c2b64286fd2d58b0a68b325e995926", "size": 5797, "ext": "py", "lang": "Python", "max_stars_repo_path": "aruco_detector.py", "max_stars_repo_name": "umrover/perception-raspi-ar", "max_stars_repo_head_hexsha": "e1ff1da3c77bc2906ef21ceeeada04a141124a96", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
using NURBS
using Base.Test
@testset "B-Spline curve generator" begin
@testset "bspline" begin
b = [1. 2 4 3; 1 3 3 1; 0 0 0 0]
@test typeof(bspline(4,4,5,b)[1]) == Array{Float64,2}
@test typeof(bspline(4,4,5,b)[2]) == Array{Array{Int64,1},1}
@test isapprox(bspline(4,4,5,b)[1],[... | {"hexsha": "3812000893d353cf5c3e3b55d9f6028696b18642", "size": 3089, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/bspline.jl", "max_stars_repo_name": "eOnofri04/IN480", "max_stars_repo_head_hexsha": "3128bfd990925e8926065e075b309cb9bda1355c", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "max_... |
[STATEMENT]
lemma (in cat_parallel_2) cat_parallel_op[cat_op_intros]:
"cat_parallel_2 \<alpha> \<bb> \<aa> \<ff> \<gg>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. cat_parallel_2 \<alpha> \<bb> \<aa> \<ff> \<gg>
[PROOF STEP]
by (intro cat_parallel_2I)
(auto intro!: cat_parallel_cs_intros cat_parallel_ineq... | {"llama_tokens": 140, "file": "CZH_Elementary_Categories_czh_ecategories_CZH_ECAT_Parallel", "length": 1} |
'''
Testing Dynamic Sednet preprocessors
'''
import veneer
import os
import json
import pandas as pd
import numpy as np
import sys
import string
from dsed import preprocessors
from .general import TestServer, write_junit_style_results, arg_or_default
from datetime import datetime
import traceback
veneer.general.PRINT... | {"hexsha": "13ecc5277c851d5c27698037ae469efd2a68d95c", "size": 4357, "ext": "py", "lang": "Python", "max_stars_repo_path": "dsed/testing/preprocessors.py", "max_stars_repo_name": "flowmatters/dsed-py", "max_stars_repo_head_hexsha": "b967db2797320e63bc504e40023b7c7623a0b002", "max_stars_repo_licenses": ["0BSD"], "max_st... |
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
def importarDados(insertOnes=True, filepath='/data/ex2data1.txt', names=['Prova 1', 'Prova 2', 'Aprovado']):
path = os.getcwd() + filepath
data = pd.read_csv(path, header=None, names=names)
# Carregando os dados do dataset... | {"hexsha": "880395abd69b305762bbdb824c28a592c030674f", "size": 1485, "ext": "py", "lang": "Python", "max_stars_repo_path": "T2/plot_ex2data1.py", "max_stars_repo_name": "andersonmanhaes/ml_mestrado", "max_stars_repo_head_hexsha": "d737d80e07d9392895e4455e49a33b8700080cf1", "max_stars_repo_licenses": ["MIT"], "max_stars... |
-- La composición de funciones inyectivas es inyectiva
-- ===================================================
-- ----------------------------------------------------
-- Ej. 1. Demostrar que la composición de dos funciones
-- inyectivas es una función inyectiva.
-- ----------------------------------------------------
... | {"author": "jaalonso", "repo": "Logica_con_Lean", "sha": "beb6765c6ff3c05590a03f45722eda0c815a25cd", "save_path": "github-repos/lean/jaalonso-Logica_con_Lean", "path": "github-repos/lean/jaalonso-Logica_con_Lean/Logica_con_Lean-beb6765c6ff3c05590a03f45722eda0c815a25cd/src/5_Funciones/La_composicion_de_funciones_inyecti... |
import argparse
import os
# workaround to unpickle olf model files
import sys
from pdb import set_trace as bp
import numpy as np
import torch
import gym
import my_pybullet_envs
import pybullet as p
import time
from a2c_ppo_acktr.envs import VecPyTorch, make_vec_envs
from a2c_ppo_acktr.utils import get_render_func, g... | {"hexsha": "42a8fe503f6debcca49d29b8840f566bc4493caf", "size": 9137, "ext": "py", "lang": "Python", "max_stars_repo_path": "enjoy_test.py", "max_stars_repo_name": "jyf588/pytorch-rl-bullet", "max_stars_repo_head_hexsha": "3ac1835d01e658b2078126895ffa0eb11304abb4", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
[STATEMENT]
lemma (in simplification) rb_correct:
fixes Q :: "('a :: {linorder, infinite}, 'b :: linorder) fmla"
shows "rb Q \<le> rb_spec Q"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. rb Q \<le> rb_spec Q
[PROOF STEP]
proof (induct Q rule: rb.induct[case_names Neg Disj Conj Exists Pred Bool Eq])
[PROOF STAT... | {"llama_tokens": 1978, "file": "Safe_Range_RC_Restrict_Bounds", "length": 7} |
%kiconvolve 'Perform convolution or correlation on image data'
% This MatLab function was automatically generated by a converter (KhorosToMatLab) from the Khoros iconvolve.pane file
%
% Parameters:
% InputFile: i1 'Input image', required: 'input image'
% InputFile: i2 'Kernel ', required: 'kernel'
% Toggle: upcast 'Up... | {"author": "aludnam", "repo": "MATLAB", "sha": "020b5cb02cc843e09a0ed689589382f18cce5e6d", "save_path": "github-repos/MATLAB/aludnam-MATLAB", "path": "github-repos/MATLAB/aludnam-MATLAB/MATLAB-020b5cb02cc843e09a0ed689589382f18cce5e6d/matlab_tools/Converted/kiconvolve.m"} |
from collections.abc import MutableMapping
import numpy as np
import networkx as nx
import osmnx as ox
import pandas as pd
from gym import spaces
from gym.spaces import flatten, Dict
from epoxy.Rider import Rider
from epoxy.Driver import Driver
class StateGraph:
def __init__(self, number_drivers, ride_data, cur... | {"hexsha": "5c981bcc663828f71998f499b7d20b9cff00ca4c", "size": 3905, "ext": "py", "lang": "Python", "max_stars_repo_path": "epoxy/stategraph.py", "max_stars_repo_name": "WilliamOrringe/RideSharingMachineLearning", "max_stars_repo_head_hexsha": "5f0d2ac3cab5dbf8618cff202e201fe1c7016728", "max_stars_repo_licenses": ["MIT... |
#!/usr/bin/env python3
# Usage:
# PYTHONPATH=src ./encode.py <file|directory|glob> /path/to/output.npz
# PYTHONPATH=src ./train --dataset /path/to/output.npz
import argparse
import numpy as np
import sys
import tqdm
from ftfy import fix_text
import tflex_utils
parser = argparse.ArgumentParser(
description='Us... | {"hexsha": "81c24d91912b9c1e8f7733fb325a28d2dffdc44d", "size": 967, "ext": "py", "lang": "Python", "max_stars_repo_path": "prepare_dataset.py", "max_stars_repo_name": "scripples/scripp_gpt-2", "max_stars_repo_head_hexsha": "d0b5b31fce107440d48c5447cc04cce7bc5ef639", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import pylab as pl
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib.image as mpimg
img = Image.open('309.14.png')#[:,:,2]#.convert('L')
img = mpimg.imread('309.14.png')[:,:,2]
z = np.... | {"hexsha": "73a024a33aa07b09937839eb67041cd4ae25d4fd", "size": 1212, "ext": "py", "lang": "Python", "max_stars_repo_path": "2 - data2graph/zzz_testfile.py", "max_stars_repo_name": "Tocha4/HSM-Solubility", "max_stars_repo_head_hexsha": "8a83c1270d739f0c7fbb7decf6202e90e6ebc083", "max_stars_repo_licenses": ["MIT"], "max_... |
[STATEMENT]
lemma drop_Cons_Suc:
"\<And>xs. drop n xs = y#ys \<Longrightarrow> drop (Suc n) xs = ys"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<And>xs. drop n xs = y # ys \<Longrightarrow> drop (Suc n) xs = ys
[PROOF STEP]
proof(induct n)
[PROOF STATE]
proof (state)
goal (2 subgoals):
1. \<And>xs. drop 0 xs... | {"llama_tokens": 669, "file": "Jinja_Compiler_TypeComp", "length": 6} |
[STATEMENT]
lemma rewrite_negated_primitives_normalized_preserves_unrelated_helper:
assumes wf_disc_sel: "wf_disc_sel (disc, sel) C"
and disc: "\<forall>a. \<not> disc2 (C a)"
and disc_p: "(\<forall>a. \<not> disc2 (Prot a)) \<or> \<not> has_disc_negated disc False m" (*either we do not disc on protocol or ... | {"llama_tokens": 12678, "file": "Iptables_Semantics_Primitive_Matchers_Ports_Normalize", "length": 42} |
using Wavelets
using Test
using LinearAlgebra
using DelimitedFiles
# modified from Base.Test
function vecnorm_eq(va, vb, Eps, astr="a", bstr="b")
if length(va) != length(vb)
#error("lengths of ", astr, " and ", bstr, " do not match: ",
# "\n ", astr, " (length $(length(va))) = ", va,
... | {"hexsha": "3b9f7e2f0f955f48406bfe0e82ee75fc1f5221be", "size": 988, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "test/runtests.jl", "max_stars_repo_name": "jonschumacher/Wavelets.jl", "max_stars_repo_head_hexsha": "1a09593ec8b51713c4784a13fabe070351e0d95c", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
[STATEMENT]
lemma AbstrLevels_A9_A93:
assumes "sA9 \<in> AbstrLevel i"
shows "sA93 \<notin> AbstrLevel i"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sA93 \<notin> AbstrLevel i
[PROOF STEP]
(*<*)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. sA93 \<notin> AbstrLevel i
[PROOF STEP]
using assms
[PROOF STATE... | {"llama_tokens": 245, "file": "ComponentDependencies_DataDependenciesCaseStudy", "length": 3} |
import baostock as bs
import pandas as pd
import numpy as np
from IPython import embed
class Data_Reader():
"""
reading the data from the file
"""
def __init__(self, file="stock.csv"):
self.file = file
self.code_list = []
self.data = None
def read_data(self, file="stock.c... | {"hexsha": "0433118843ef461942d5527c10009de8c62d673d", "size": 1803, "ext": "py", "lang": "Python", "max_stars_repo_path": "loaddata.py", "max_stars_repo_name": "leafy-lee/Time_Series-stock_prediction", "max_stars_repo_head_hexsha": "9b2bcab2c9da5a5ad4898e551dfdfd7cad241c0f", "max_stars_repo_licenses": ["MIT"], "max_st... |
function optimo = LocalSearch(Problem,pos,w)
%------------------------------- Copyright --------------------------------
% Copyright (c) 2023 BIMK Group. You are free to use the PlatEMO for
% research purposes. All publications which use this platform or any code
% in the platform should acknowledge the use of "PlatEM... | {"author": "BIMK", "repo": "PlatEMO", "sha": "c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5", "save_path": "github-repos/MATLAB/BIMK-PlatEMO", "path": "github-repos/MATLAB/BIMK-PlatEMO/PlatEMO-c5b5b7c37a9bb42689a5ac2a0d638d9c4f5693d5/PlatEMO/Algorithms/Multi-objective optimization/GPSO-M/LocalSearch.m"} |
#coding:utf-8
import numpy as np
import tensorflow as tf
from Model import Model
if tf.__version__ > '0.12.1':
matmul_func = tf.matmul
else:
matmul_func = tf.batch_matmul
class TransR(Model):
r'''
TransR first projects entities from entity space to corresponding relation space
and then builds translations betwe... | {"hexsha": "f167e236e1ceef19976412532ef1e4896add907e", "size": 4628, "ext": "py", "lang": "Python", "max_stars_repo_path": "TransR.py", "max_stars_repo_name": "jaytx/MyRep", "max_stars_repo_head_hexsha": "6333eb7196ecf808810d439297895e7b75a99729", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_stars_... |
module SodShockTube
using NLsolve: nlsolve
using PartialFunctions
using Documenter
export solve, ShockTubeProblem
sound_speed(γ, p, ρ) = √(γ * p / ρ)
function shock_tube_fn!(p1, p5, ρ1, ρ5, γ, p4)
z = (p4[1] / p5 - 1)
c1 = sound_speed(γ, p1, ρ1)
c5 = sound_speed(γ, p5, ρ5)
gm1 = γ - 1
gp1 = γ +... | {"hexsha": "5c40f19e7e791a8fc4f68c5b0b60abc8ca90214f", "size": 7069, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/SodShockTube.jl", "max_stars_repo_name": "archermarx/SodShockTube", "max_stars_repo_head_hexsha": "7b8ef18c9ca05ca78b51d8a4ca17769c0125e32c", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
\chapter{Agents of Change}
\label{chap:agent}
According to Wikipedia today, Survivorship bias is the``logical error of concentrating on the people or things that made it past some selection process and overlooking those that did not, typically because of their lack of visibility. This can lead to false conclusions in ... | {"hexsha": "563df5bcc1a91c0bf845a472e9853f5821845451", "size": 32105, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Chapters/Chapter05.tex", "max_stars_repo_name": "lasernite/phd-dissertation", "max_stars_repo_head_hexsha": "7b3d83a75b520c297c28e22580c2f00a0bfdda5e", "max_stars_repo_licenses": ["CC-BY-4.0"], "ma... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import pandas as pd
from sklearn import svm
from sklearn.metrics import accuracy_score
import matplotlib as mpl
import matplotlib.colors
import matplotlib.pyplot as plt
if __name__ == "__main__":
data = pd.read_csv('bipartition.txt', sep='\t', header=No... | {"hexsha": "da9897c98d7f56d87f49f44b792f03c634a6c695", "size": 2668, "ext": "py", "lang": "Python", "max_stars_repo_path": "DMProject/15.package/15.3.SVM_draw.py", "max_stars_repo_name": "gongjunhuang/Spider", "max_stars_repo_head_hexsha": "c683137dafac9c7f4afd359baf9d0717d1a127e2", "max_stars_repo_licenses": ["Apache-... |
################################################################################
# MIT License
#
# Copyright (c) 2021 Hajime Nakagami<nakagami@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in ... | {"hexsha": "06543d794fa80e1e2732b279b7029335ca46cee7", "size": 9550, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/xsqlvar.jl", "max_stars_repo_name": "nakagami/Firebird.jl", "max_stars_repo_head_hexsha": "5fb5902c892645c58a60e4fd8a42e32d930045c1", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 4, "... |
import riptable as rt
import random as rand
import pandas as pd
import unittest
functions_str = [
'count',
'sum',
'mean',
'median',
'min',
'max',
# 'prod',
'var',
# 'quantile',
'cumsum',
'cumprod',
# 'cummax',
# 'cummin'
'first',
'last',
... | {"hexsha": "db9aaa06d51c68bb9b96c92d31068a8b2114720e", "size": 5439, "ext": "py", "lang": "Python", "max_stars_repo_path": "riptable/tests/test_groupby_functions.py", "max_stars_repo_name": "972d5defe3218bd62b741e6a2f11f5b3/riptable", "max_stars_repo_head_hexsha": "bb928c11752e831ec701f91964979b31db53826a", "max_stars_... |
"""
Copyright (C) 2018 University of Massachusetts Amherst.
This file is part of "coref_tools"
http://github.com/nmonath/coref_tools
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.... | {"hexsha": "b677314368e6b14cf555665295d1495a339300d9", "size": 1645, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/python/geo/models/BoxModel.py", "max_stars_repo_name": "nmonath/coref_tools", "max_stars_repo_head_hexsha": "542659170897ad05f7612639cb918886859ae9d6", "max_stars_repo_licenses": ["Apache-2.0"... |
using Plots
using Random
using DifferentialEquations
using DynamicalSystems
function make_data(system::DynamicalSystem;
train_time = 100, nspin=500, test_time = 15, n_test = 10, Δt=0.01)
"""make training and testing data from the dynamical system"""
options = (alg = Vern9(), abstol = 1e-12,r... | {"hexsha": "6cd84641b29e7baff1a80cd08cf0659e689a25ee", "size": 1404, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/utilities.jl", "max_stars_repo_name": "japlatt/BasicReservoirComputing", "max_stars_repo_head_hexsha": "f92a6f143689b9d252d25b750aef9d91aa669509", "max_stars_repo_licenses": ["MIT"], "max_... |
import numpy as np
import matplotlib.pyplot as plt
TOL = np.finfo(float).resolution
# Set up our constants
Lx = 10 * 0.01 # [m]
Ly = 7.5 * 0.01 # [m]
rho = 7860 # [kg/m^3]
c_p = 490 # [J/kg.K]
k = 54 # [W/m.K]
alpha = k / (c_p * rho) # [m^2/s]
dx = 2.5 * 0.01 # [m]
dy = 2.5 * 0.01 # [m]
dt = 100
sig... | {"hexsha": "2cbe17fddf4a0e2ac41431008d7746d6ceb26754", "size": 2063, "ext": "py", "lang": "Python", "max_stars_repo_path": "Week 8 and 9/basic.py", "max_stars_repo_name": "Schalk-Laubscher/2020-Tutorials", "max_stars_repo_head_hexsha": "d720994d80d255da7958bd0e4d3fa4ca69aae9d7", "max_stars_repo_licenses": ["MIT"], "max... |
"""
Package: SQLdf
sqldf(query::String)::DataFrame
Execute R sqldf and return a julia DataFrame.
Columns in the DataFrame must have a type other than Any. In order to work with dates expressions like
\"""select strftime("%Y", datetime_column, "unixepoch") as year from T\""" may be used.
# Arguments
`query`: SQL... | {"hexsha": "1264be388180ebe36d6802fbb4b6269649dbaf30", "size": 1765, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sqldf.jl", "max_stars_repo_name": "viraltux/SQLDF.jl", "max_stars_repo_head_hexsha": "627f233f38cd915961aa487ea880bdc28e698787", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 10, "max_... |
import os
import cv2
import numpy as np
import skimage.transform
import torch
from lib.windows import normalize_data
def pad_if_needed(img, min_height, min_width):
input_height, input_width = img.shape[:2]
new_shape = list(img.shape)
new_shape[0] = max(input_height, min_height)
new_shape[1] = max(in... | {"hexsha": "274aa172a8e8adc19cf3fa52126e4456e95f64cc", "size": 4268, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/inference.py", "max_stars_repo_name": "jphdotam/T1T2", "max_stars_repo_head_hexsha": "b5003f5cf3aaddc4f43a7b7b4a77f52cef956c27", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 6 14:57:46 2021
@author: iseabrook1
"""
#This script contains the functions to calculate node importance
#and related analyses as presented in Seabrook et. al.,
#Community aware evaluation of node importance
#Isobel Seabrook, ucabeas@ucl.ac.uk
#MIT Licens... | {"hexsha": "c9d00ffacc48da846a8fabe79bd944b5b644f0c5", "size": 17424, "ext": "py", "lang": "Python", "max_stars_repo_path": "node_importance_functions.py", "max_stars_repo_name": "Iseabrook/structural_node_importance", "max_stars_repo_head_hexsha": "c3f0e05d7e9d7597273f951fd5ec111830250b96", "max_stars_repo_licenses": ... |
### Julia OpenStreetMap Package ###
### MIT License ###
### Copyright 2014 ###
type OSMattributes
oneway::Bool
oneway_override::Bool
oneway_reverse::Bool
visible::Bool
lanes::Int
name::UTF8String
class::UTF8String
detail::UTF8String
cycleway::UTF8String... | {"hexsha": "1b9b367dd5aee727e0d7c7d2c367394fe66e7a88", "size": 6852, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/parseMap.jl", "max_stars_repo_name": "UnofficialJuliaMirror/OpenStreetMap.jl-08b6f058-0539-51ec-9920-f66949f89f7a", "max_stars_repo_head_hexsha": "9102e36e4f8304ce2238f2d315589976c83d3d66", "ma... |
"""Printing module
"""
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
import numpy as np
DATE_FORMAT = "%Y-%m-%d"
def user_to_name(argument):
"""Switch functionality
"""
switcher = {
"lopezobrador_": "A. López Obrador",
"RicardoAnayaC": "R. Anaya Co... | {"hexsha": "da5c83c406d625e56cf0d2566cd98a8163083523", "size": 2704, "ext": "py", "lang": "Python", "max_stars_repo_path": "PlotPopularity.py", "max_stars_repo_name": "fornesarturo/twitter-popularity", "max_stars_repo_head_hexsha": "c640e0291ee1483e433c76ee64a89bf53537af75", "max_stars_repo_licenses": ["MIT"], "max_sta... |
# Erode and dilate support 3x3 regions only (and higher-dimensional generalizations).
"""
```
imgd = dilate(img, [region])
```
perform a max-filter over nearest-neighbors. The
default is 8-connectivity in 2d, 27-connectivity in 3d, etc. You can specify the
list of dimensions that you want to include in the connectivi... | {"hexsha": "7e1da0757417f449c7ed8ca0275d552188108426", "size": 9392, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/dilation_and_erosion.jl", "max_stars_repo_name": "JiangXL/ImageMorphology.jl", "max_stars_repo_head_hexsha": "e668343ddbff2f750e451f6c73209ac3cd4443cc", "max_stars_repo_licenses": ["MIT"], "max... |
C Copyright(C) 1999-2020 National Technology & Engineering Solutions
C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
C NTESS, the U.S. Government retains certain rights in this software.
C
C See packages/seacas/LICENSE for details
C==============================================================... | {"hexsha": "16cebdb02b030dbb07e6092e6a6b02ca2480338b", "size": 3139, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "packages/seacas/applications/gen3d/g3_makrow.f", "max_stars_repo_name": "jschueller/seacas", "max_stars_repo_head_hexsha": "14c34ae08b757cba43a3a03ec0f129c8a168a9d3", "max_stars_repo_licenses": ["... |
# Determinant formula from Cavalieri's principle
```python
# setup SymPy
from sympy import *
init_printing()
Vector = Matrix
# setup plotting
#%matplotlib inline
%matplotlib notebook
import matplotlib.pyplot as mpl
from util.plot_helpers import plot_vec, plot_vecs, plot_line, plot_plane, autoscale_arrows
```
## Two... | {"hexsha": "a9692634f7f8eb37499be0e652cc95f169b96713", "size": 132694, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "extra/Determinants.ipynb", "max_stars_repo_name": "ChidinmaKO/noBSLAnotebooks", "max_stars_repo_head_hexsha": "c0102473f1e6625fa5fb62768d4545059959fa26", "max_stars_repo_licenses": ... |
import numpy as np
from roadrunner import RoadRunner
from roadrunner.testing import TestModelFactory as tmf
from threading import Thread
from multiprocessing import Queue
import time
from platform import platform
import cpuinfo # pip install py-cpuinfo
import mpi4py # pip install mpi4py
NTHREADS = 16
NSIMS = 100000... | {"hexsha": "7f123e257b5ac5ebbab9a9b6ada020a1fa13664b", "size": 1588, "ext": "py", "lang": "Python", "max_stars_repo_path": "docs/source/parallel/gillespie_simulations_mpi4py.py", "max_stars_repo_name": "sys-bio/roadrunner", "max_stars_repo_head_hexsha": "f0a757771ef0e337ddf7409284910e1627c3ad71", "max_stars_repo_licens... |
#############################################################
#
# Spam Reporting Functions
#
#############################################################
function post_users_report_spam(; options=Dict{AbstractString, AbstractString}())
r = post_oauth("https://api.twitter.com/1.1/users/report_spam.json", options)... | {"hexsha": "07928b44ca2348e3c3c1268e6a47d67c6cbbd896", "size": 410, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/spam.jl", "max_stars_repo_name": "JuliaPackageMirrors/Twitter.jl", "max_stars_repo_head_hexsha": "b4f2c07e1197d63ba7d91600986129a931ba11bd", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stephane Caron <stephane.caron@normalesup.org>
#
# 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... | {"hexsha": "a19a80a0d14f69fe4182b3ac3c6412da2290e4b1", "size": 5158, "ext": "py", "lang": "Python", "max_stars_repo_path": "rrtcmp/testbed.py", "max_stars_repo_name": "Tastalian/avp-rrt-rss-2013", "max_stars_repo_head_hexsha": "d3d9b50bb582c23a4ee83408b26bcede4d84469e", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
"""
Module for fitting the aABC algorithm with two-timescales generative models
"""
from simple_abc_only2Tau import Model, basic_abc, pmc_abc
from generative_models import *
from basic_functions import *
from distance_functions import *
from summary_stats import *
import numpy as np
from scipy import stats
def ... | {"hexsha": "c3ec06e34b2992cb7c5f24115ba22f2114639740", "size": 3353, "ext": "py", "lang": "Python", "max_stars_repo_path": "abcTau/abc2Tau.py", "max_stars_repo_name": "roxana-zeraati/abcTau", "max_stars_repo_head_hexsha": "ce4352062ee7821c80ac1c660641f41fef023e14", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_star... |
# -*- coding: utf-8 -*-
"""
@author: fornax
"""
import numpy as np
import pandas as pd
def get_npwd2881_features(df):
"""
Extracts AOOO commands from pandas file which are
correlated with NPWD2881 line. Those commands are
then used as a train features for final predictions.
:param df: a data ... | {"hexsha": "92d1b590f0b7d0ad65ca4bd2690493b3302d7583", "size": 11713, "ext": "py", "lang": "Python", "max_stars_repo_path": "preprocessing/dmop_analysis.py", "max_stars_repo_name": "fornaxco/Mars-Express-Challenge", "max_stars_repo_head_hexsha": "4e0dff9909df0d10e507083af59326b3342d67fe", "max_stars_repo_licenses": ["B... |
include("viral_load_infectivity_testpos.jl")
const scen_names = ["(b) Status Quo","(c1) Fortnightly concurrent PCR","(c2) Fortnightly random PCR", "(d) 3 LFDs per week","(e) 2 LFDs per week","(f) Daily LFDs","(g) Daily LFDs + PCR","(h) 3 LFDs + PCR",
"(a) No testing"]
function scenario_1_setup(Ndays::Int) #2 LF... | {"hexsha": "f71d133f28a63efa6af4adc1807d0a90fea51182", "size": 13736, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/repeat_testing_scenarios.jl", "max_stars_repo_name": "CarlWhitfield/Viral_load_testing_COV19_model", "max_stars_repo_head_hexsha": "e12befa4016de7af69c75dcba7c4f80896b74dd4", "max_stars_repo_l... |
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | {"hexsha": "a772bb1b2ae5c062bc6190a79ab8f62738c58ac1", "size": 7463, "ext": "py", "lang": "Python", "max_stars_repo_path": "qa/L0_infer_zero/infer_zero_test.py", "max_stars_repo_name": "AliAzG/triton-inference-server", "max_stars_repo_head_hexsha": "fbce250035d049d13f32c362e2d76a5cb787da51", "max_stars_repo_licenses": ... |
import time
import json
import logging
import numpy as np
import os.path as osp
from pycoco.bleu.bleu import Bleu
from pycoco.meteor.meteor import Meteor
from pycoco.rouge.rouge import Rouge
from pycoco.cider.cider import Cider
import torch
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.a... | {"hexsha": "04fd9648e29ed4d0118365a88940cbd7744e923f", "size": 10235, "ext": "py", "lang": "Python", "max_stars_repo_path": "tools.py", "max_stars_repo_name": "tgGuo15/PriorImageCaption", "max_stars_repo_head_hexsha": "4ee6017d642116145cc74c6f752685bd2d19b1cc", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 34,... |
library(ggplot2)
library(gridExtra)
load("sc1-multi-time.RData")
# extract if2 data
if2names <- c("if2.R0","if2.r","if2.sigma","if2.eta","if2.berr","if2.Iinit")
if2data <- estmat[,if2names]
colnames(if2data) <- c("R0","r","sigma","eta","berr","Iinit")
if2times <- estmat[,7]
# extract hmc data
hmcname... | {"hexsha": "267880a16e45f6e0f2b8049f5fe4d6d0cb0efcd1", "size": 7046, "ext": "r", "lang": "R", "max_stars_repo_path": "code/stochastic-comparison/parfit-parallel/process-sc1-m.r", "max_stars_repo_name": "dbarrows/epidemic-forecasting", "max_stars_repo_head_hexsha": "a0865fa20c992dc4159e79bb332500e3ff2357ae", "max_stars_... |
SUBROUTINE SGBCO( ABD, LDA, N, ML, MU, IPVT, RCOND, Z )
C
C FACTORS A REAL BAND MATRIX BY GAUSSIAN ELIMINATION
C AND ESTIMATES THE CONDITION OF THE MATRIX.
C
C REVISION DATE: 8/1/82
C AUTHOR: MOLER, C. B., (U. OF NEW MEXICO)
C
C IF RCOND IS NOT NEEDED, SGBFA IS SLIGHTLY FA... | {"hexsha": "730f4a62ed10d657e9d443e81b03b65f8c23cf88", "size": 32866, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "ubuntu20/projects/libRadtran-2.0.4/libsrc_f/spsmisc.f", "max_stars_repo_name": "AmberCrafter/docker-compose_libRadtran", "max_stars_repo_head_hexsha": "0182f991db6a13e0cacb3bf9f43809e6850593e4", ... |
"""
Class and functions for read data.
This module includes the :class:`ReadData` class and a few utility functions for
working with BAM reads of type :class:`pysam.AlignedSegment`.
Classes
* :class:`ReadData`
Functions
* :func:`bamread_get_oq`
* :func:`bamread_get_quals`
"""
import numpy as np
from... | {"hexsha": "463c83683ee9cd06156fb97970414cc4d41b25ac", "size": 15817, "ext": "py", "lang": "Python", "max_stars_repo_path": "kbbq/read.py", "max_stars_repo_name": "adamjorr/kbbq-py", "max_stars_repo_head_hexsha": "a1b6049458ec03d305c4f4148aad325a3867d627", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
%!TEX root = ../main.tex
\subsection{Anti-Derivative}
\objective{Distinguish and find anti-derivatives and integrals of functions}
Suppose we are given a formula and are told it is the derivative of what we want.
This isn't as abstract as it sounds: velocity is the derivative of position, and (at least in
many ca... | {"hexsha": "c7fe20a3723f4e1006092e58d76d9e657e4287fc", "size": 5056, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "ch05/0505.tex", "max_stars_repo_name": "aquatiki/AnalysisTextbook", "max_stars_repo_head_hexsha": "011c16427ada1b1e3df8e66c02566a5d5ac8abcf", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2... |
import numpy as np
class Naive_Bayes(object):
def __init__(self, type = "Gaussian", prior = []):
self.type = type
self.prior = prior
def fit(self, X, y):
if((self.type).lower() == "multinomial"):
count_sample = X.shape[0]
separated = [[x for x, t in zip(X, y) if t == c] for c in np.unique(y)]
if len... | {"hexsha": "cc4fbf4c1d6b3a978ca7b691b620efad067ea8e2", "size": 1509, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/naive_bayes.py", "max_stars_repo_name": "arkilpatel/Raw-ML-Classifiers", "max_stars_repo_head_hexsha": "9e6122cc9cf53ee6048e2269aa2b1fad19499a5a", "max_stars_repo_licenses": ["MIT"], "max_star... |
function ackley(x, a=20, b=0.2, c=2π)
d = length(x)
return -a*exp(-b*sqrt(sum(x.^2)/d)) -
exp(sum(cos.(c*xi) for xi in x)/d) + a +
exp(1)
end
| {"hexsha": "1413d5d2a81933adb8c585de6ea83191d3563d6c", "size": 166, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/problems/Ackley.jl", "max_stars_repo_name": "xh4/MOEA", "max_stars_repo_head_hexsha": "0953e9b4aa8aa1a0ceabc30b481eb954e1920621", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "ma... |
import unittest
import neuralnetsim
import numpy as np
class TestExponentialSchedule(unittest.TestCase):
def test_initial_t(self):
cooler = neuralnetsim.ExponentialCoolingSchedule(1.0, 1.0, 0)
self.assertAlmostEqual(1.0, cooler.step())
def test_step(self):
cooler = neuralnetsim.Expone... | {"hexsha": "a1909ece320a6095e640e18a4d03d243ef2a3e91", "size": 3088, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_cooling.py", "max_stars_repo_name": "Nathaniel-Rodriguez/neuralnetsim", "max_stars_repo_head_hexsha": "c353af92fb3f44539370220963b07bdfd9822149", "max_stars_repo_licenses": ["MIT"], "ma... |
# Copyright 2022 Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | {"hexsha": "54316926f763fb133581e4550870a1861130c9b3", "size": 6745, "ext": "py", "lang": "Python", "max_stars_repo_path": "lightweight_mmm/utils_test.py", "max_stars_repo_name": "juanitorduz/lightweight_mmm", "max_stars_repo_head_hexsha": "17a4c7fcd860902084ab04f6e58afefba6de5f22", "max_stars_repo_licenses": ["Apache-... |
#ifndef SUPERGENIUS_PRODUCTION_IMPL_HPP
#define SUPERGENIUS_PRODUCTION_IMPL_HPP
#include "verification/production.hpp"
#include <memory>
#include <boost/asio/basic_waitable_timer.hpp>
#include <outcome/outcome.hpp>
#include "application/app_state_manager.hpp"
#include "authorship/proposer.hpp"
#include "blockchain... | {"hexsha": "ccd963524048789c4892a78028bfd57a1ec83ea4", "size": 6128, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/verification/production/impl/production_impl.hpp", "max_stars_repo_name": "GeniusVentures/SuperGenius", "max_stars_repo_head_hexsha": "ae43304f4a2475498ef56c971296175acb88d0ee", "max_stars_repo_... |
import pyBigWig
import logging
import pandas as pd
import numpy as np
def prepare_BPNet_output_files(tasks, output_dir, chroms, chrom_sizes,
model_tag, exponentiate_counts, other_tags=[]):
""" prepare output bigWig files for writing bpnet predictions
a. Construct aprropriate... | {"hexsha": "558b9dff96c4ac121dd3609541409ce103561f6c", "size": 10705, "ext": "py", "lang": "Python", "max_stars_repo_path": "basepairmodels/cli/bigwigutils.py", "max_stars_repo_name": "erankotler/basepairmodels", "max_stars_repo_head_hexsha": "d848a787617bc6a698b887c55660d5dbee8d0074", "max_stars_repo_licenses": ["MIT"... |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
from scipy.stats import norm
import os
from astropy.io import fits
import sys
from sklearn.mixture import GMM
from pandas import DataFrame
import legacyanalysis.decals_sim_priors as priors
# Globals
xyrange=dict(x_star=[-0.5,2... | {"hexsha": "a2c2f68637edc13a6048e074ee6bed6ea8213224", "size": 7697, "ext": "py", "lang": "Python", "max_stars_repo_path": "py/obiwan/decals_sim_priors_plots.py", "max_stars_repo_name": "manera/legacypipe", "max_stars_repo_head_hexsha": "64dfe164fe1def50f5ad53784edd9a63321b0d45", "max_stars_repo_licenses": ["BSD-3-Clau... |
import networkx as nx
import json
from schematic.utils.curie_utils import extract_name_from_uri_or_curie
from schematic.utils.validate_utils import validate_class_schema
from schematic.utils.validate_rules_utils import validate_schema_rules
def load_schema_into_networkx(schema):
G = nx.MultiDiGraph()
for rec... | {"hexsha": "91334c48fccdbd1f5c7ca17f938cfd96b63dc97a", "size": 9478, "ext": "py", "lang": "Python", "max_stars_repo_path": "schematic/utils/schema_utils.py", "max_stars_repo_name": "linglp/schematic", "max_stars_repo_head_hexsha": "fd0308c43783ac8e367e8a5be0cc6e4bfbc44b29", "max_stars_repo_licenses": ["MIT"], "max_star... |
import Adapt
using Oceananigans: short_show
using Oceananigans.Utils: user_function_arguments
using Oceananigans.Operators: assumed_field_location, index_and_interp_dependencies
using Oceananigans.Fields: show_location
using Oceananigans.Utils: tupleit
"""
ContinuousForcing{X, Y, Z, P, F, D, I}
A callable object... | {"hexsha": "a36c561ec08a7b4b58bbd72d49333a9b2ef09d51", "size": 5743, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Forcings/continuous_forcing.jl", "max_stars_repo_name": "charleskawczynski/Oceananigans.jl", "max_stars_repo_head_hexsha": "c34e6cd2166bbaa057186ffa795d348c1802485f", "max_stars_repo_licenses":... |
import unittest
import h5py
import numpy as np
from bald.tests import BaldTestCase
def _fattrs(f):
f.attrs['bald__'] = 'http://binary_array_ld.net/experimental'
f.attrs['bald__type'] = 'bald__Container'
return f
def _create_parent_child(f, pshape, cshape):
dsetp = f.create_dataset("parent_dataset", ... | {"hexsha": "b182b70db70459c66012624e881d0079d4a45bc9", "size": 890, "ext": "py", "lang": "Python", "max_stars_repo_path": "lib/bald/tests/test_array_reference.py", "max_stars_repo_name": "marqh/bald", "max_stars_repo_head_hexsha": "5fc06ef5270e5f1d60ad73f90ac8781cf91c4b0b", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
# Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | {"hexsha": "ed121f5ea967d0166debba217f93a6293229fd16", "size": 2705, "ext": "py", "lang": "Python", "max_stars_repo_path": "numba_dppy/decorators.py", "max_stars_repo_name": "Rubtsowa/numba-dppy", "max_stars_repo_head_hexsha": "20f9825b144913ebe1f7635c785b334f3743c4cb", "max_stars_repo_licenses": ["Apache-2.0"], "max_s... |
import warnings
warnings.filterwarnings('ignore', category=DeprecationWarning)
import torch
torch.backends.cudnn.benchmark = True
import random
from pathlib import Path
import hydra
import numpy as np
import torch
import torch.utils.data
from dm_env import specs
import dmc
import utils
from logger import Logger
f... | {"hexsha": "60b90413f5e6d06ab6617d569f9d78ffff5073c4", "size": 8373, "ext": "py", "lang": "Python", "max_stars_repo_path": "train.py", "max_stars_repo_name": "medric49/sharingan", "max_stars_repo_head_hexsha": "f6b85118016d45456fc1467c6706731562c0f0d7", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_... |
!
! Module for parsing command line args
!
module args
use kinds, only : r_dp
use err, only : err_msg
implicit none
private
public :: args_parse, &
args_usage
contains
subroutine args_parse(i, j, k, niter, &
... | {"hexsha": "5b01027e4debb12d8c5719078d8b696f21858487", "size": 5394, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "OpenMP/Lab/jacobi/args.f90", "max_stars_repo_name": "rctraining/USGS-Advanced-HPC-Workshop", "max_stars_repo_head_hexsha": "4b206f6478fef8655eeffee025a43bb4414e7d83", "max_stars_repo_licenses": ... |
# encoding=utf-8
"""
imageai_prediction.py: predicting the class of an image with ImageAI library
@author: Manish Bhobe
My experiments with Python, Data Science, Machine Learning and Deep Learning
"""
from imageai.Prediction import ImagePrediction
import matplotlib.pyplot as plt
from PIL import Image
import ... | {"hexsha": "b669673dd98be2c4b464f660262af02c357f7e7e", "size": 2206, "ext": "py", "lang": "Python", "max_stars_repo_path": "imageai_prediction.py", "max_stars_repo_name": "mjbhobe/dl-articles-medium", "max_stars_repo_head_hexsha": "7fc3ee699117dd802e0c9715324de8c1a5898c9f", "max_stars_repo_licenses": ["MIT"], "max_star... |
program dyn_blob
use m_dyn, only: dyn_get
use m_dyn, only: dyn_put
use m_dyn, only: dyn_vect
use m_dyn, only: dyn_clean
use m_const, only: radius_earth
implicit none
character(len=*), parameter :: fname = 'bkg.eta.nc4'
character(len=*), parameter :: pname = 'fsens.eta.nc4'
character(len=*), parameter :: bname = ... | {"hexsha": "849f11b806bf7768604404d3d0f3513cb07956f2", "size": 7348, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "GMAO_hermes/dyn_blob.f90", "max_stars_repo_name": "GEOS-ESM/GMAO_Shared", "max_stars_repo_head_hexsha": "022af23abbc7883891006b57379be96d9a50df23", "max_stars_repo_licenses": ["NASA-1.3", "ECL-2... |
From Coq Require Import ZArith Psatz Bool String List FMaps.
From Coq Require Import FunctionalExtensionality.
From CDF Require Import Sequences IMP.
From CDF Require AbstrInterp.
Local Open Scope string_scope.
Local Open Scope Z_scope.
(** * 5. Static analysis by abstract interpretation, improved version *)
(** **... | {"author": "xavierleroy", "repo": "cdf-mech-sem", "sha": "f8dc6f7e2cb42f0861406b2fa113e2a7e825c5f3", "save_path": "github-repos/coq/xavierleroy-cdf-mech-sem", "path": "github-repos/coq/xavierleroy-cdf-mech-sem/cdf-mech-sem-f8dc6f7e2cb42f0861406b2fa113e2a7e825c5f3/AbstrInterp2.v"} |
import discord
from discord.ext import commands
from matplotlib import animation
from sympy.plotting import *
from utility.math_parser import parse_eq
import numpy as np
class Graph(commands.Cog):
"""
Contains various algebra tools
"""
def __init__(self, bot):
self.bot = bot
self.grap... | {"hexsha": "6815032580c3e0a7eb7945b6d99191ad8c29f9e4", "size": 2447, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/cogs/graph.py", "max_stars_repo_name": "RedPandaMath/redpanda", "max_stars_repo_head_hexsha": "e5afedeb2f27d4b79b8079857fc220965fab896b", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{changepage}% http://ctan.org/pkg/changepage
\usepackage{float}
\usepackage{fancyhdr}
\usepackage{lastpage}
\usepackage{graphicx}
\usepackage{ragged2e}
\usepackage{scrextend}
\usepackage{lastpage}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\rhead{... | {"hexsha": "f1f28cfc150fb27a5c49a85460832b4746c6168f", "size": 5405, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "manuscript/sci-rep/reviewer-letter/reviewer-response.tex", "max_stars_repo_name": "acetworld/bermuda-grass-metabolomics", "max_stars_repo_head_hexsha": "38785b9cf0099ee496236c5fa80552aaee9ab105", "m... |
!----------------------------------------------------------------
!*** Copyright Notice ***
!IMPACT-Z� Copyright (c) 2016, The Regents of the University of California, through
!Lawrence Berkeley National Laboratory (subject to receipt of any required approvals
!from the U.S. Dept. of Energy). All rights reserved.
!I... | {"hexsha": "5612a24438e7ba09573d217b0a87f7cd534cfd85", "size": 10715, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "examples/IMPACT-Z/impact-z-driver/main.f90", "max_stars_repo_name": "gptune/GPTune", "max_stars_repo_head_hexsha": "7ed5c63275da2d9625880c8eae837b8eb2d2df81", "max_stars_repo_licenses": ["BSD-3... |
import math
import numpy as np
from netCDF4 import Dataset
from pywrfplotParams import *
# constants used to calculate moist adiabatic lapse rate
# See formula 3.16 in Rogers&Yau
a = 2./7.
b = eps*L*L/(R*cp)
c = a*L/R
def gamma_s(T,p):
"""Calculates moist adiabatic lapse rate for T (Celsius) and p (Pa)
Note:... | {"hexsha": "0ff2f2dcf3a959a3533911964d760675c218b287", "size": 3161, "ext": "py", "lang": "Python", "max_stars_repo_path": "plotTools.py", "max_stars_repo_name": "vorcil/epicare", "max_stars_repo_head_hexsha": "3346663ce5c257caa125161c23535c16836502f2", "max_stars_repo_licenses": ["CC0-1.0"], "max_stars_count": null, "... |
import pytest
from polyfitter import Polyfitter
import numpy as np
from numpy.testing import assert_array_almost_equal
def test_get_morph():
"""Can we get the proper morphology type?"""
ID = 'OGLE-BLG-ECL-040474'
P=1.8995918
t0=7000.90650
path_to_ogle = 'http://ogledb.astrouw.edu.pl/~ogle/OCVS/d... | {"hexsha": "072d138d3b7609cafff2303fc088bb7b4da0ce7d", "size": 716, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_polyfit.py", "max_stars_repo_name": "astrobatty/polyfitter", "max_stars_repo_head_hexsha": "4c68edfacd6ef9518d970e949d1aa7c0d96a2ce9", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
[STATEMENT]
lemma range_to_fract_embed_poly: assumes "set (coeffs p) \<subseteq> range to_fract"
shows "p = map_poly to_fract (map_poly inv_embed p)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. p = map_poly to_fract (map_poly inv_embed p)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
1. p ... | {"llama_tokens": 765, "file": "Berlekamp_Zassenhaus_Unique_Factorization_Poly", "length": 10} |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 3 20:22:12 2020
@author: ramonpuga
"""
# K-Means
# Importar librerías de trabajao
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Cargamos los datos con pandas
dataset = pd.read_csv('Mall_Customers.csv')
X = dataset.iloc... | {"hexsha": "97045af5944e65ed6f419c3d9ac6b55f6da81341", "size": 4007, "ext": "py", "lang": "Python", "max_stars_repo_path": "datasets/Part 4 - Clustering/Section 24 - K-Means Clustering/my_kmeans.py", "max_stars_repo_name": "nylvam/machinelearning-az", "max_stars_repo_head_hexsha": "2ff139082b61ace5a94ef86517c84febee3b7... |
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import tqdm
means_0 = [0.1, 0.5, 0.9]
means_1 = [0.9, 0.5, 0.1]
maxMean = max(max(means_0), max(means_1))
nbArms = len(means_0)
horizon = 1000
def reward(arm, t):
if t <= horizon/2:
return np.random.binomial(1... | {"hexsha": "e24de5f6ce0b0cba5714fc38a0757a3069909d02", "size": 5677, "ext": "py", "lang": "Python", "max_stars_repo_path": "2-Chapters/6-Chapter/nonstatbandits/simulateForcedExploration.py", "max_stars_repo_name": "Naereen/phd-thesis", "max_stars_repo_head_hexsha": "0fa93ca0d738771f4215bc4aeb66157f2026ba00", "max_stars... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.