text stringlengths 0 1.25M | meta stringlengths 47 1.89k |
|---|---|
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | {"hexsha": "02f5b7c53b059ebe94dfa8c0da40c30be0251689", "size": 1594, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/kudu/util/bit-util-test.cc", "max_stars_repo_name": "AnupamaGupta01/kudu-1", "max_stars_repo_head_hexsha": "79ee29db5ac1b458468b11f16f57f124601788e6", "max_stars_repo_licenses": ["Apache-2.0"], "... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import map
import os
import glob
import fnmatch
from warnings import warn
import re
import zipfile
from six.moves import StringIO
import numpy as np
from pims.base_frames import Fram... | {"hexsha": "0956f081f3a7cd47bb7756d6f2e400f9135daf44", "size": 12268, "ext": "py", "lang": "Python", "max_stars_repo_path": "pims/image_sequence.py", "max_stars_repo_name": "sciunto/pims", "max_stars_repo_head_hexsha": "c98edfc78b229fa55d506f5e4474b4fa8019743c", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_stars_c... |
"""
Created: May 2018
@author: JerryX
Find more : https://www.zhihu.com/people/xu-jerry-82
"""
import numpy as np
class SGDOptimizer(object):
def __init__(self, optmParams, dataType):
# self.gamma, self.eps = optmParams
self.dataType = dataType
# self.isInited = False
... | {"hexsha": "6984cdb067943c7f1d7c365258f92d014bbabfad", "size": 9075, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/xDLbase/optimizers.py", "max_stars_repo_name": "AskyJx/xDeepLearning", "max_stars_repo_head_hexsha": "98d875a34c6b4f4a51dcb825998028fd36260848", "max_stars_repo_licenses": ["MIT"], "max_stars_... |
# -*- coding: UTF-8 -*-
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | {"hexsha": "2893dc33ce833f597d1f04311f8728d15112e606", "size": 4003, "ext": "py", "lang": "Python", "max_stars_repo_path": "paddlepalm/task_paradigm/cls.py", "max_stars_repo_name": "wangxiao1021/PALM", "max_stars_repo_head_hexsha": "f57e0efd68ac0bf5cb7545991a4eb9c43c29c21c", "max_stars_repo_licenses": ["Apache-2.0"], "... |
# https://deeplearningcourses.com/c/data-science-natural-language-processing-in-python
# https://www.udemy.com/data-science-natural-language-processing-in-python
# Author: http://lazyprogrammer.me
from __future__ import print_function, division
from future.utils import iteritems
from builtins import range
# Note: you ... | {"hexsha": "b5e60463de67b119fcc47ef8eb2785b6a6ca1f01", "size": 4118, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/nlp_class2/pretrained_glove.py", "max_stars_repo_name": "JouniVatanen/NLP-and-Deep-Learning", "max_stars_repo_head_hexsha": "2fddcc2c39787713d33d17e80565de4ed073ca60", "max_stars_repo_licenses... |
import numpy as np
from scipy import signal
from sklearn.base import BaseEstimator, TransformerMixin
from mne.filter import filter_data, construct_iir_filter, create_filter
def is_filter_stable(a):
"""Check if iir filter is stable, not for fir filters
Parameters
----------
a: ndarray
... | {"hexsha": "49236f1b1680dde90093102ad4d8917ebb5d7e76", "size": 8197, "ext": "py", "lang": "Python", "max_stars_repo_path": "buttleworth.py", "max_stars_repo_name": "Rebell-Leader/mi-eeg-diploma", "max_stars_repo_head_hexsha": "a650c2e37e3c3f61196b8b9c39aef2c930529207", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
import numpy as np
from sklearn import preprocessing
from sklearn.metrics import f1_score, log_loss
from sklearn.model_selection import cross_val_score
from sklearn.neural_network import MLPClassifier
from data import load_test_data, write_accuracy, write_logloss, \
load_train_data_with_PCA_per_type
from visualize... | {"hexsha": "f96417fb9ac31e6a8839430f840236464e4bcf6e", "size": 1931, "ext": "py", "lang": "Python", "max_stars_repo_path": "neural_network.py", "max_stars_repo_name": "Oltier/ML-Music-genre-labeling", "max_stars_repo_head_hexsha": "749fc277136be1fbec2bda105921966fcda4082a", "max_stars_repo_licenses": ["MIT"], "max_star... |
# set the directory path
import os,sys
import os.path as path
abs_path_pkg = path.abspath(path.join(__file__ ,"../../../../"))
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, abs_path_pkg)
from Py_FS.datasets import get_dataset
from Py_FS.wrapper.population_based.get_algorithm import get_alg... | {"hexsha": "b4badc8333fcaf914e7a4fa207f5c23abd576377", "size": 1984, "ext": "py", "lang": "Python", "max_stars_repo_path": "Py_FS/wrapper/population_based/_test.py", "max_stars_repo_name": "rishavpramanik/Feature-Selection", "max_stars_repo_head_hexsha": "afe96cb8271f1e86a77075d19ec107c37afbbff3", "max_stars_repo_licen... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This Parameters module is a container for all possible parameters and all ways in which they are adapted
by various optimization methods.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
__author__ = 'Sander van Rijn <svr003@gmail.... | {"hexsha": "e23d1a6a45b58f83d5597d3629298e8757e20787", "size": 19432, "ext": "py", "lang": "Python", "max_stars_repo_path": "modea/Parameters.py", "max_stars_repo_name": "sjvrijn/ModEA", "max_stars_repo_head_hexsha": "c59f77bacd460cdff5e2d05f20c5bb65efa07c50", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 2, "... |
[GOAL]
X : Type u
inst✝² : MetricSpace X
inst✝¹ : CompactSpace X
inst✝ : Nonempty X
p : NonemptyCompacts { x // x ∈ lp (fun n => ℝ) ⊤ }
⊢ Quotient.mk IsometryRel.setoid p = toGHSpace X ↔ ∃ Ψ, Isometry Ψ ∧ range Ψ = ↑p
[PROOFSTEP]
simp only [toGHSpace, Quotient.eq]
[GOAL]
X : Type u
inst✝² : MetricSpace X
inst✝¹ : Compa... | {"mathlib_filename": "Mathlib.Topology.MetricSpace.GromovHausdorff", "llama_tokens": 317325} |
# ------------------------------------------------------------------
# Licensed under the ISC License. See LICENSE in the project root.
# ------------------------------------------------------------------
"""
BallSampler(radius, [maxsize])
A method for sampling isolated points from spatial objects using
a ball ne... | {"hexsha": "3919030b0e68733f09055ae4e51c9e1fd4e2fb4e", "size": 1428, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/sampling/ball_sampler.jl", "max_stars_repo_name": "UnofficialJuliaMirrorSnapshots/GeoStatsBase.jl-323cb8eb-fbf6-51c0-afd0-f8fba70507b2", "max_stars_repo_head_hexsha": "45361a196106c707838527577... |
#%%
"""Demonstrate the effect of compressing the number of thresholds of a random
forest."""
import sys
from numpy.linalg import LinAlgError
from tqdm import tqdm
import os.path
import numpy as np
import xgboost as xgb
sys.path.insert(1, "..")
from datasets import load_data
import pandas as pd
from sklearn.model_... | {"hexsha": "67a86c4fe3c78e8fcdd2c9e5af4f664fcc32fcf9", "size": 3326, "ext": "py", "lang": "Python", "max_stars_repo_path": "notebooks/forest_compression_benchmark.py", "max_stars_repo_name": "RikVoorhaar/ttml", "max_stars_repo_head_hexsha": "3786cfc02976f7d6cd5f045f213e28793f4ece61", "max_stars_repo_licenses": ["Apache... |
#
# Atomic database using formal values of https://en.wikipedia.org/wiki/Standard_atomic_weight#:~:text=The%20standard%20atomic%20weight%20(A,atomic%20mass%20constant%20mu.
#
atomic_weight = Dict(
"h" => 1.008,
"he" => 4.0026,
"li" => 6.94,
"be" => 9.0122,
"b" => 10.81,
"c" => 12.0... | {"hexsha": "87cc778a0022d56abd08593bc752faa8d32f2d58", "size": 3006, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/Data.jl", "max_stars_repo_name": "SeleneSofi/MolarWeight.jl", "max_stars_repo_head_hexsha": "21d1b3b3a77601d442f14e84613d48f42ef1496b", "max_stars_repo_licenses": ["MIT"], "max_stars_count": nu... |
"Evaluate the model"""
import os
import nltk
import torch
import random
import logging
import argparse
import numpy as np
import utils as utils
from metrics import get_entities
from data_loader import DataLoader
from SequenceTagger import BertForSequenceTagging
parser = argparse.ArgumentParser()
parser.add_argument('-... | {"hexsha": "1cefea898b846e1d73ab147f971659cdf58a9e6b", "size": 3629, "ext": "py", "lang": "Python", "max_stars_repo_path": "interactive.py", "max_stars_repo_name": "ssabzzz/BERT-NER", "max_stars_repo_head_hexsha": "ab60d6afee2b5b4200149c6270823872fd8efecd", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "... |
import numpy as np
import sys
import time
import os
#from generation_model import Generation_model
class data_collection:
train_x_matrix = None
train_y_vector = None
valid_x_matrix = None
valid_y_vector = None
test_x_matrix = None
test_y_vector = None
train_y_matrix = None
valid_y_matr... | {"hexsha": "ce011d45cc819dd006392f36980b6913c1e00d3c", "size": 16805, "ext": "py", "lang": "Python", "max_stars_repo_path": "Baselines/mtsc_ca_sfcn/src/fileio/data_processing.py", "max_stars_repo_name": "JingweiZuo/SMATE", "max_stars_repo_head_hexsha": "d3e847038d9b7fb2bc08b3720b93f80b934e538d", "max_stars_repo_license... |
# #create one label
# #update it with images
# #create callback for mouse hover and click
# #register the clicked point
# #use a button for operations on registered pixel coord
import sys
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QLabel, QSlider
from PyQt5.QtGui import QIcon, QImage, QPixmap
from ... | {"hexsha": "499996364c36fa0825c54710f006dac58f9ec4e0", "size": 8568, "ext": "py", "lang": "Python", "max_stars_repo_path": "apps/volumeDensityViewer.py", "max_stars_repo_name": "mshafiei/cvutils", "max_stars_repo_head_hexsha": "5805229d8822a9ee4a3c63e060358aca96fe5338", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import argparse
from pathlib import Path
from typing import List, Optional
import numpy as np
from pycbc.types import TimeSeries, FrequencySeries
from command_line import path_to_dir
from gw_data import (
train_file,
training_labels_file,
FREQ_SERIES_DELTA_F,
NOISE_FILENAME,
N_SIGNALS,
SIGNAL_... | {"hexsha": "1893f3204450b7d4c6127341a3e6f0efe7fd7916", "size": 2108, "ext": "py", "lang": "Python", "max_stars_repo_path": "compute_noise.py", "max_stars_repo_name": "wisdom-parts/kaggle-gw", "max_stars_repo_head_hexsha": "12df76920e6e1cb5e0f2ffa80cd3f0f3b3586903", "max_stars_repo_licenses": ["MIT"], "max_stars_count":... |
subroutine scale_op(label_res,mode,idx_blk,fac,label_inp,nblk,
& op_info,orb_info,str_info)
*----------------------------------------------------------------------*
* scale blocks of operator list
* mode == 1:
* by factor fac,
* if nblk==-1, all blocks are scaled with the same factor
... | {"hexsha": "ad345608573a814997bb2f5b4131d9dc856a5171", "size": 5951, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "contract/scale_op.f", "max_stars_repo_name": "ak-ustutt/GeCCo-public", "max_stars_repo_head_hexsha": "8d43a6c9323aeba7eb54625b95553bfd4b2418c6", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
const ID = Int
const uidcounter = Counter(0)
# # __init__() = global uidcounter = Counter(0) #= also works =#
# __init__() = reset!(uidcounter)
"Unique id"
# uid() = (global uidcounter; @show increment!(uidcounter))
uid() = increment!(uidcounter)
@spec :nocheck (x = [uid() for i = 1:Inf]; unique(x) == x)
"Construc... | {"hexsha": "7ecc6402d983b6b70e5ac6bb4e414bf96d559017", "size": 382, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/space/idgen.jl", "max_stars_repo_name": "UnofficialJuliaMirror/Omega.jl-1af16e33-887a-59b3-8344-18f1671b3ade", "max_stars_repo_head_hexsha": "9dbaa559991a728e8239767d9627419e41037847", "max_star... |
import numpy as np
import pandas as pd
import pandas.api.types as ptypes
def cast_to_dateime(df, columns=None, format=None, return_df=False):
""" Given a list of columns, cast them to datetime
Parameters
----------
df : Pandas DataFrame
A dataframe containing the data to transform
colu... | {"hexsha": "d512f9813b8bcf6fa544584bcaf45f6e91f75298", "size": 1456, "ext": "py", "lang": "Python", "max_stars_repo_path": "data_science_toolbox/pandas/datetime/cast_to_datetime.py", "max_stars_repo_name": "safurrier/data_science_utils", "max_stars_repo_head_hexsha": "842b025ea3197e8a9946401257b2fa22ef1bf82d", "max_sta... |
import spira.all as spira
import numpy as np
from spira.yevon.geometry import shapes
from spira.yevon.geometry.route.route_shaper import RouteSimple
from spira.yevon.geometry.route.route_shaper import RouteGeneral
from spira.yevon.utils.geometry import scale_coord_up as scu
from spira.yevon.geometry.route.manhattan imp... | {"hexsha": "6a94cbe1e93fb8e97fcfe35dea25760343b9eff4", "size": 14918, "ext": "py", "lang": "Python", "max_stars_repo_path": "spira/yevon/geometry/route/manhattan180.py", "max_stars_repo_name": "JCoetzee123/spira", "max_stars_repo_head_hexsha": "dae08feba1578ecc8745b45109f4fb7bef374546", "max_stars_repo_licenses": ["MIT... |
x <= not (c or b or a);
| {"hexsha": "1a63b41f1c7245442023cf3307b75877a96b2adb", "size": 24, "ext": "f", "lang": "FORTRAN", "max_stars_repo_path": "tests/f/opt3_not_or.f", "max_stars_repo_name": "Deshiuu/351lab-code-copy", "max_stars_repo_head_hexsha": "4d1fdf1f119c6798332c662dee99dd29d7a01520", "max_stars_repo_licenses": ["BSD-4-Clause-UC"], "... |
from __future__ import print_function, division
import itertools
from copy import deepcopy
from collections import OrderedDict
from warnings import warn
import pickle
import nilmtk
import pandas as pd
import numpy as np
from hmmlearn import hmm
from nilmtk.feature_detectors import cluster
from nilmtk.disaggregate impo... | {"hexsha": "e556a741660c55fac80e20bc960ae978acd5dbe5", "size": 10331, "ext": "py", "lang": "Python", "max_stars_repo_path": "nilmtk_contrib/disaggregate/fhmm_exact.py", "max_stars_repo_name": "research-at-scuiot/nilmtk-contrib", "max_stars_repo_head_hexsha": "1e9907313eaa8ab9906b8d0edaf85a8155317d82", "max_stars_repo_l... |
\iffalse
Noether's theorem says that continuous symmetries of physical systems gives rise to conservation laws. In this class we'll see some examples of low dimensional Lie groups and how they give rise to various phenomenon in physics like time dilation and length contraction in special relativity, spin states of elec... | {"hexsha": "12f566892291d8faf214f54ce7660d7320dfd896", "size": 15045, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "03 Symmetries of Spaces/02 Rotations.tex", "max_stars_repo_name": "apurvnakade/mc2017", "max_stars_repo_head_hexsha": "ebec59bce5ee1979872e0f37208da6abd91dbb75", "max_stars_repo_licenses": ["MIT"],... |
import numpy as np
import pandas as pd
def get_agg_data(grouped_data, agg_method):
if agg_method == 'mean':
agg_data = grouped_data.mean()
elif agg_method == 'median':
agg_data = grouped_data.median()
else:
raise NotImplementedError()
return agg_data
def get_error(grouped_dat... | {"hexsha": "51ce506613eb4bac07f969ddfa842006bd5097ce", "size": 7660, "ext": "py", "lang": "Python", "max_stars_repo_path": "simianpy/plotting/catplot.py", "max_stars_repo_name": "jselvan/simianpy", "max_stars_repo_head_hexsha": "5b2b162789e11bc89ca2179358ab682269e7df15", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
import numpy as np
import torch
import torch.nn as nn
from utils.REDutils import fspecial_gauss
class Downsampler(nn.Module):
"""
http://www.realitypixels.com/turk/computergraphics/ResamplingFilters.pdf
"""
def __init__(self, n_planes, factor, kernel_type, phase=0, kernel_width=None, support=None... | {"hexsha": "03b5463029f0871332b0e9656a00261cba31cb66", "size": 5524, "ext": "py", "lang": "Python", "max_stars_repo_path": "models/downsampler.py", "max_stars_repo_name": "gistvision/DIPsureWithSTE", "max_stars_repo_head_hexsha": "853faac97a451e6430b47f4d4da54c6d08a7ee50", "max_stars_repo_licenses": ["MIT"], "max_stars... |
function points_to_field(x::AbstractArray{T}, wp::WaveletParams) where T <: AbstractFloat
ws = wp.ws
n = size(x, 2)
N = length(ws)
a = x[1, :]
b = x[2, :]
aw = a * ws'
bw = b * ws'
c = reshape(aw, n, 1, N) .+ reshape(bw, n, N, 1)
m = sum(t -> cis(-T(2π) * t), c, dims=1)
res... | {"hexsha": "2cf47a27e790a69b67b8aee8f1b67cf0e185e723", "size": 2886, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/wavelet_functions.jl", "max_stars_repo_name": "LexaLutyi/PointProcessWavelet.jl", "max_stars_repo_head_hexsha": "3b33cd386bdb9d3f41bc255eac0e1fb98ad91d72", "max_stars_repo_licenses": ["MIT"], "... |
#!/usr/bin/env python
# coding=utf-8
"""
Script to enrich input txt data file with number of apartments and total
occupants per building, based on year of construction and available net
floor area
(Zensusdatenbank Zensus 2011 der Statistischen Ämter des Bundes und der Länder
Represented by
Bayerisches Landesamt für St... | {"hexsha": "adbb3d0f4062378a95fd54e98ed872993b465d37", "size": 21209, "ext": "py", "lang": "Python", "max_stars_repo_path": "pycity_calc/toolbox/data_enrichment/occupants/old/Calc_Buildingoccupancy.py", "max_stars_repo_name": "RWTH-EBC/pyCity_calc", "max_stars_repo_head_hexsha": "99fd0dab7f9a9030fd84ba4715753364662927e... |
"""Module containing image segmentation functions.
Example usage:
>>> import numpy as np
>>> from jicbioimage.core.image import Image
>>> ar = np.array([[1, 1, 0, 0, 0],
... [1, 1, 0, 0, 0],
... [0, 0, 0, 0, 0],
... [0, 0, 2, 2, 2],
... [0, 0, 2, 2, 2]], dty... | {"hexsha": "856830e710c00794423a433b7c7abec563d9f7d5", "size": 9392, "ext": "py", "lang": "Python", "max_stars_repo_path": "jicbioimage/segment/__init__.py", "max_stars_repo_name": "JIC-CSB/jicbioimage.segment", "max_stars_repo_head_hexsha": "289e5ab834913326a097e57bea458ea0737efb0c", "max_stars_repo_licenses": ["MIT"]... |
import IMLearn.learners.regressors.linear_regression
from IMLearn.learners.regressors import PolynomialFitting
from IMLearn.utils import split_train_test
import numpy as np
import pandas as pd
import plotly.express as px
import plotly.io as pio
import matplotlib.pyplot as plt
pio.templates.default = "simple_white"
... | {"hexsha": "83df1eebd6025e9d86dee8c7bf5b2b9d7585ae2c", "size": 4020, "ext": "py", "lang": "Python", "max_stars_repo_path": "exercises/city_temperature_prediction.py", "max_stars_repo_name": "wolfo1/IML.HUJI", "max_stars_repo_head_hexsha": "0b32e552774d0be747547ab8b3eedbcd19cc11e7", "max_stars_repo_licenses": ["MIT"], "... |
function nl_eqs!(du,u,p,t)
nx::Int,ny::Int,A::Array{ComplexF64,1},B::Array{ComplexF64,2},Cp::Array{Float64,4},Cm::Array{Float64,4} = p
du .= 0.0 + 0.0im
# @views du[ny:end,1] = A[ny:end]
# constant terms
@inbounds for n=1:1:ny-1
du[n+ny,1] += A[n+ny]
end
# linear terms
@inb... | {"hexsha": "a76d565c51d892e2d2845c1e035e2e1376408876", "size": 9234, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/equations.jl", "max_stars_repo_name": "artagnon/ZonalFlow.jl", "max_stars_repo_head_hexsha": "e89d832e5c8ebf32db9195d9c1cd5b68d21c1c69", "max_stars_repo_licenses": ["MIT"], "max_stars_count": n... |
import numpy as np
import pandas as pd
import ipywidgets as W
import plotly.express as px
from tqdm import tqdm
from IPython.display import display
from .io import ms_file_to_df
class ManualRetentionTimeOptimizer():
def __init__(self, mint):
self.df = pd.concat( [ms_file_to_df(fn).assign(ms_fi... | {"hexsha": "81f13b4d484d442d39720b4cb9da6606ee026454", "size": 3051, "ext": "py", "lang": "Python", "max_stars_repo_path": "ms_mint/peak_optimization/ManualRetentionTimeOptimizer.py", "max_stars_repo_name": "luis-ponce/ms-mint", "max_stars_repo_head_hexsha": "cefd0d455c6658bf8c737160bd7253bb147c9c14", "max_stars_repo_l... |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from numpy.testing import assert_allclose
from astropy.tests.helper import pytest, catch_warnings
from astropy.utils.exceptions... | {"hexsha": "962be479942f5c7f88b97d02a213cf140fc9d9bb", "size": 5051, "ext": "py", "lang": "Python", "max_stars_repo_path": "photutils/segmentation/tests/test_deblend.py", "max_stars_repo_name": "barentsen/photutils", "max_stars_repo_head_hexsha": "57cbe18c8c1b8b08c93daa3d5c8dd74c10c3daae", "max_stars_repo_licenses": ["... |
# ---
# title: 373. Find K Pairs with Smallest Sums
# id: problem373
# author: Indigo
# date: 2021-06-14
# difficulty: Medium
# categories: Heap
# link: <https://leetcode.com/problems/find-k-pairs-with-smallest-sums/description/>
# hidden: true
# ---
#
# You are given two integer arrays **nums1** and **nums2** sorted ... | {"hexsha": "a86e8477552286a77009617fabdfdec3dad79a6c", "size": 1675, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/problems/373.find-k-pairs-with-smallest-sums.jl", "max_stars_repo_name": "jmmshn/LeetCode.jl", "max_stars_repo_head_hexsha": "dd2f34af8d253b071e8a36823d390e52ad07ab2e", "max_stars_repo_licenses... |
"""
Module to provide disaggregation functionality.
"""
from pathlib import Path
from datetime import datetime, timedelta
import os.path
import numpy as np
from netCDF4 import Dataset
from core import err_handler
test_enabled = True
def disaggregate_factory(ConfigOptions):
if len(ConfigOptions.supp_precip_forci... | {"hexsha": "59018a011906775d1013ea968f45798a336b5686", "size": 8536, "ext": "py", "lang": "Python", "max_stars_repo_path": "core/disaggregateMod.py", "max_stars_repo_name": "champham/WrfHydroForcing", "max_stars_repo_head_hexsha": "90f1cbcc233eb007818ae159be81814e5754f233", "max_stars_repo_licenses": ["BSD-3-Clause"], ... |
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits import mplot3d
def visualize_position(experiment_name):
output_folder = "Experiment_Output/" + experiment_name + "/"
f = open(output_folder + "positions.txt", "r")
T, X, Y, Z = [], [], [], []
first_line = True
first_ts = 0
... | {"hexsha": "4bc80d67f9f171d07bf8adb36642dec3809ac0c6", "size": 934, "ext": "py", "lang": "Python", "max_stars_repo_path": "VisualizePositions.py", "max_stars_repo_name": "SunBangjie/smartphone_pairing", "max_stars_repo_head_hexsha": "633f80961be1a213e82077d2e5fd08f0cdf2453b", "max_stars_repo_licenses": ["MIT"], "max_st... |
using Revise
using Dice
using Dice: num_flips, num_nodes, ifelse
# Number of nodes SBK needs to model a distribution on n bits
sbk_num_nodes(n) = 2^n * (n - 1) + 3
function generate_code_sbk(p::Vector{Float64})
@dice begin
function helper(i)
if i == length(p)
DistInt(i - 1)
... | {"hexsha": "adcd0f32d4b209882bb518c1d8f4a822b3fc61fe", "size": 2057, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "examples/sbk_num_nodes.jl", "max_stars_repo_name": "rtjoa/Dice.jl", "max_stars_repo_head_hexsha": "839b906edbe6a1b51c723211533b3145700406b6", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_c... |
from functools import cached_property
from sympy import symbols
from engine.functions import OrbitalFrame
class SymbolicOrbit:
def __init__(self, primary_body, secondary_body):
self.primary_body = primary_body
self.secondary_body = secondary_body
self.eccentricity = symbols(f"e_{seconda... | {"hexsha": "a466d509d59f9b39d6e218e6bb3e2594cf73d257", "size": 983, "ext": "py", "lang": "Python", "max_stars_repo_path": "python/engine/symbolic_orbit.py", "max_stars_repo_name": "RomainEndelin/keplerian_orbits", "max_stars_repo_head_hexsha": "3380e5d9a1006e73580cf3a86cb10845196c405d", "max_stars_repo_licenses": ["MIT... |
import sys
import os
import platform
import logging
import shutil
import time
import glob
import numpy as np
from Bio import SeqIO, pairwise2
from Bio.PDB import *
sys.path.append('../../')
from config import *
sys.path.append(scripts_dir)
from my_log import *
from classes import *
def prepare_executables():
if o... | {"hexsha": "4357e470ccbfd02f100f37a07e9798f61a22ab9d", "size": 31492, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/scripts/utils.py", "max_stars_repo_name": "ucfcbb/RNAMotifContrast", "max_stars_repo_head_hexsha": "a5e643a760a9f2f2c7fab76f65617e4f1f66eeb6", "max_stars_repo_licenses": ["MIT"], "max_stars_c... |
# standard lib
import copy
import random
import itertools
from collections.abc import Sequence
# 3rd-parth lib
import numpy as np
# local lib
from .base_model_sampler import MODEL_SAMPLERS, BaseModelSampler
@MODEL_SAMPLERS.register_module('range')
class RangeModelSampler(BaseModelSampler):
""" Range model sampl... | {"hexsha": "1b90de3c5846d8cc0cffed2ebf8cca531e7212b5", "size": 10166, "ext": "py", "lang": "Python", "max_stars_repo_path": "gaiavision/model_space/model_samplers/random_model_sampler.py", "max_stars_repo_name": "NickChang97/GAIA-cv", "max_stars_repo_head_hexsha": "b691af89813ffa6a1d1e1719c6dd0ec4c253d2bf", "max_stars_... |
// Copyright 2014 Quartz Technologies, Ltd. 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 o... | {"hexsha": "942fbb10178826ae17f433cfa710cd4f76a571c4", "size": 2601, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "v8bridge/native/native_endpoint.hpp", "max_stars_repo_name": "QuartzTechnologies/v8bridge", "max_stars_repo_head_hexsha": "5e2f2d6b93adae25295b88c0c4e0eb4f93e22057", "max_stars_repo_licenses": ["BSL... |
#!/usr/bin/env python
# coding: utf-8
'''
code for arid6 dataset
you should change
X = np.load('./X_17296_new.npy')
y = np.load('./y_17296_new.npy')
to your own dataset path
than shell 'python mgrForest_arid5.py'
'''
import numpy as np
import matplotlib.pyplot as plt
import pickle
from sklearn.ensemble import ... | {"hexsha": "73d99b98027c6e87baf5caadad7e727248ee6ced", "size": 10464, "ext": "py", "lang": "Python", "max_stars_repo_path": "mgrForest_arid5.py", "max_stars_repo_name": "qianmingduowan/A-Multi-dimensional-Multi-grained-Residual-Forest", "max_stars_repo_head_hexsha": "e38f2fd3d6b30853df816e9478c02163cb4023f8", "max_star... |
import torch
from torch.utils.data import DataLoader
import data
import models
import configargparse
from tensorboardX import SummaryWriter
import os
from output import OutputWriter
import numpy as np
import random
try:
from tqdm import tqdm
except ImportError:
def tqdm(sequence, *args, **kwargs):
retu... | {"hexsha": "29e77600817e98018b114b36a024cb73a5c55934", "size": 12442, "ext": "py", "lang": "Python", "max_stars_repo_path": "train_jmt.py", "max_stars_repo_name": "Vansil/SMNLS", "max_stars_repo_head_hexsha": "0d0118927d209ebe8d4ff0b1f73a90e9519edde9", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "max_s... |
!***********************************************************************
! *
SUBROUTINE MANEIG(IATJPO, IASPAR)
! *
! This module manages the operation of the eigensolvers ... | {"hexsha": "2a1ee57d6d1a15d117eb9d5afa5b230ab5422ebd", "size": 22246, "ext": "f90", "lang": "FORTRAN", "max_stars_repo_path": "src/appl/rci90/maneig.f90", "max_stars_repo_name": "sylas/grasp-continuum", "max_stars_repo_head_hexsha": "f5e2fb18bb2bca4f715072190bf455fba889320f", "max_stars_repo_licenses": ["MIT"], "max_st... |
###############################################################################
# Copyright 2018 Google LLC #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
... | {"hexsha": "2ff837d458a0a273bf6d983d4779a0ff4599b868", "size": 7834, "ext": "py", "lang": "Python", "max_stars_repo_path": "trustscore_annotated.py", "max_stars_repo_name": "SarahGillespie/R_trustscores", "max_stars_repo_head_hexsha": "8b08b7a4fbe684eabf88ddaff52a73e6a4c8bc3a", "max_stars_repo_licenses": ["Apache-2.0",... |
import ctypes.util
from ctypes import *
import networkx as nx
import numpy as np
import os
from .TACSim import node_edge_adjacency, normalized
__all__ = ['tacsim_in_C', 'tacsim_combined_in_C']
def find_clib():
# Find and load tacsim library
tacsimlib = ctypes.util.find_library('tacsim')
if not tacsimli... | {"hexsha": "6eb2651586188c2cb7163e17ca088f8ceabce04f", "size": 7083, "ext": "py", "lang": "Python", "max_stars_repo_path": "graphsim/iter/TACSim_in_C.py", "max_stars_repo_name": "vishalbelsare/graphsim", "max_stars_repo_head_hexsha": "1ecd23608fe562d5f363cae2323c1916e82ba4e9", "max_stars_repo_licenses": ["BSD-3-Clause"... |
# coding: utf8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | {"hexsha": "58108bbacfc02422bd9e80dd93d53252694cec1e", "size": 12916, "ext": "py", "lang": "Python", "max_stars_repo_path": "examples/meter_reader/reader_infer.py", "max_stars_repo_name": "yaoshanliang/PaddleX", "max_stars_repo_head_hexsha": "fe40b6d10db0e4d46f3a73cc5e83c3236d6a5842", "max_stars_repo_licenses": ["Apach... |
"""
Test of integrating torch Conv2d and LSTM modules
"""
from numbers import Number
import numpy as np
import torch
import torch.nn as nn
if __name__ == "__main__":
MAX_LENGTH = 100
MIN_LENGTH = 10
NUM_SAMPLES = 45
CHANNELS = 3
WIDTH = 128
HEIGHT = 128
HIDDEN_SIZE = 32
HIDDEN_LAYERS =... | {"hexsha": "207c650667b984ea44940e465f0f1eab71467767", "size": 2956, "ext": "py", "lang": "Python", "max_stars_repo_path": "junk/conv_lstm_test.py", "max_stars_repo_name": "oliehoek-research/interactive_agents", "max_stars_repo_head_hexsha": "fddf99fed8e6aaf213c658897c2e232fe5323053", "max_stars_repo_licenses": ["MIT"]... |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra.
//
// Copyright (C) 2017 Viktor Csomor <viktor.csomor@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtai... | {"hexsha": "0ab2b778662c5bfb648599d9883f72e8b75cd647", "size": 1915, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "third_party/eigen3/include/unsupported/test/cxx11_tensor_move.cpp", "max_stars_repo_name": "Shamraev/motion_imitation", "max_stars_repo_head_hexsha": "9b9166436e4996e2a03b36d19f4f5422cde9c21e", "max... |
#%%
import numpy as np
def VAR(r,alpha):
return -np.quantile(r,alpha)
def CVAR(r,alpha):
return -np.mean(r[r <= np.quantile(r,alpha)])
| {"hexsha": "337c2eb4f646a5f8e5adff635383500432a36526", "size": 151, "ext": "py", "lang": "Python", "max_stars_repo_path": "value_at_risk/functions.py", "max_stars_repo_name": "dylan-lee94/statistics", "max_stars_repo_head_hexsha": "0808c7e86ca752774edbbe3bc504d8338cc5f2ae", "max_stars_repo_licenses": ["MIT"], "max_star... |
import os
import numpy as np
import Bio.PDB as PDB
from .utilities.metric import get_residues_nearby
from .FileNormalizer import FileNormalizer
from .FileNormalizer import UpdatePDBNormalizer
class LoopFileNormalizer(FileNormalizer):
'''LoopFileNormalizer creates Rosetta loop files based on the
candidate_loop... | {"hexsha": "4aa104981ac71f4809bb83fab40678856ccdba45", "size": 5162, "ext": "py", "lang": "Python", "max_stars_repo_path": "benchmark_constructor/file_normalizers/LoopFileNormalizer.py", "max_stars_repo_name": "Kortemme-Lab/benchmark_set_construct", "max_stars_repo_head_hexsha": "ee6c9e097ff49d370936b41f102ada006fb4441... |
module Structure.Operator.Field.VectorSpace where
import Lvl
open import Structure.Setoid
open import Structure.Operator.Field
open import Structure.Operator.Properties using (associativity ; identityₗ ; distributivityᵣ)
open import Structure.Operator.Vector
open import Structure.Operator
open import Type
privat... | {"hexsha": "74210b12b4aec24d32a9c3bd9163a46cd6d49820", "size": 1077, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Structure/Operator/Field/VectorSpace.agda", "max_stars_repo_name": "Lolirofle/stuff-in-agda", "max_stars_repo_head_hexsha": "70f4fba849f2fd779c5aaa5af122ccb6a5b271ba", "max_stars_repo_licenses": [... |
import copy
import numpy as np
import opytimizer.math.random as r
import opytimizer.utils.history as h
import opytimizer.utils.logging as l
from opytimizer.core.optimizer import Optimizer
logger = l.get_logger(__name__)
class ABC(Optimizer):
"""An ABC class, inherited from Optimizer.
This will be the desi... | {"hexsha": "bc7f2660f740addba844d6a4cd90509e74a1d213", "size": 8994, "ext": "py", "lang": "Python", "max_stars_repo_path": "opytimizer/optimizers/abc.py", "max_stars_repo_name": "macoldibelli/opytimizer", "max_stars_repo_head_hexsha": "ca0574d520ecc17b1ac875bc6271d466c88d18ac", "max_stars_repo_licenses": ["MIT"], "max_... |
# Copyright (c) 2020 Club Raiders Project
# https://github.com/HausReport/ClubRaiders
#
# SPDX-License-Identifier: BSD-3-Clause
from typing import List
from typing import Tuple
from numpy import *
from craid.club.regions.Region import Region
from craid.club.regions.SphericalRegion import SphericalRegion
class... | {"hexsha": "bae93db3beaf6ae266b9fab594de507b56ed8712", "size": 1741, "ext": "py", "lang": "Python", "max_stars_repo_path": "craid/club/regions/MultiSphericalRegion.py", "max_stars_repo_name": "HausReport/ClubRaiders", "max_stars_repo_head_hexsha": "88bd64d2512302ca2b391b48979b6e88b092eb92", "max_stars_repo_licenses": [... |
import os
import torch
from ncc import (tasks, LOGGER)
from ncc.utils import utils
from ncc.utils.checkpoint_utils import load_checkpoint_to_cpu
from ncc.utils.file_ops.yaml_io import (
recursive_contractuser,
recursive_expanduser,
)
def load_state(model_path):
state = load_checkpoint_to_cpu(model_path,... | {"hexsha": "002c049b6ff26bde9dcf7ffef4b42d42de8e017e", "size": 5237, "ext": "py", "lang": "Python", "max_stars_repo_path": "cli/predictor.py", "max_stars_repo_name": "CGCL-codes/naturalcc", "max_stars_repo_head_hexsha": "7bab9a97331fafac1235fb32de829ff8d572320f", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 7... |
import os.path
import cv2
import numpy as np
import collections
from qimage2ndarray import rgb_view, alpha_view, array2qimage, byte_view
from PyQt5.QtCore import Qt, QRectF, pyqtSignal, QT_VERSION_STR, QPoint
from PyQt5.QtGui import QImage, QPixmap, QPainterPath, QPainter, QColor, QPen
from PyQt5.QtWidgets import QGrap... | {"hexsha": "2d9922bf62b4ca7656d74d2dbb1ebbeff2333fa7", "size": 40552, "ext": "py", "lang": "Python", "max_stars_repo_path": "ui_lib/QtImageAnnotator.py", "max_stars_repo_name": "extall/datm-annotation-tool", "max_stars_repo_head_hexsha": "7fe5a9648a94744e93f18af80fde020f8f0768eb", "max_stars_repo_licenses": ["MIT"], "m... |
#!/usr/bin/env python3
import keras
from keras.applications.nasnet import preprocess_input, NASNetLarge
#from keras_applications.resnet import ResNet50, ResNet101, ResNet152
from keras.applications.resnet50 import ResNet50
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers impor... | {"hexsha": "6209efcc19571305cfa0372ab5b81a11732ccbe5", "size": 3129, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/keras_applications.py", "max_stars_repo_name": "chriswmann/keras-applications-gpu-stress-test", "max_stars_repo_head_hexsha": "1e79b2e69edf557f788832540678fb06fcb77512", "max_stars_repo_licen... |
import numpy as np
from numpy import convolve
import matplotlib.pyplot as plt
def movingaverage(values, window):
weights = np.repeat(1.0, window)/window
sma = np.convolve(values, weights, 'valid')
return sma
def moving_fun(dataframe, col, blanking, duration, newname='movmin', fun=min):
"""blanking: ... | {"hexsha": "cead7da917b2f838d5283c887709044cb04d3894", "size": 1755, "ext": "py", "lang": "Python", "max_stars_repo_path": "quickndirtybot/strategies/util.py", "max_stars_repo_name": "Heerpa/quickndirtybot", "max_stars_repo_head_hexsha": "d0ca6f2d0e33f2b7642c81efec7d4d406aa85a14", "max_stars_repo_licenses": ["BSD-3-Cla... |
library(knitr)
library(rvest)
library(gsubfn)
library(reshape2)
library(shiny)
library(tidyr)
library(dygraphs)
library(xts)
library(tidyverse)
library(lubridate)
library(tmap)
library("readxl")
library("openxlsx")
source("https://raw.githubusercontent.com/jaanos/APPR-2019-20/master/lib/uvozi.zemljevid.r")
# Uvozimo f... | {"hexsha": "a7038937238d9d1cb00a8c6f10a8862c9df81793", "size": 411, "ext": "r", "lang": "R", "max_stars_repo_path": "lib/libraries.r", "max_stars_repo_name": "OkornA18/APPR-2019-20", "max_stars_repo_head_hexsha": "bb5cd8126a581978c434a7bb941e1bf3fb8c1e56", "max_stars_repo_licenses": ["MIT"], "max_stars_count": null, "m... |
[STATEMENT]
lemma infinite_cball:
fixes a :: "'a::euclidean_space"
assumes "r > 0"
shows "infinite (cball a r)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. infinite (cball a r)
[PROOF STEP]
using uncountable_cball[OF assms, THEN uncountable_infinite,of a]
[PROOF STATE]
proof (prove)
using this:
infinite (c... | {"llama_tokens": 164, "file": "Count_Complex_Roots_Count_Line", "length": 2} |
#include <boost/test/unit_test.hpp>
#include "unbounded_ordered/node/unbounded_ordered_node.hpp"
struct NodePropertiesTest {
typedef unbounded_ordered::node<int> nodeint;
NodePropertiesTest() {}
~NodePropertiesTest() {}
};
BOOST_FIXTURE_TEST_SUITE( node_properties_suite, NodePropertiesTest )
BOOST_AUTO_TEST_C... | {"hexsha": "1e786b0c551ad9cb339dc2c3bf48c2ef5464fb7e", "size": 1038, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "tst/node/node_properties_test.cpp", "max_stars_repo_name": "lejeuneretif/unbounded-ordered-tree", "max_stars_repo_head_hexsha": "0e4a431ee0b1228295c651858449005eb3e5c813", "max_stars_repo_licenses":... |
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import caffe
caffe.set_device(0)
caffe.set_mode_gpu()
net = caffe.Net('conv.prototxt', caffe.TEST)
# network arch
print(net.blobs['data'])
for k, v in net.blobs.items():
print(k, v.data.shape)
# params
print("weights: ", net.params['conv'... | {"hexsha": "ba876cfd54ceab7c8a68820445f0de2202ff899c", "size": 611, "ext": "py", "lang": "Python", "max_stars_repo_path": "memos/caffe/cnn.py", "max_stars_repo_name": "Bingwen-Hu/hackaway", "max_stars_repo_head_hexsha": "69727d76fd652390d9660e9ea4354ba5cc76dd5c", "max_stars_repo_licenses": ["BSD-2-Clause"], "max_stars_... |
import gym
import numpy as np
from maze import *
from matplotlib import pyplot as plt
from evaluationCar import *
from evaluationREINFORCE import *
env = gym.make("MountainCarContinuous-v0")
observation = env.reset()
env._max_episode_steps = 2000
discount = 0.9
# get the actionsSpace
# [position]
actionSpace = env.ac... | {"hexsha": "913bf56ac2eb98a6027c5992ffced5687b8d97f3", "size": 6635, "ext": "py", "lang": "Python", "max_stars_repo_path": "car.py", "max_stars_repo_name": "RajatBhageria/Reinforcement-Learning", "max_stars_repo_head_hexsha": "5b49b697345257d9346dc699663265fdb1401c33", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
#!/usr/bin/env python
# encoding: utf-8
"""
gmconvert.py
Created by Brant Faircloth on 28 April 2011.
Copyright 2011 Brant C. Faircloth. All rights reserved.
"""
import pdb
import os
import sys
import copy
import optparse
import numpy
import la
from openpyxl.workbook import Workbook
from openpyxl.cell import get_co... | {"hexsha": "d5128650e99b0e5f42f9439c944016dc3fe8a618", "size": 8153, "ext": "py", "lang": "Python", "max_stars_repo_path": "cli/gmconvert.py", "max_stars_repo_name": "brantfaircloth/gmconvert", "max_stars_repo_head_hexsha": "7ffa70dab4a13bfef93cc74912535ec843338ea2", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_st... |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
from matplotlib import pyplot as plt
import numpy as np
import math
from matplotlib import animation
import argparse
# All the argument parsing
parser = argparse.ArgumentParser()
parser.add_argument("--width", help="(int) width of output", type=int, default=160)
parser.ad... | {"hexsha": "98d875303c57e7877ae46c08b8913cbc22995c1f", "size": 5638, "ext": "py", "lang": "Python", "max_stars_repo_path": "hyperspace.py", "max_stars_repo_name": "BenWheatley/Hyperspace-tunnel", "max_stars_repo_head_hexsha": "b31aa137c4f807141e1da91e82da03006e61cdde", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
[STATEMENT]
lemma usubstappf_antimon: "V\<subseteq>U \<Longrightarrow> usubstappf \<sigma> U \<phi> \<noteq> undeff \<Longrightarrow> usubstappf \<sigma> U \<phi> = usubstappf \<sigma> V \<phi>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<lbrakk>V \<subseteq> U; usubstappf \<sigma> U \<phi> \<noteq> undeff\<rbr... | {"llama_tokens": 442, "file": "Differential_Game_Logic_USubst", "length": 2} |
# Introduction
Molecular energy levels are determined by electronic, vibrational and rotational levels. Spectral lines are dense and they form so called band spectra. Within single band, referent point is determined by electronic or vibrational level. Selection rules for rotational spectra is $\Delta J = 0, \pm 1$, wi... | {"hexsha": "3e4399ab11fa02213385a6acdf598b148a430528", "size": 28931, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "Physics of Molecules/src/Fortan diagrams.ipynb", "max_stars_repo_name": "PhyProg/Numerical-simulations-in-Physics", "max_stars_repo_head_hexsha": "ab335117d993be4129654fbfc4455176410... |
from agent import Agent
from monitor import interact
import gym
import numpy as np
env = gym.make('Taxi-v3')
agent = Agent()
avg_rewards, best_avg_reward = interact(env, agent)
#in v2 online on the notebook
# sarsa[0] --> 9.256
# Q-learning --> 9.223
# E-Sarsa --> 9.118
#in v3:
# sarsa[0] --> 8.793
# Q-l... | {"hexsha": "12113527d4a8be6e08af69eff2ff83df94b4cce4", "size": 363, "ext": "py", "lang": "Python", "max_stars_repo_path": "lab-taxi/main.py", "max_stars_repo_name": "ramanpreet9/deep-reinforcement-learning", "max_stars_repo_head_hexsha": "daa0a92dc4ed18af8a953193c73a6af22635277e", "max_stars_repo_licenses": ["MIT"], "m... |
import os
import torch
#from skimage import io, transform
from PIL import Image
from scipy.io import loadmat
import numpy as np
from torch.utils.data import Dataset
from torchvision import transforms
# Ignore warnings
import warnings
warnings.filterwarnings("ignore")
# class Rescale(object):
# """Rescale the ima... | {"hexsha": "69f2f00f6c5e41848cb50a83e012f5f32160e18d", "size": 4552, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/dataset.py", "max_stars_repo_name": "cdawei/image_labeling", "max_stars_repo_head_hexsha": "119c80c2d8f78c9701f7500236038dab7e43327d", "max_stars_repo_licenses": ["Apache-2.0"], "max_stars_cou... |
import os
import tempfile
import numpy as np
import pandas as pd
import datetime as dt
if __name__ == "__main__":
base_dir = "/opt/ml/processing"
#Read Data
df = pd.read_csv(
f"{base_dir}/input/storedata_total.csv"
)
# convert created column to datetime
df["created"] = pd.to_dateti... | {"hexsha": "21b278d5aa1e5534056107d7b1f019781e24fab3", "size": 2182, "ext": "py", "lang": "Python", "max_stars_repo_path": "pipelines/customerchurn/preprocess.py", "max_stars_repo_name": "aws-samples/customer-churn-sagemaker-pipelines-sample", "max_stars_repo_head_hexsha": "3b4def4a29bd62ca7dfa485273389baf3e131194", "m... |
import os.path
import time
import warnings
import numpy as np
import torch
from torch.autograd import Variable
from copy import deepcopy
from core.estimator_tools.samplers.srw_mhwg_sampler import SrwMhwgSampler
from core.estimators.gradient_ascent import GradientAscent
from core.estimators.mcmc_saem import McmcSaem
... | {"hexsha": "453a48083f60726a63b581081f3a7e8a9e43224d", "size": 20956, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/launch/estimate_longitudinal_metric_model.py", "max_stars_repo_name": "EuroPOND/deformetrica", "max_stars_repo_head_hexsha": "29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062", "max_stars_repo_licens... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... | {"hexsha": "6f658109200a26d473c78a3214a5a49688446320", "size": 10564, "ext": "cc", "lang": "C++", "max_stars_repo_path": "src/kudu/tablet/deltamemstore.cc", "max_stars_repo_name": "sdreynolds/kudu", "max_stars_repo_head_hexsha": "13642f60f9a6ba6dd77f97a6736467b8ab5849af", "max_stars_repo_licenses": ["Apache-2.0"], "max... |
"""
Inexact augmented Lagrange multiplier (IALM)
"""
import numpy as np
from numpy import linalg
from md_utils import shrinking
def jay_func(y_mat, lambd):
"""
implements
J(D) = max(norm_{2}(D), lambda^(-1)*norm_{inf}(D))
"""
return max(linalg.norm(y_mat, 2),
np.dot(np.recipro... | {"hexsha": "29e50b556a04fc992e8e2b139c2cda4086477329", "size": 1747, "ext": "py", "lang": "Python", "max_stars_repo_path": "model_driven_method/ialm.py", "max_stars_repo_name": "vjhansen/IRSTD", "max_stars_repo_head_hexsha": "0470b6bd14701bfc12737f774686b84b03d48e1d", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
/*
* Copyright 2010-2012 Esrille Inc.
*
* 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": "082225066d4ba56cde8d848efe6edc98a6ddd152", "size": 7941, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "escort/src/html/HTMLScriptElementImp.cpp", "max_stars_repo_name": "rvedam/es-operating-system", "max_stars_repo_head_hexsha": "32d3e4791c28a5623744800f108d029c40c745fc", "max_stars_repo_licenses": [... |
import pytest
import numpy as np
import pandas as pd
from sklearn.model_selection import GridSearchCV
from hulearn.datasets import load_titanic
from hulearn.classification.functionclassifier import FunctionClassifier
from hulearn.common import flatten
from tests.conftest import (
select_tests,
general_checks... | {"hexsha": "c3872bc622322fde7896f809e54ca279ab9449e2", "size": 2818, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/test_classification/test_functionclassifier.py", "max_stars_repo_name": "ParikhKadam/human-learn", "max_stars_repo_head_hexsha": "f3cb41aa4f18bd079aefe6e843d24530c15ddb3b", "max_stars_repo_l... |
from unittest import TestCase
import numpy as np
import graph_matching_tools.metrics.matching as matching
class TestMatching(TestCase):
def test_compute_f1score(self):
t1 = [[1, 0, 0, 1],
[0, 1, 0, 0],
[0, 0, 1, 0],
[1, 0, 0, 1]]
t2 = [[1, 0, 0, 1],
... | {"hexsha": "540b067406bf830340c7268a5ee6b5e40c92abda", "size": 547, "ext": "py", "lang": "Python", "max_stars_repo_path": "tests/metrics/test_matching.py", "max_stars_repo_name": "fxdupe/graphmatchingtools", "max_stars_repo_head_hexsha": "4503a04c4a0822315535e6ab3cd698417859908d", "max_stars_repo_licenses": ["MIT"], "m... |
[STATEMENT]
lemma (in \<Z>) smc_SemiCAT_obj_initialD:
assumes "obj_initial (smc_SemiCAT \<alpha>) \<AA>"
shows "\<AA> = smc_0"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. \<AA> = smc_0
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
obj_initial (smc_SemiCAT \<alpha>) \<AA>
goal (1 subgoal):
... | {"llama_tokens": 5695, "file": "CZH_Foundations_czh_semicategories_CZH_SMC_SemiCAT", "length": 46} |
[STATEMENT]
lemma knows_Spy_Inputs_secureM_srb_Spy:
"evs \<in>srb \<Longrightarrow> knows Spy (Inputs Spy C X # evs) = insert X (knows Spy evs)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
1. evs \<in> srb \<Longrightarrow> knows Spy (Inputs Spy C X # evs) = insert X (knows Spy evs)
[PROOF STEP]
apply (simp (... | {"llama_tokens": 172, "file": null, "length": 2} |
% Copyright 2019 by Christian Feuersaenger
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Free Documentation License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
\section{Floating Point Unit Library}
\label{pgfmath-float... | {"hexsha": "04989eef44d8f1182da62e225e72abf276357694", "size": 27352, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "Texlive_Windows_x32/2020/texmf-dist/doc/generic/pgf/text-en/pgfmanual-en-library-fpu.tex", "max_stars_repo_name": "waqas4afzal/LatexUrduBooksTools", "max_stars_repo_head_hexsha": "52fe6e0cd5af6b461... |
#pragma once
#include <new>
#include <map>
#include <mutex>
#include <vector>
#include <string>
#include <utility>
#include <cstdlib>
#define BOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED
#include <boost/stacktrace.hpp>
namespace
{
template<typename T>
struct malloc_allocator_t : std::allocator<T>
{
T* allocate(std::... | {"hexsha": "d2cc479d535a8dfa4a4d47bd830eb4a8708efd1e", "size": 2319, "ext": "hpp", "lang": "C++", "max_stars_repo_path": "src/newtrace.st.hpp", "max_stars_repo_name": "SammyEnigma/blog", "max_stars_repo_head_hexsha": "f0f3ef44ea4fd622befae81d2f4e5e6a607acfd1", "max_stars_repo_licenses": ["0BSD"], "max_stars_count": 94.... |
\documentclass[hyp]{socreport}
\usepackage{mathtools}
\usepackage{mathtools}
\usepackage{fullpage}
\usepackage{float}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{caption}
\usepackage[shortlabels]{enumitem}
\usepackage[utf8]{inputenc}
\graphicspath{{./figs/}}
\DeclarePairedDelimiter{\ab... | {"hexsha": "faf2f2c39c490f3310a4efc2cad33eaee80ff943", "size": 59343, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "docs/report/main.tex", "max_stars_repo_name": "tsoonjin/selam", "max_stars_repo_head_hexsha": "fbbb355490271bf09056e05b23245be1b75ae24d", "max_stars_repo_licenses": ["MIT"], "max_stars_count": 3, "... |
# Different ways to simulate molecules
export
accelerations,
VelocityVerlet,
simulate!,
VelocityFreeVerlet
"""
accelerations(simulation, neighbours; parallel=true)
Calculate the accelerations of all atoms using the general and specific
interactions and Newton's second law.
"""
funct... | {"hexsha": "10b918081776a2e25506213cffb259330083ecc9", "size": 5462, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/simulators.jl", "max_stars_repo_name": "longemen3000/Molly.jl", "max_stars_repo_head_hexsha": "346bd5bd7bce3f7ff3169a01b414091cc7eb35a5", "max_stars_repo_licenses": ["MIT"], "max_stars_count": ... |
#!/usr/bin/env python3
import os
import time
import numpy as np
import cereal.messaging as messaging
from selfdrive.manager.process_config import managed_processes
N = int(os.getenv("N", "5"))
TIME = int(os.getenv("TIME", "30"))
if __name__ == "__main__":
sock = messaging.sub_sock('modelV2', conflate=False, timeo... | {"hexsha": "2ea56d97ed187a2f8e0003689dea962b85897f1a", "size": 986, "ext": "py", "lang": "Python", "max_stars_repo_path": "selfdrive/modeld/test/timing/benchmark.py", "max_stars_repo_name": "TMORI135/openpilot", "max_stars_repo_head_hexsha": "bc986477eb34f554933caafeac71538c57fb6838", "max_stars_repo_licenses": ["MIT"]... |
import torch
import torch.nn as nn
import numpy as np
class BBoxTransform(nn.Module):
def __init__(self, mean=None, std=None, gpu=False):
super(BBoxTransform, self).__init__()
if mean is None:
self.mean = torch.from_numpy(np.array([0, 0, 0, 0]).astype(np.float32))
else:
... | {"hexsha": "47684238b5bbc036128164ba3eff6359bc6c8e57", "size": 6757, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyvision/detection/efficientdet/lib/utils.py", "max_stars_repo_name": "indiradutta/PyVision", "max_stars_repo_head_hexsha": "cf74da32a3469ddcce9917ac1f2fcaaeefdeacdf", "max_stars_repo_licenses": [... |
#File: fStd.jl
#Author:
#Date: 29-June-2020
#STANDARD DEVIATION
function fStd(x,flag,f)
#--------------------------------------------------------------------------
#x: returns vector
#flag: 0 = sample, 1 = population
#f: reporting frequency e.g. 12 (monthly)
#sd: standard deviation (sample or population)
#... | {"hexsha": "09029397031d0fa5f226ae961696dc0b84f4b7bf", "size": 462, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/optimisation/fStd.jl", "max_stars_repo_name": "tranquilhero/Sonic.jl", "max_stars_repo_head_hexsha": "ea3cd85956d90ee6a1bd18bbbf834688a6117d29", "max_stars_repo_licenses": ["MIT"], "max_stars_co... |
import numpy as np
import numexpr as ne
from .letter import letter
def __segment(points, n=100):
"""
Each letter is a represented by a bunch of points a,b,c,d...
There are straight segments between two adjacent points
We represent each such segment as a collection of n auxilliary points
"""
f... | {"hexsha": "597ae5412692e1d6b1a6af0460ffc8c0511158c6", "size": 1015, "ext": "py", "lang": "Python", "max_stars_repo_path": "work/pyscribble/scribble.py", "max_stars_repo_name": "tschm/scribble", "max_stars_repo_head_hexsha": "31870e7b7d9bde3f706d1821f02fec21d4f093de", "max_stars_repo_licenses": ["MIT"], "max_stars_coun... |
__precompile__(true)
module VertexModels
export RandGenerator,
Orientation,
maxorientation,
twentyvertex,
picture,
height,
issink,
issource,
pushdown!,
pushup!
mutable struct RandGenerator
D::Dict{Int64,Tuple{Int64,Int64,Bool}}
m::Int64
... | {"hexsha": "2fcb8b9c1cf6da7ed717759c5c012be6057742af", "size": 7255, "ext": "jl", "lang": "Julia", "max_stars_repo_path": "src/VertexModels.jl", "max_stars_repo_name": "dgoekmen/VertexModels.jl", "max_stars_repo_head_hexsha": "d94c838fccd374e0b0d693e38b72a9a21c235d11", "max_stars_repo_licenses": ["MIT"], "max_stars_cou... |
```python
from __future__ import division
from sympy import *
x, y, z, t = symbols('x y z t')
k, m, n = symbols('k m n', integer=True)
f, g, h = symbols('f g h', cls=Function)
```
```python
solve(x+3-4,x)
```
[1]
La orden Matrix() es una función de sympy para crear matrices. Donde () es el argumento de la ... | {"hexsha": "24004a4513600760584ce847d73f4d2343e145a0", "size": 6408, "ext": "ipynb", "lang": "Jupyter Notebook", "max_stars_repo_path": "matrices.ipynb", "max_stars_repo_name": "CogniMath/regression_matrices", "max_stars_repo_head_hexsha": "1f8a384807dfc65f6e61462927f41cbcb500596c", "max_stars_repo_licenses": ["MIT"], ... |
(* *********************************************************************)
(* *)
(* The Compcert verified compiler *)
(* *)
(* Xavier Leroy... | {"author": "gzqaq", "repo": "CS2612-PLaC", "sha": "fb7be0651785905b60d3e705324175daaadcc96b", "save_path": "github-repos/coq/gzqaq-CS2612-PLaC", "path": "github-repos/coq/gzqaq-CS2612-PLaC/CS2612-PLaC-fb7be0651785905b60d3e705324175daaadcc96b/assigns/compcert_lib/Coqlib.v"} |
/*
This file is part of Mitsuba, a physically based rendering system.
Copyright (c) 2007-2014 by Wenzel Jakob and others.
Mitsuba is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License Version 3
as published by the Free Software Foundation.
... | {"hexsha": "502c4e1d00d8f3f88fe72721b0bc808705da31c7", "size": 13056, "ext": "cpp", "lang": "C++", "max_stars_repo_path": "mitsuba-af602c6fd98a/src/integrators/misc/adaptive.cpp", "max_stars_repo_name": "NTForked-ML/pbrs", "max_stars_repo_head_hexsha": "0b405d92c12d257e2581366542762c9f0c3facce", "max_stars_repo_license... |
\section{Moltres} \label{sec:moltres}
In this section we describe Moltres \cite{lindsay_introduction_2018}, the
multiphysics reactor simulation tool, and the specific modeling approach for
simulating the CNRS Benchmark cases in Moltres. Much of Moltres' development
focuses on meeting the needs of \gls{MSR} multiphysic... | {"hexsha": "b3a422050f961f2762cbe13efb97e747ad0c7d31", "size": 13295, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "moltres.tex", "max_stars_repo_name": "smpark7/2021-park-moltres-benchmark", "max_stars_repo_head_hexsha": "efaaaa70e0db4781a0dddad51151640aa820486f", "max_stars_repo_licenses": ["CC-BY-4.0"], "max_... |
\section{Evaluation}
\label{sec:eval}
\lstMakeShortInline[mathescape=true]{|}
We have implemented analytic program repair in \toolname: a system for
repairing type errors for a purely functional subset of \ocaml. Next,
we describe our implementation and an evaluation that addresses three
questions:
\begin{itemize}
... | {"hexsha": "b68e6773d0bfcc076b2b20340e82fe1c7ea683ba", "size": 18314, "ext": "tex", "lang": "TeX", "max_stars_repo_path": "paper/pldi20-cameraready/evaluation.tex", "max_stars_repo_name": "gsakkas/rite", "max_stars_repo_head_hexsha": "958a0ad2460e15734447bc07bd181f5d35956d3b", "max_stars_repo_licenses": ["BSD-3-Clause"... |
from __future__ import absolute_import
# EMAcs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import numpy as np
from ...api import write_data, slice_generator
from .. import generators as gen
from nose.tools import assert_equal, assert_raises
from numpy.test... | {"hexsha": "b14b208427583a8763fd20fd7812510a83f18a63", "size": 5761, "ext": "py", "lang": "Python", "max_stars_repo_path": "nipy/core/utils/tests/test_generators.py", "max_stars_repo_name": "alexis-roche/nipy", "max_stars_repo_head_hexsha": "b765f258621c886538b77115128511cdfd4600fe", "max_stars_repo_licenses": ["BSD-3-... |
module Data.BitVector.Peano where
open import Data.BitVector
open import Algebra.FunctionProperties.Core
open import Data.Nat hiding (pred) renaming (suc to Nsuc; zero to Nzero)
open import Data.Vec hiding (fromList)
open import Relation.Binary.PropositionalEquality
open import Data.Digit hiding (Bit)
open import Dat... | {"hexsha": "395c602a58c5147e2cac949a5c0d4eacfa9d956d", "size": 2907, "ext": "agda", "lang": "Agda", "max_stars_repo_path": "Data/BitVector/Peano.agda", "max_stars_repo_name": "copumpkin/bitvector", "max_stars_repo_head_hexsha": "6902f4bce0330f1b58f48395dac4406056713687", "max_stars_repo_licenses": ["BSD-3-Clause"], "ma... |
#!/usr/bin/python
#
# Convert to COCO-style panoptic segmentation format (http://cocodataset.org/#format-data).
#
# python imports
from __future__ import print_function, absolute_import, division, unicode_literals
import os
import glob
import sys
import argparse
import json
import numpy as np
# Image processing
from ... | {"hexsha": "648561ff4edc4db1c644515ed643f5d862a173dc", "size": 6672, "ext": "py", "lang": "Python", "max_stars_repo_path": "BenchmarkScripts/convert2panoptic.py", "max_stars_repo_name": "Skywalker666666/scannet_dataset_prep", "max_stars_repo_head_hexsha": "0cda8c360512eda8c2ade892c5f23ed21320cc69", "max_stars_repo_lice... |
# Copyright (c) 2015, Scott J Maddox. All rights reserved.
# Use of this source code is governed by the BSD-3-Clause
# license that can be found in the LICENSE file.
'''
Uses numerical integration to calculate accurate values to test against.
This should only be run after `python setup.py build_ext --inplace`.
'''
im... | {"hexsha": "9654c22e4ec6f149fb26d94966c274497b2bb5d6", "size": 2953, "ext": "py", "lang": "Python", "max_stars_repo_path": "scripts/gen_test_ifd.py", "max_stars_repo_name": "jgukelberger/fdint", "max_stars_repo_head_hexsha": "0237323d6fd5d4161190ff7982811d8ae290f89e", "max_stars_repo_licenses": ["BSD-3-Clause"], "max_s... |
function iclust = initialize_clusters(Ucell, Nk, type, Lx, Ly)
switch type
case 'random'
vs = randn(size(Ucell,1), Nk);
vs = bsxfun(@rdivide, vs, sum(vs.^2,1).^.5 + 1e-8);% normalize activity vectors
vs = single(vs);
xs = vs' * Ucell;
[~, iclust] = max(xs,[],1);
... | {"author": "cortex-lab", "repo": "Suite2P", "sha": "c6a8ea9f01ffc8555429978e7fe97f843ad5b6d5", "save_path": "github-repos/MATLAB/cortex-lab-Suite2P", "path": "github-repos/MATLAB/cortex-lab-Suite2P/Suite2P-c6a8ea9f01ffc8555429978e7fe97f843ad5b6d5/cellDetection/initialize_clusters.m"} |
#!/usr/bin/env python3
"""
A script for preprocessing data from the lingspam corpus data set and save it as
a numpy data files. The dataset can be downloaded from
http://www.aueb.gr/users/ion/data/lingspam_public.tar.gz
Usage:
Assuming the data set was downloaded and exctracted to the script's directory
location, yo... | {"hexsha": "1f164f6d8befc6434ee6024aeedb6047df64df4d", "size": 2413, "ext": "py", "lang": "Python", "max_stars_repo_path": "data/lingspam/preprocess.py", "max_stars_repo_name": "SergioRAgostinho/bootstrap-ml", "max_stars_repo_head_hexsha": "1f96c58ee09a8a7fcb61e5f1017c9dea74c31805", "max_stars_repo_licenses": ["Apache-... |
from os.path import dirname, join
import numpy as np
import obspy
import pytest
from pyfk import mpi_info
from pyfk.config.config import Config, SeisModel, SourceModel
from pyfk.gf.gf import calculate_gf
class TestFunctioncalculateGf_MPI(object):
@pytest.mark.mpi
def test_mpi_info(self):
assert mpi_i... | {"hexsha": "d8cedcd6329e0ba5d0a545f483143390d45a1601", "size": 1688, "ext": "py", "lang": "Python", "max_stars_repo_path": "pyfk/tests/gf/test_gf_mpi.py", "max_stars_repo_name": "ziyixi/pyfk", "max_stars_repo_head_hexsha": "2db56621cd4f9db5cf6a866fa0ca25fcb994b1d4", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
#!/usr/bin/env python3
"""Main script for gaze direction inference from webcam feed."""
import argparse
import os
import queue
import threading
import time
from gazedb import GazeDB
import coloredlogs
import cv2 as cv
import numpy as np
import tensorflow as tf
from tensorflow.python.client import device_lib
import kera... | {"hexsha": "9c22d1849476b159a27d9c682472d9bdeb27c6fc", "size": 21965, "ext": "py", "lang": "Python", "max_stars_repo_path": "src/elg_demo.py", "max_stars_repo_name": "KayaDevSolutions/GazeML", "max_stars_repo_head_hexsha": "a0cc072bad7d77b8c5b5698082b77cfb1011f45b", "max_stars_repo_licenses": ["MIT"], "max_stars_count"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.