text
stringlengths
0
27.1M
meta
dict
import torch from torch.utils.data import DataLoader from torchvision import transforms import torch.optim as optim import torch.nn as nn import torch.backends.cudnn as cudnn import torchvision.datasets as datasets import torchvision.utils as utils import numpy as np import time import torch.nn.functional as F from tor...
{ "alphanum_fraction": 0.6761268781, "author": null, "avg_line_length": 36.303030303, "converted": null, "ext": "py", "file": null, "hexsha": "6432abbd895214c5aa3c38290cb18e9ea7ccbdb4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import os import glob import subprocess from numpy import testing import numpy as np from numpy.core.numeric import NaN from numpy.lib.function_base import average from numpy.lib.shape_base import split import pandas as pd import json import io import matplotlib.pyplot as plt # Genetic algorithm in the future? """ j...
{ "alphanum_fraction": 0.5591706821, "author": null, "avg_line_length": 35.9634340223, "converted": null, "ext": "py", "file": null, "hexsha": "57ba114517c7b4c5b8c764b78852129b570ee384", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma source_all_outarcs_T: "\<lbrakk>undirected_tree G; tail G e = root; e \<in> arcs G\<rbrakk> \<Longrightarrow> e \<in> arcs T" [PROOF STATE] proof (prove) goal (1 subgoal): 1. \<lbrakk>undirected_tree G; tail G e = root; e \<in> arcs G\<rbrakk> \<Longrightarrow> e \<in> arcs T [PROOF STEP] using sou...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Query_Optimization_Directed_Tree_Additions", "hexsha": null, "include": null, "lang": null, "length": 2, "llama_tokens": 319, "mathlib_filename": null, "max_forks_count": null, "max...
\documentclass[11pt, compress]{beamer} \usepackage{preamb} \usepackage{tikz,tkz-tab} \usepackage{tkz-euclide} \usepackage{movie15} \usepackage{hyperref} \setbeamertemplate{navigation symbols}{} \usetheme{Warsaw} \setbeamertemplate{theorem begin}{{ \inserttheoremheadfont \inserttheoremname \inserttheorempunctuation }...
{ "alphanum_fraction": 0.7111268771, "author": null, "avg_line_length": 29.4668989547, "converted": null, "ext": "tex", "file": null, "hexsha": "55291657d4b72305710e382dbdfe0ff6ca964fda", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# -*- coding: utf-8 -*- """This module is mean to be used to get the main training data for train the model to be used on ml_rivets.mll node This code is to be used on maya with numpy library MIT License Copyright (c) 2020 Mauro Lopez Permission is hereby granted, free of charge, to any person obtaining a copy of th...
{ "alphanum_fraction": 0.6728855721, "author": null, "avg_line_length": 40.4020100503, "converted": null, "ext": "py", "file": null, "hexsha": "3a293ce6548d8d43978c10e01b0520c5c348a410", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Cython wrapper to provide python interfaces to PROJ.4 (http://trac.osgeo.org/proj/) functions. Performs cartographic transformations and geodetic computations. The Proj class can convert from geographic (longitude,latitude) to native map projection (x,y) coordinates and vice versa, or from one map projection coor...
{ "alphanum_fraction": 0.6144168299, "author": null, "avg_line_length": 43.4356103024, "converted": null, "ext": "py", "file": null, "hexsha": "40f79d858742495e21cb7ab1ade7f299bcdb616e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" Unified place for determining if external dependencies are installed or not. You should import all external modules using the import_module() function. For example >>> from sympy.external import import_module >>> numpy = import_module('numpy') If the resulting library is not installed, or if the installed versi...
{ "alphanum_fraction": 0.7871972318, "author": null, "avg_line_length": 27.5238095238, "converted": null, "ext": "py", "file": null, "hexsha": "549b4b96cdce0ee4d31960e89cb9dc26af0e105d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import glob from pathlib import Path import cv2 import matplotlib.pyplot as plt import numpy as np from keras import models from matplotlib import image as mpimg if __name__ == '__main__': # Visualizing intermediate activation in Convolutional Neural Networks with Keras # https://github.com/gabrielpierobon/cn...
{ "alphanum_fraction": 0.6346710799, "author": null, "avg_line_length": 49.3265306122, "converted": null, "ext": "py", "file": null, "hexsha": "d43bd431e64fe4d124b8a846b2e046776d5c40de", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import tensorflow as tf import numpy as np import logging.config import functions import json from datetime import datetime np.set_printoptions(suppress=True) # 1 - logging now = datetime.utcnow().strftime("%Y%m%d%H%M%S") root_logdir = "tf_logs" logdir = "{}/run-{}/".format(root_logdir, now) with open('./logging_con...
{ "alphanum_fraction": 0.642883413, "author": null, "avg_line_length": 28.0309278351, "converted": null, "ext": "py", "file": null, "hexsha": "a796c9164229f5cd94632ebdc1f6917345736469", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
""" Profile groupfitter See where the bulk of computation occurs. Examples on how to profile with python https://docs.python.org/2/library/profile.html """ import cProfile import logging import numpy as np import pstats import sys sys.path.insert(0, '..') from chronostar.synthdata import SynthData from chronostar i...
{ "alphanum_fraction": 0.7144837145, "author": null, "avg_line_length": 27.2264150943, "converted": null, "ext": "py", "file": null, "hexsha": "5faf00e1a924a81cafefcb619893fa56f61d7dd1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from Attribute import Attribute from Utility import Utility from Observation import Observation from HyperParameters import HyperParameters from Memory import Memory import numpy import random import math class CapsuleMemory(Memory): def __init__(self): self._observations : list = list() # O...
{ "alphanum_fraction": 0.5979895323, "author": null, "avg_line_length": 41.3642611684, "converted": null, "ext": "py", "file": null, "hexsha": "7e757deb680eb72ab25bb477738215f80d3bf63d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import io import numpy as np import sys import tensorflow as tf import matplotlib backend = 'Agg' if sys.platform == 'linux' else 'TkAgg' matplotlib.use(backend) import matplotlib.pyplot as plt import matplotlib.gridspec as gridspec def _build_network( name, inputs, hidden_layer_dims, ...
{ "alphanum_fraction": 0.6171016484, "author": null, "avg_line_length": 33.0909090909, "converted": null, "ext": "py", "file": null, "hexsha": "8db4be03684395d11e02f9e73e58436c6188ece0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np def make_sphere(ball_shape, radius, position): """ Assumes shape and position are both a 3-tuple of int or float the units are pixels / voxels (px for short) radius is a int or float in px :param tuple(int) ball_shape: :param float radius: :param tuple(int) position: ...
{ "alphanum_fraction": 0.6506378803, "author": null, "avg_line_length": 29.9705882353, "converted": null, "ext": "py", "file": null, "hexsha": "cef24ad247257fe88a937e75674c249a4f19f86b", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/bin/python import numpy as np import torch import matplotlib.pyplot as plt from spiking import SpikingLGN from torchvision.datasets import MNIST from torchvision import transforms if __name__ == "__main__": device = torch.device("cuda" if torch.cuda.is_available() else "cpu") print(f"Using device: {devic...
{ "alphanum_fraction": 0.6736596737, "author": null, "avg_line_length": 30.6428571429, "converted": null, "ext": "py", "file": null, "hexsha": "d8e7d6894ec7cdccd5629f684b1d97f51d05bbf9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding: utf-8 -*- """Console script for star_pairs.""" import click import readline import numpy as np import matplotlib.pyplot as plt import time import datetime from time import localtime from time import strftime import math import os import pkg_resources # _Define constants: LATITUDE = '-30d14m26.700s' ...
{ "alphanum_fraction": 0.5140797477, "author": null, "avg_line_length": 31.150877193, "converted": null, "ext": "py", "file": null, "hexsha": "805e9a4f1cb45038076d619bb3a96148dcba5677", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
subroutine exco_read_salt use hydrograph_module use input_file_module use organic_mineral_mass_module use maximum_data_module use exco_module use constituent_mass_module character (len=80) :: titldum, header integer :: eof, imax, ob1, ob2 logical :: i_e...
{ "alphanum_fraction": 0.5304449649, "author": null, "avg_line_length": 30.8674698795, "converted": null, "ext": "f90", "file": null, "hexsha": "a5af59c9301e914e3b93cc48b0e1ca7c05a72c30", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
#! /usr/bin/env python import rospy import cv2 import sys import numpy import moveit_commander import moveit_msgs.msg import geometry_msgs.msg import os from cv_bridge import CvBridge import shlex import subprocess import time from sensor_msgs.msg import Image, CameraInfo, PointCloud2 # Switch controller server ...
{ "alphanum_fraction": 0.5892393828, "author": null, "avg_line_length": 37.7474226804, "converted": null, "ext": "py", "file": null, "hexsha": "904b9a2f1b1560594f803a78e7e69f241be27225", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
function r=rot4y(theta) % r = rot4y(theta) % % roty produces a 4x4 rotation matrix representing % a rotation by theta radians about the y axis. % % Argument definitions: % % theta = rotation angle in radians c = cos(theta); s = sin(theta); r = [c 0 s 0; 0 1 0 0; ...
{ "alphanum_fraction": null, "author": "CelsoReyes", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_...
module LakeTributaryModule use ConstantsModule, only: DZERO, LENPACKAGENAME use ListModule, only: ListType private public :: LakeTributaryType, ConstructLakeTributary, & CastAsLakeTributaryType, AddLakeTributaryToList, & GetTributaryFromList type LakeTributaryType integer ...
{ "alphanum_fraction": 0.6400634249, "author": null, "avg_line_length": 24.8947368421, "converted": null, "ext": "f90", "file": null, "hexsha": "c1a51dce361a6014ec79880ab01f027552d48b80", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_f...
[STATEMENT] lemma nsqn_update_other [simp]: fixes dsn dsk flag hops dip nhip pre rt ip assumes "dip \<noteq> ip" shows "nsqn (update rt ip (dsn, dsk, flag, hops, nhip)) dip = nsqn rt dip" [PROOF STATE] proof (prove) goal (1 subgoal): 1. nsqn (update rt ip (dsn, dsk, flag, hops, nhip)) dip = nsqn rt dip [PROO...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "AODV_variants_e_all_abcd_E_Fresher", "hexsha": null, "include": null, "lang": null, "length": 3, "llama_tokens": 362, "mathlib_filename": null, "max_forks_count": null, "max_forks_r...
from torch.utils.data import DataLoader, Dataset from torchvision.datasets import MNIST import warnings from typing import Dict, IO, Union import os import numpy as np import torch import codecs import gzip import lzma from torchvision.datasets.utils import download_and_extract_archive import cv2 from examples.mnist.ge...
{ "alphanum_fraction": 0.6032526033, "author": null, "avg_line_length": 34.743902439, "converted": null, "ext": "py", "file": null, "hexsha": "40823b37bb3516639126ed553e80b43d522f06bd", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# Author: Hiroharu Sugawara <hsugawa@gmail.com> # Copyright: (C) 2020 Hiroharu Sugawara # Author: Eric P. Hanson # Copyright: (C) 2018? Eric P. Hanson # Author: Martin Vuk <martin.vuk@fri.uni-lj.si> # Copyright: (C) 2016 Martin Vuk # License: BSD 3-clause """ PandocFiltersLiveJuliaCode Package to aid writing...
{ "alphanum_fraction": 0.7403846154, "author": null, "avg_line_length": 18.5714285714, "converted": null, "ext": "jl", "file": null, "hexsha": "63c83c28d5635e18b8caba1aeb45075438fdeced", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
@testset "basic" begin @testset "GNNChain" begin n, din, d, dout = 10, 3, 4, 2 g = GNNGraph(random_regular_graph(n, 4), graph_type=GRAPH_T, ndata= randn(Float32, din, n)) gnn = GNNChain(GCNConv(din => d), Batch...
{ "alphanum_fraction": 0.3992285439, "author": null, "avg_line_length": 28.027027027, "converted": null, "ext": "jl", "file": null, "hexsha": "3ba63e51e8eb4401287f2ed28f507585df5d1ba8", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import py, os, sys from pytest import raises import numpy as np sys.path = [os.pardir] + sys.path class TestOPTIMIZERS: def setup_class(cls): pass def reset(self): import SQSnobFit # reset the random state for each method to get predictable results SQSnobFit._gen_utils._randsta...
{ "alphanum_fraction": 0.5712656784, "author": null, "avg_line_length": 25.7941176471, "converted": null, "ext": "py", "file": null, "hexsha": "94a7a56d364ab3e85b4cf6da1bdf733de0b4ba87", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python """ Hackable script to find threshold values. NOTE(danny): Saved because I've needed code like this so many times """ import cv2 import numpy as np # NOTE(danny): camera id goes here (or video file path) cap = cv2.VideoCapture(1) def nothing(x): pass # Creating a window for later use cv2.n...
{ "alphanum_fraction": 0.6624102155, "author": null, "avg_line_length": 21.9824561404, "converted": null, "ext": "py", "file": null, "hexsha": "2bd4af8b4dc835a2f46eed3d19adc00cb2ba1096", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from pathlib import Path import json import numpy as np import torch import torch.nn as nn import torch.optim as optim from ..abs_model_controller import ControllerBase from .make_data_loader import get_loader from . import trainer from . import predictor from . import saver from ...models.retrain_clf.model import Mo...
{ "alphanum_fraction": 0.6342616921, "author": null, "avg_line_length": 26.4305555556, "converted": null, "ext": "py", "file": null, "hexsha": "acd8f1967d521f529b5e710d0a77943fb56b050f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Databricks notebook source import matplotlib.pyplot as plt from pyspark.sql import functions as F import matplotlib.mlab as mlab from matplotlib.ticker import MaxNLocator from pyspark.ml.feature import VectorAssembler from mpl_toolkits.mplot3d import Axes3D %matplotlib inline from pyspark.ml.feature import MaxAbsScal...
{ "alphanum_fraction": 0.7463813719, "author": null, "avg_line_length": 35.3111111111, "converted": null, "ext": "py", "file": null, "hexsha": "ce73de5dfddd9eb9df75294cda82581aed7d9dba", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma (in trace_top) LNil_safety: "safety A {LNil}" [PROOF STATE] proof (prove) goal (1 subgoal): 1. safety A {LNil} [PROOF STEP] proof (unfold safety_def, clarify) [PROOF STATE] proof (state) goal (1 subgoal): 1. \<And>t. \<lbrakk>t \<in> A\<^sup>\<infinity>; \<forall>r\<in>finpref A t. \<exists>s\<in>A\...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Topology_LList_Topology", "hexsha": null, "include": null, "lang": null, "length": 6, "llama_tokens": 684, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_e...
import matplotlib.pyplot as plt import numpy as np import pandas as pd def make_data(initial_data): prev_data = initial_data['test'][0] datas = pd.DataFrame(initial_data) data = [] for i in range(1440): arr = [] for j in range(60): temp = prev_data * np.random.unifo...
{ "alphanum_fraction": 0.6461937716, "author": null, "avg_line_length": 24.5957446809, "converted": null, "ext": "py", "file": null, "hexsha": "9fbc1f30b0c43c0373532f09a52df31ea953daea", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import numpy as np def base_fun(key): if key == 0: return lambda x: x if key == 1: return lambda x: np.sin(x * 20) if key == 2: return lambda x: np.exp((x - 0.5) * 50) / (np.exp((x - 0.5) * 50) + 1) if key == 3: return lambda x: (np.arctan(x * 10) + np.sin(x * 10)) / 2 ...
{ "alphanum_fraction": 0.5510805501, "author": null, "avg_line_length": 39.1538461538, "converted": null, "ext": "py", "file": null, "hexsha": "b62255d7a8fc030165b2a84c21bd0439f9492514", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import json import re from bs4 import BeautifulSoup from nltk.stem.porter import PorterStemmer import numpy as np from tqdm import trange from . import HEATMAP_CSS_PATH from .textutil import normal...
{ "alphanum_fraction": 0.5482404445, "author": null, "avg_line_length": 32.9944444444, "converted": null, "ext": "py", "file": null, "hexsha": "0e2508060ea3af730131d7daa8d1332be2400789", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from itertools import product import numpy as np import param from ...core import CompositeOverlay, Element from ...core import traversal from ...core.util import match_spec, max_range, unique_iterator, unique_array, is_nan from ...element.raster import Image, Raster, RGB from .element import ColorbarPlot, OverlayPlo...
{ "alphanum_fraction": 0.5946696608, "author": null, "avg_line_length": 38.9011494253, "converted": null, "ext": "py", "file": null, "hexsha": "368e3e9766eb11b01e2476bf4b8185062d4a8985", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import torch import torch.nn.functional as F import numpy as np from utils.processing import BoundingBox import cv2 def train(model, train_loader, optimizer, criterion, epoch, device, log_interval=175): """ Function to train the model Args: model (nn.model object): Model to be trained ...
{ "alphanum_fraction": 0.6015655577, "author": null, "avg_line_length": 41.2096774194, "converted": null, "ext": "py", "file": null, "hexsha": "dd353e8b6025c8c07a57385a6c084f1ababd8446", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
\documentclass[a4paper, 11pt]{article} \usepackage[utf8]{inputenc} \usepackage[lmargin=3cm]{geometry} \usepackage{amssymb} \usepackage{verbatim} \hyphenation{FORTRAN NEKBONE} %Inlucde common settings \input{../BPG/deliverables-config.tex} \newenvironment{code}% { \addtolength{\leftskip}{0.5cm}}% { } \begin{documen...
{ "alphanum_fraction": 0.7240527183, "author": null, "avg_line_length": 20.9310344828, "converted": null, "ext": "tex", "file": null, "hexsha": "f138c84d9fe62700f24479788d65467e0479571c", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# -*- coding: utf-8 -*- """ Created on Thu May 26 12:25:24 2016 @author: kbefus """ import os,sys import numpy as np kbpath = r'C:/Research/Coastalgw/Model_develop/' sys.path.insert(1,kbpath) from cgw_model.prep import prep_utils as cprep #%% class CRM(object): ''' ''' def ...
{ "alphanum_fraction": 0.5525672372, "author": null, "avg_line_length": 38.0465116279, "converted": null, "ext": "py", "file": null, "hexsha": "a056ae949248470a8369eff36ef9eb2bd8882a8f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import pandas as pd import numpy as np from .utils.numerical_utils import gaussian_kde from ._configs import * import sys __all__ = ["identify_metastable_states", "approximate_FES"] def identify_metastable_states( colvar, selected_cvs, kBT, bandwidth, logweights=None, f...
{ "alphanum_fraction": 0.6232215001, "author": null, "avg_line_length": 39.5347222222, "converted": null, "ext": "py", "file": null, "hexsha": "042c765104456478a2303f27d418baa078819bf3", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import os import contextlib from detectron2.data import DatasetCatalog, MetadataCatalog from fvcore.common.timer import Timer from fvcore.common.file_io import PathManager import io import logging from detectron2.data.datasets.cityscapes import load...
{ "alphanum_fraction": 0.6581186193, "author": null, "avg_line_length": 38.6291079812, "converted": null, "ext": "py", "file": null, "hexsha": "f76a36ec0b1830bcfe6367075758e4b822f7f1ba", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#include <Eigen/Core> #include <Eigen/Dense> #include <Eigen/Geometry> #include "entity.hpp" namespace cuauv { namespace fishbowl { entity::entity(double m, double r, const inertia_tensor& I, const Eigen::Quaterniond& btom_rq) : m(m) , r(r) , I(I) , btom_rq(btom_rq) , btom_rm(btom_rq.matrix()) ...
{ "alphanum_fraction": 0.652173913, "author": null, "avg_line_length": 30.2926829268, "converted": null, "ext": "cpp", "file": null, "hexsha": "325a54c91f138080e7ea19f8e2c29faebd6c9914", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
"""Base classes for creating GUI objects to create manually selected points. The definition of X,Y axis is the following: xmin,ymin o---------o xmax,ymin | | | | | | | | xmin,ymax o---------o xmax,ymax """ from __future__ import abs...
{ "alphanum_fraction": 0.6125514717, "author": null, "avg_line_length": 31.6, "converted": null, "ext": "py", "file": null, "hexsha": "58ce4affc73da1e7ea9f5adba86ca3f047924db8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
import argparse import datetime import os from supervised_model.sup_model import Frontend from utils import config as cfg import time import numpy as np import torch import wandb from torch.utils.tensorboard import SummaryWriter from tianshou.data import Collector, PrioritizedVectorReplayBuffer, VectorReplayBuffer f...
{ "alphanum_fraction": 0.5492896281, "author": null, "avg_line_length": 41.0816733068, "converted": null, "ext": "py", "file": null, "hexsha": "4d66571fb1ecdd379e122e72905dbd0af9a08fc8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
from .context import assert_equal import pytest from sympy import Sum, I, Symbol, Integer a = Symbol('a', real=True, positive=True) b = Symbol('b', real=True, positive=True) i = Symbol('i', real=True, positive=True) n = Symbol('n', real=True, positive=True) x = Symbol('x', real=True, positive=True) def test_complex(...
{ "alphanum_fraction": 0.6494252874, "author": null, "avg_line_length": 23.7272727273, "converted": null, "ext": "py", "file": null, "hexsha": "0da7dd303431d1d25a8178acd3c9f372a31ef611", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Code from Chapter 18 of Machine Learning: An Algorithmic Perspective (2nd Edition) # by Stephen Marsland (http://stephenmonika.net) # You are free to use, change, or redistribute the code in any way you wish for # non-commercial purposes, but please maintain the name of the original author. # This code comes with no...
{ "alphanum_fraction": 0.5557386776, "author": null, "avg_line_length": 36.9975609756, "converted": null, "ext": "py", "file": null, "hexsha": "e1b7c92aa75aa3e142a6e8495fa642b6a1352891", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Author: weiwei import numpy as np from .metric import BaseMetric, filter_parameters, Compose from .functional.sixd import projection_2d, add, cm_degree, add_error, add_auc, nearest_point_distance, angular_error, \ translation_error # from leaf.metrics.metric import BaseMetric, filter_parameters, Compose # from ...
{ "alphanum_fraction": 0.5998205473, "author": null, "avg_line_length": 37.0265780731, "converted": null, "ext": "py", "file": null, "hexsha": "9134f4ce1fe11af69490f8cbde0dd86acc67c4e9", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#Problem 20: #n! means n × (n − 1) × ... × 3 × 2 × 1 #For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800, #and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 = 27. #Find the sum of the digits in the number 100! import sympy as sp def main(num): val = sp.factorial(num) summa = 0 va...
{ "alphanum_fraction": 0.5409836066, "author": null, "avg_line_length": 22.4736842105, "converted": null, "ext": "py", "file": null, "hexsha": "92ba0605a3330afc5729f406312d700af0a2d69f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
%!TEX TS-program = lualatex %!TEX encoding = UTF-8 Unicode \documentclass[letterpaper]{tufte-handout} %\geometry{showframe} % display margins for debugging page layout \usepackage{fontspec} \def\mainfont{Linux Libertine O} \setmainfont[Ligatures={Common,TeX}, Contextuals={NoAlternate}, BoldFont={* Bold}, ItalicFont=...
{ "alphanum_fraction": 0.7753641076, "author": null, "avg_line_length": 44.0326086957, "converted": null, "ext": "tex", "file": null, "hexsha": "dde7eafc95b75f393041dabfd87b9b9837808c5a", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
import numpy as np import matplotlib.pyplot as plt def plot_bar_figure( k8s, nomad, swarm, ylabel, xlabel, xtick_labels, figure_path ): ind = np.arange(len(xtick_labels)) width = 0.27 fig = plt.figure() ax = fig.add_subplot(111) k8s_rects = ...
{ "alphanum_fraction": 0.5605413105, "author": null, "avg_line_length": 24.6315789474, "converted": null, "ext": "py", "file": null, "hexsha": "f04c490bf18e7f70ede4e0b7d217908fdb6e5553", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
function banner() FIGlet.render("XtalsPyTools", FIGlet.availablefonts()[286]) end
{ "alphanum_fraction": 0.7191011236, "author": null, "avg_line_length": 22.25, "converted": null, "ext": "jl", "file": null, "hexsha": "22d6cfc1e9894cd2212086da60c85792b3541486", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
[STATEMENT] lemma preserves_cones: fixes J :: "'j comp" assumes "cone J A D a \<chi>" shows "cone J B (F o D) (F a) (F o \<chi>)" [PROOF STATE] proof (prove) goal (1 subgoal): 1. cone J (\<cdot>\<^sub>B) (F \<circ> D) (F a) (F \<circ> \<chi>) [PROOF STEP] proof - [PROOF STATE] proof (state) goal (1 subgoal...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "Category3_Limit", "hexsha": null, "include": null, "lang": null, "length": 20, "llama_tokens": 1668, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_m...
# based on: https://github.com/rlcode/per import numpy import random import numpy as np # stored as ( s, a, r, s_ ) in SumTree class PrioritizedReplayBuffer: def __init__(self, capacity, alpha=0.6, beta=0.4, beta_increment_per_sampling=0.001, e=0.01): self.tree = SumTree(capacity) self.alpha = alp...
{ "alphanum_fraction": 0.5834095761, "author": null, "avg_line_length": 27.7881355932, "converted": null, "ext": "py", "file": null, "hexsha": "d1fb7d49c476606ed9c646679e69c5635563930d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import gym import numpy as np import sys import matplotlib from random import randint if "../" not in sys.path: sys.path.append("../") from collections import defaultdict from lib.envs.blackjack import BlackjackEnv from lib import plotting matplotlib.style.use('ggplot') env = BlackjackEnv() def make_epsilon_gree...
{ "alphanum_fraction": 0.6056511057, "author": null, "avg_line_length": 29.0714285714, "converted": null, "ext": "py", "file": null, "hexsha": "debbb33fea2bbbe34bedcba38d40a7eebcddb9b4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
""" This function finds the hourly availability data for projects to be passed to expected and actual market clearing modules. """ function find_project_availability_data(project::P, availability_df::DataFrames.DataFrame, num_invperiods::Int64, ...
{ "alphanum_fraction": 0.5492163009, "author": null, "avg_line_length": 43.3276740238, "converted": null, "ext": "jl", "file": null, "hexsha": "2a3c9604ce2aabddff396bf832e72ea9d4d9f011", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# -*- coding: utf-8 -*- import numpy as np from numpy import testing from sktime.classification.dictionary_based import BOSSEnsemble, BOSSIndividual from sktime.datasets import load_gunpoint, load_italy_power_demand def test_boss_on_gunpoint(): # load gunpoint data X_train, y_train = load_gunpoint(split="tra...
{ "alphanum_fraction": 0.5403245943, "author": null, "avg_line_length": 23.5588235294, "converted": null, "ext": "py", "file": null, "hexsha": "f6b4c841405a82e058cad54908dbffb27995a850", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python # coding: utf-8 # ### This script was used to create a wikipedia linkfile for the entities in the FB15k and not the complete Freebase import utils import argparse import logging import os import pickle import string import time import numpy as np import pandas as pd data_repo_root = "../data/fb...
{ "alphanum_fraction": 0.6936744847, "author": null, "avg_line_length": 28.14, "converted": null, "ext": "py", "file": null, "hexsha": "1b04deee35cee0873abef3909bd56542883d04fb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
source('covidmap/stage1.r') # Wrapper script to recombine the results produced # inparallel from a run of stage1_run.r opt = covidmap_stage1_get_cmdline_options() covidmap_stage1_combine(opt)
{ "alphanum_fraction": 0.8144329897, "author": null, "avg_line_length": 24.25, "converted": null, "ext": "r", "file": null, "hexsha": "e494aa20aaf060a163005a5388d0a6af372ee20c", "include": null, "lang": "R", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": nul...
theory Variable imports Main begin datatype var = V nat primrec fresh' :: "var set \<Rightarrow> nat \<Rightarrow> nat" where "fresh' xs 0 = 0" | "fresh' xs (Suc x) = (if V (Suc x) \<in> xs then fresh' (xs - {V (Suc x)}) x else Suc x)" definition fresh :: "var set \<Rightarrow> var" where "fresh xs = V (fresh'...
{ "alphanum_fraction": null, "author": "xtreme-james-cooper", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_e...
function [fs, bmg] = slfiltersize(fs0) %SLFILTERSIZE Extracts information from filtersize % % $ Syntax $ % - [fs, bmg] = slfiltersize(fs0) % % $ Arguments $ % - fs0: The input filter size % - fs: The full filter size form % - bmg: The boundary margins % % $ Description $ % - [fs, bmg] = slfilt...
{ "alphanum_fraction": null, "author": "lmthang", "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_dat...
function sdl_colors(c::Colorant) sdl_colors( convert(ARGB{Colors.FixedPointNumbers.Normed{UInt8,8}}, c) ) end sdl_colors(c::ARGB) = Int.(reinterpret.((red(c), green(c), blue(c), alpha(c))))
{ "alphanum_fraction": 0.6715686275, "author": null, "avg_line_length": 25.5, "converted": null, "ext": "jl", "file": null, "hexsha": "d13cb8186ccb8b8eeba562f98ea038eb68ebcf39", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count":...
import sys import numpy as np import myface.face as face import myface.utils.utils as utils image = utils.load_image('./fig/fig1.jpeg') res = face.detect_face_and_encode(image) print(res['encoded_faces'].__len__)
{ "alphanum_fraction": 0.7777777778, "author": null, "avg_line_length": 19.6363636364, "converted": null, "ext": "py", "file": null, "hexsha": "539a9d9797481d758783cc1e67f76685ccd87f0e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python """ Convnets for image classification (1) ===================================== """ import numpy as np import deeppy as dp import matplotlib import matplotlib.pyplot as plt # Fetch MNIST data dataset = dp.dataset.MNIST() x_train, y_train, x_test, y_test = dataset.data(dp_dtypes=True) # Bring...
{ "alphanum_fraction": 0.624497992, "author": null, "avg_line_length": 25.5384615385, "converted": null, "ext": "py", "file": null, "hexsha": "82dc8dcf9a6b3f205d92a4d92541cff5e5029443", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import tensorrt as trt import numpy as np import os import cv2 import torch from efficientdet.scripts.utils import * #from utils import * import re TRT_LOGGER = trt.Logger(trt.Logger.VERBOSE) def get_engine(model_path: str): if os.path.exists(model_path) and model_path.endswith('trt'): print(f"Reading ...
{ "alphanum_fraction": 0.6590419806, "author": null, "avg_line_length": 34.7289719626, "converted": null, "ext": "py", "file": null, "hexsha": "1a757d6822a0f02b1e4a5bd9d3e014ad5f99dff4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import sys import os import numpy as _np sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../src/") import finoptions as fo def test_monte_carlo(): S = 100 K = 100 t = 1 / 12 sigma = 0.4 r = 0.10 b = 0.1 path_length = 30 mc_samples = 5000 mc_loops = 50 eps ...
{ "alphanum_fraction": 0.5823849579, "author": null, "avg_line_length": 21.9673913043, "converted": null, "ext": "py", "file": null, "hexsha": "ce7831b944c8a4749e9a6831deb018ba8d38ed3e", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
###### Content under Creative Commons Attribution license CC-BY 4.0, code under MIT license (c)2014 L.A. Barba, C.D. Cooper, G.F. Forsyth. # Spreading out Welcome to the fifth, and last, notebook of Module 4 "_Spreading out: diffusion problems,"_ of our fabulous course **"Practical Numerical Methods with Python."** ...
{ "alphanum_fraction": 0.8233294974, "author": null, "avg_line_length": 109.6627306273, "converted": true, "ext": "ipynb", "file": null, "hexsha": "370470feccd28c49adeed4b492b7b46c822c8a3c", "include": null, "lang": "Jupyter Notebook", "length": null, "llama_tokens": null, "mathlib_filename": nu...
//================================================================================================== /** Copyright 2016 NumScale SAS Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ //=====================================...
{ "alphanum_fraction": 0.5186693822, "author": null, "avg_line_length": 36.825, "converted": null, "ext": "hpp", "file": null, "hexsha": "4f888102d3cc312296179738cb5ed4c2188c3565", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count"...
import sys if sys.version_info.major < 3: from customaxesimage import CustomAxesImage else: from lib.customaxesimage import CustomAxesImage import numpy as np import math from kernel import setupkernel,setupintegratedkernel import globals if globals.debug > 0: from time import time try: from numba import ...
{ "alphanum_fraction": 0.5633786178, "author": null, "avg_line_length": 38.8302752294, "converted": null, "ext": "py", "file": null, "hexsha": "aaa2cc13aac297db4abafa5a782e0aca716c3c7c", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import csv import logging import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np import random import statistics as stat import glob import os import yaml logger = logging.getLogger(__name__) def set_size(w,h, ax=None): """ w, h: width, height in inches """ if not ax: ax=plt.gca() l =...
{ "alphanum_fraction": 0.608269096, "author": null, "avg_line_length": 36.1265822785, "converted": null, "ext": "py", "file": null, "hexsha": "8374e3132959583a9d7a8cc4c0390b12c57de3d4", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
''' Created on Sep 23, 2021 @author: immanueltrummer ''' import codexdb.code.generic from contextlib import redirect_stdout from io import StringIO import pandas as pd import sys class PythonGenerator(codexdb.code.generic.Generator): """ Generates Python code. """ def execute(self, db_id, question, gene...
{ "alphanum_fraction": 0.5561273721, "author": null, "avg_line_length": 35.7356321839, "converted": null, "ext": "py", "file": null, "hexsha": "3b0d59aa438ce0d78f34d2aaa97aa747099efe6a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#= This is a very crude first stab at the Tables.jl interface https://github.com/JuliaData/Tables.jl =# using Tables Tables.istable(::Type{<:KeyedArray}) = true Tables.rowaccess(::Type{<:KeyedArray}) = true function Tables.rows(A::Union{KeyedArray, NdaKa}) L = hasnames(A) ? (dimnames(A)..., :value) : # should ...
{ "alphanum_fraction": 0.6658861408, "author": null, "avg_line_length": 31.200913242, "converted": null, "ext": "jl", "file": null, "hexsha": "6fb910fdc9289f2c0b8c9e14b6adbaa89150eff0", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
#!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merg...
{ "alphanum_fraction": 0.7628915663, "author": null, "avg_line_length": 39.9038461538, "converted": null, "ext": "py", "file": null, "hexsha": "ac28a04a55678876fd62ce33f43b481d9bfca8a5", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import inspect import sys import itertools import random from abc import ABC, abstractproperty from distutils.version import LooseVersion import base64 import hashlib import logging import os from typing import Union import cv2 import numpy as np from ipso_phen.ipapi.base.ip_abstract import BaseImagePr...
{ "alphanum_fraction": 0.5157580859, "author": null, "avg_line_length": 33.7787951807, "converted": null, "ext": "py", "file": null, "hexsha": "317d0f1d9df0954499b550845b9a946f2a3ca7b2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#[0] is ours ##whole_level[1] calais #[2] ritter #[3] stanford import datetime from threading import Thread import random import math from queue import Queue import pandas as pd import warnings import numpy as np import time import pickle import matplotlib.pyplot as plt import copy import matplotlib.ticker as ticker...
{ "alphanum_fraction": 0.7436848865, "author": null, "avg_line_length": 31.85, "converted": null, "ext": "py", "file": null, "hexsha": "f9161648cc6f58be894e69757cb6f75669dcc16d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_count...
[STATEMENT] lemma lr_of_tran_fbs_acceptD: assumes s1: "valid_prefixes rt" "has_default_route rt" assumes s2: "no_oif_match fw" shows "generalized_sfw (lr_of_tran_fbs rt fw ifs) p = Some (r, oif, simple_action.Accept) \<Longrightarrow> simple_linux_router_nol12 rt fw p = Some (p\<lparr>p_oiface := oif\<rparr>)" ...
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": "LOFT_LinuxRouter_OpenFlow_Translation", "hexsha": null, "include": null, "lang": null, "length": 30, "llama_tokens": 4359, "mathlib_filename": null, "max_forks_count": null, "max_fo...
from pathfinding.core.diagonal_movement import DiagonalMovement from pathfinding.core.grid import Grid from pathfinding.finder.best_first import BestFirst import entities as ent import numpy as np finder = BestFirst(diagonal_movement=DiagonalMovement.never) def sub(a,b): n=a[0]-b[0] c=a[1]-b[1] nc=(n,c) ...
{ "alphanum_fraction": 0.6061210912, "author": null, "avg_line_length": 27.0810810811, "converted": null, "ext": "py", "file": null, "hexsha": "ad4cc29754b86e7ec87e709d1fbe7115efdec4d8", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
subroutine setlats_r(lats_nodes_r,global_lats_r,iprint,lonsperlar) ! use mod_param, only: nodes,latr,lonr,icolor,liope implicit none ! integer lats_nodes_r(nodes) integer global_lats_r(latr) integer iprint,opt,ifin,nodesio integer ...
{ "alphanum_fraction": 0.4994551398, "author": null, "avg_line_length": 27.8080808081, "converted": null, "ext": "f", "file": null, "hexsha": "ff188de953b99fc4333bdcebf1ae4a31f74d5358", "include": null, "lang": "FORTRAN", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#-*-coding:utf-8-*- import csv import re import pandas as pd import gensim import nltk from nltk.corpus import stopwords import numpy as np import math import ssl import random import collections def cos_sim(a, b): a_norm = np.linalg.norm(a) b_norm = np.linalg.norm(b) cos = np.dot(a,b)/(a_norm * b_norm) ...
{ "alphanum_fraction": 0.6574458276, "author": null, "avg_line_length": 39.0810810811, "converted": null, "ext": "py", "file": null, "hexsha": "b024903aee4a5eca9391f0262320c61a71af505f", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright 2019-2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fil...
{ "alphanum_fraction": 0.7832298137, "author": null, "avg_line_length": 41.2820512821, "converted": null, "ext": "py", "file": null, "hexsha": "e08db3edcb063730ce434f7d7e1251375bc4fbcc", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
#!/usr/bin/env python import argparse import numpy as np import scipy.io as sio import os import sys sys.path.insert(1, '.') import h5py from vdetlib.vdet.dataset import imagenet_vdet_classes from vdetlib.utils.common import quick_args from vdetlib.utils.protocol import proto_load, proto_dump, bbox_hash import gzip im...
{ "alphanum_fraction": 0.5527131783, "author": null, "avg_line_length": 35.3424657534, "converted": null, "ext": "py", "file": null, "hexsha": "7005161c0d4369825025e95103e96858f64358eb", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os import re from conllu import * import pandas as pd import numpy as np from collections import Counter def get_lexique_maju_mini(lexique): ''' Standardize the capitalization of words, with only PROPN capitalized ''' lexique_maju_mini = list() for terme in lexique: if terme[1]==...
{ "alphanum_fraction": 0.5957406351, "author": null, "avg_line_length": 49.1495327103, "converted": null, "ext": "py", "file": null, "hexsha": "02e7c471637c18cbfaaa8a83c7a985fbeca9f412", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import random import torch import logging import copy import os import numpy as np from functools import partial from transformers import ( MODEL_MAPPING, AutoConfig, AutoTokenizer, AutoModel, ) from densephrases import Encoder logger = logging.getLogger(__name__) def set_seed(args): random.seed...
{ "alphanum_fraction": 0.6771555996, "author": null, "avg_line_length": 33.9159663866, "converted": null, "ext": "py", "file": null, "hexsha": "bb6a396d6cc113afaef3cf331c9be7b15e9c9b18", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import os, sys BASE_DIR = os.path.normpath( os.path.join(os.path.dirname(os.path.abspath(__file__)))) import argparse import numpy as np import json import datetime from collections import defaultdict from data_utils import * import torch import torch.nn as nn import torch.nn.functional as F def compu...
{ "alphanum_fraction": 0.7649516845, "author": null, "avg_line_length": 30.632, "converted": null, "ext": "py", "file": null, "hexsha": "793d24f1cb7ea125005661860fce34885126e396", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_coun...
struct AdamIterable{T, F, S, R} w0::T f::F stepsize::S beta1::R beta2::R epsilon::R end AdamIterable(w0, f; stepsize=1e-3, beta1=0.9, beta2=0.999, epsilon=1e-8) = AdamIterable(w0, f, to_iterator(stepsize), beta1, beta2, epsilon) Base.IteratorSize(::Type{<:AdamIterable}) = Base.IsInfinite() mu...
{ "alphanum_fraction": 0.642287234, "author": null, "avg_line_length": 28.3773584906, "converted": null, "ext": "jl", "file": null, "hexsha": "13c4dacdc56c10fbd436ab3834f1d01eb9dddd25", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2018, PickNik LLC * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditi...
{ "alphanum_fraction": 0.7175951462, "author": null, "avg_line_length": 42.558685446, "converted": null, "ext": "cpp", "file": null, "hexsha": "b2929657bae3569203346a42b168074f35b84a6e", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
import itertools import numpy import pandas import sklearn.naive_bayes as naive_bayes # Set some options for printing all the columns pandas.set_option('precision', 13) # Define a function to visualize the percent of a particular target category by a nominal predictor def RowWithColumn ( rowVar, ...
{ "alphanum_fraction": 0.6923636364, "author": null, "avg_line_length": 36.1842105263, "converted": null, "ext": "py", "file": null, "hexsha": "141e2d43f385d386f25aa6e4916faca7092f343a", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
%!TEX root = forallx-ubc.tex \chapter{SL Trees} \label{ch.sl.trees} So far we have learned one way to evaluate SL argument forms for validity: an argument is valid just in case no interpretation satisfies the premises but falsifies the conclusion. We can check to see whether an argument is valid by constructing truth ...
{ "alphanum_fraction": 0.7260548816, "author": null, "avg_line_length": 41.7487113402, "converted": null, "ext": "tex", "file": null, "hexsha": "77f220683e08aee0d1616ed2b07676189bf69661", "include": null, "lang": "TeX", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks...
# 1. design model - we need input size and output size, forward pass with # all the different layers # 2. construct the loss and optimizer # 3. training loop # a. compute prediction # b. do backward pass to get gradients # c. update our weights # slight adjustments to model and cost function. import torch...
{ "alphanum_fraction": 0.7164004675, "author": null, "avg_line_length": 32.0875, "converted": null, "ext": "py", "file": null, "hexsha": "7e3192a7997d6efb07f15fc0177af2de94a2da1d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
// ------------------------------------ // #include "GlobalCEFHandler.h" #include "GUI/GuiCEFApplication.h" #include "include/cef_app.h" #include <boost/filesystem.hpp> #include <iostream> using namespace Leviathan; // ------------------------------------ // DLLEXPORT bool Leviathan::GlobalCEFHandler::CEFFirstChe...
{ "alphanum_fraction": 0.6494893222, "author": null, "avg_line_length": 29.206779661, "converted": null, "ext": "cpp", "file": null, "hexsha": "7d4e64669eb88e497938eb4f4c0ec6acb5685edd", "include": null, "lang": "C++", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_...
/* learn.c */ #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include <gsl/gsl_rng.h> #include <gsl/gsl_multifit.h> #include "learn.h" #include "feature.h" #include "imatrix.h" #include "dmatrix.h" #include "util.h" #include "likelihood.h" #include "hyper.h" void mvslda_learn(documen...
{ "alphanum_fraction": 0.4718234981, "author": null, "avg_line_length": 35.1588785047, "converted": null, "ext": "c", "file": null, "hexsha": "2871dce7add65922b146db4426992c6b6cc23990", "include": null, "lang": "C", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_forks_cou...
import numpy as np from flexx import flx from bokeh.plotting import figure # import trainer.lib as lib x = np.linspace(0, 6, 50) p1 = figure() p1.line(x, np.sin(x)) p2 = figure() p2.line(x, np.cos(x)) class DebuggerGui(flx.PyWidget): # def __init__(self): # # self.bs: List[Optional[flx.Button]] = [Non...
{ "alphanum_fraction": 0.5714285714, "author": null, "avg_line_length": 28.1666666667, "converted": null, "ext": "py", "file": null, "hexsha": "253d3442431af12ef9042328aea6361aaebe7f45", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Morphological Transforamtions # using HSV (hue satutaiton value ) import cv2 import numpy as np cap = cv2.VideoCapture(0) # select the first camera in the system while True: _ , frame = cap.read() hsv = cv2.cvtColor(frame , cv2.COLOR_BGR2HSV) # Now filter the video ( remove Noise , ...
{ "alphanum_fraction": 0.6218978102, "author": null, "avg_line_length": 24.9090909091, "converted": null, "ext": "py", "file": null, "hexsha": "20a1ae411c6f1737458faf90c2204030ed3bde31", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# Copyright 2020 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
{ "alphanum_fraction": 0.7050272562, "author": null, "avg_line_length": 33.693877551, "converted": null, "ext": "py", "file": null, "hexsha": "fc641f8099abea1399f4bf96c532ca0d2f7dd76d", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
from collections import OrderedDict import numpy as np from gym.spaces import Box, Dict from multiworld.envs.env_util import get_stat_in_paths, \ create_stats_ordered_dict, get_asset_full_path from multiworld.core.multitask_env import MultitaskEnv from multiworld.envs.mujoco.sawyer_xyz.base import SawyerXYZEnv fro...
{ "alphanum_fraction": 0.590381632, "author": null, "avg_line_length": 35.4175824176, "converted": null, "ext": "py", "file": null, "hexsha": "115dc111b9fb3a89fe2991a5ae279eeb53b30612", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
# -*- coding: utf-8 -*- """ Creates and saves CNN model for keyword detection. """ import json import numpy as np from sklearn.model_selection import train_test_split import tensorflow.keras as keras DATA_PATH = "data.json" SAVED_MODEL_PATH = "model.h5" LEARNING_RATE = 0.001 EPOCHS = 40 BATCH_SIZE = 32 NUMBER_OF_KE...
{ "alphanum_fraction": 0.6627641348, "author": null, "avg_line_length": 30.452173913, "converted": null, "ext": "py", "file": null, "hexsha": "9e8a0a17813528925a38fa9fc95c4b0e6c01b1dc", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import os, sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)),"../")) from skdecide.builders.discrete_optimization.generic_tools.do_problem import Solution, Problem, EncodingRegister, TypeAttribute, \ ObjectiveRegister, TypeObjective, ObjectiveHandling, ModeOptim from typing import List, Un...
{ "alphanum_fraction": 0.6040942144, "author": null, "avg_line_length": 42.8881355932, "converted": null, "ext": "py", "file": null, "hexsha": "c0a71e645ce485043ef9025160745200dc09ab32", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
# -*- coding:utf-8 -*- # &Author AnFany import pandas as pd import numpy as np # 训练数据文件路径 train_path = 'C:/Users/GWT9\Desktop/Adult_Train.csv' # 测试数据文件路径 test_path = 'C:/Users/GWT9\Desktop/Adult_Test.csv' # 因为测试数据native-country中不存在Holand-Netherlands,不便于独热编码。 # 因此在测试文件中添加一个native-country为Holand-N...
{ "alphanum_fraction": 0.6097178683, "author": null, "avg_line_length": 31.5061728395, "converted": null, "ext": "py", "file": null, "hexsha": "b0c1c81605703f3d9673ec0e12514d5963a0a1f0", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
[STATEMENT] lemma map_color_of: "color_of (map f t) = color_of t" [PROOF STATE] proof (prove) goal (1 subgoal): 1. color_of (RBT_Impl.map f t) = color_of t [PROOF STEP] by (induct t) simp+
{ "alphanum_fraction": null, "author": null, "avg_line_length": null, "converted": null, "ext": null, "file": null, "hexsha": null, "include": null, "lang": null, "length": 1, "llama_tokens": 87, "mathlib_filename": null, "max_forks_count": null, "max_forks_repo_forks_event_max_datetime": nu...
from __future__ import (absolute_import, division, print_function) """ This example shows how to plot data on rectangular 2D grids (grids that are not rectlinear in geographic or native map projection coordinates). An example of such a grid is the 'POP' grid which is used in the ocean component NCAR Community Climate...
{ "alphanum_fraction": 0.7430651872, "author": null, "avg_line_length": 35.6049382716, "converted": null, "ext": "py", "file": null, "hexsha": "1a0d719f2db6a86859e32b66d62f32a3ff639b40", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import random import numpy as np import matplotlib from matplotlib import pyplot from matplotlib.animation import FuncAnimation def draw_image(idx, centroids, width, height): """ Draw image from :param idx: :param centroids: :param width: :param height: :return: """ data = np.zeros...
{ "alphanum_fraction": 0.5479172735, "author": null, "avg_line_length": 27.685483871, "converted": null, "ext": "py", "file": null, "hexsha": "d9e80e13adf95ad1f81987b93949e9aea11d16a1", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt from scipy.stats import chi2_contingency, chi2 #%% df = pd.read_csv('data/advertisement_clicks.csv') df.head() #%% Create the contingency table df_crosstab = pd.crosstab(df['advertisement_id'], df['action'], margins = False) ...
{ "alphanum_fraction": 0.7310704961, "author": null, "avg_line_length": 24.9782608696, "converted": null, "ext": "py", "file": null, "hexsha": "2a1129b5bea0cfdad5f635c08cbc0bd7634a71a2", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import cv2 import numpy as np import os # Capturing the user's web cam camera = cv2.VideoCapture(0) # Creating a classifier object classifier = cv2.CascadeClassifier("..\Datasets\haarcascade_frontalface_default.xml") # The name of the file where data is stored file_name = "saved_data.npy" # Attributes boxes around ...
{ "alphanum_fraction": 0.6433597186, "author": null, "avg_line_length": 26.7529411765, "converted": null, "ext": "py", "file": null, "hexsha": "bce0cff41bd232c627e8b786a3ddb86001c05f34", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_for...
import keras import pandas as pd import numpy as np from numpy.random import randint from keras.models import Sequential from keras.layers import * import pdb def evaluate_metrics(Yt, Yp): tp = Yt.sum() tn = Yt.size - tp fp = Yp[Yt == 0].sum() fn = (1 - Yp[Yt == 1]).sum() prec = tp / (tp + fp) ...
{ "alphanum_fraction": 0.6420750782, "author": null, "avg_line_length": 27.014084507, "converted": null, "ext": "py", "file": null, "hexsha": "b3be81be40f2feb5f1f7925b18215485c180a466", "include": true, "lang": "Python", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...
using Statistics using StatsBase using SpecialFunctions using Roots include("load_data.jl") ############################################################################### ############################################################################### ### functions that work on interaction activity """ coefficie...
{ "alphanum_fraction": 0.6421475611, "author": null, "avg_line_length": 33.6804511278, "converted": null, "ext": "jl", "file": null, "hexsha": "60579f73a66a6496c694a93626a8504f64d2e066", "include": null, "lang": "Julia", "length": null, "llama_tokens": null, "mathlib_filename": null, "max_fork...