{{ message }}

Instantly share code, notes, and snippets.

💭
🍺

# Pavel tastyminerals

💭
🍺
• Gini GmbH
• Munich, Germany
Created Mar 29, 2020
Numpy benchmarks
View numpy_bench.py
 import argparse from collections import defaultdict as dd from time import perf_counter as timer import numpy as np def functions(nruns=1): rows, cols = 500, 600 reduceRows, reduceCols = rows / 5, cols / 6
Last active Mar 29, 2020
Julia benchmarks
View julia_bench.jl
 using BenchmarkTools using Random using LinearAlgebra BenchmarkTools.DEFAULT_PARAMETERS.evals = 20 # define arrays and matrices rows, cols = 500, 600 reduceRows, reduceCols = Int(rows / 5), Int(cols / 6)
Last active Jan 2, 2021
Julia vs Numpy
View benchmarks.md
Description NumPy (MKL) (sec.) Julia (sec.)
Dot (scalar) product of two 300000 arrays (float64), (1000 loops) 0.03528142820068751 0.027905 (x1/1.3)
Element-wise sum of two 100x100 matrices (int), (1000 loops) 0.0037877704002312385 0.0061 (x1.6)
Element-wise multiplication of two 100x100 matrices (float64), (1000 loops) 0.004193491550176986 0.032161 (x7.7)
L2 norm of 500x600 matrix (float64), (1000 loops) 0.023907507749936486 0.096 (x4)
Matrix product of 500x600 and 600x500 matrices (float64) 0.0018566828504845035 0.01988 (x10.7)
Sort of 500x600 matrix (float64) **0.0103262
Created Nov 25, 2019
change-making problem in D (naive implementation)
View change.d
 #!/usr/bin/rdmd import std.algorithm : cartesianProduct; import std.array; import std.container.rbtree : redBlackTree; import std.stdio; int minimum_coins(int target, in int[] denominations) { auto origSet = redBlackTree(target);
Created Jan 30, 2018
demo
View gist:cb2c0bcfa046050c403ba9d2b75f09a9
 class NetworkInit(vocabSize: Int) { private val embeddingWidth = 100 private val hiddenSize = 200 private val numberOfFeats = 9 private val numberOfClasses = 1 val config: ComputationGraphConfiguration = new NeuralNetConfiguration.Builder() .learningRate(DatasetTools.getTomlConfTable("romain").getDouble("minlr")) .graphBuilder() .addInputs("wordIndeces")
Created Jan 30, 2018
demoNet
View demo
 class NetworkInit(vocabSize: Int) { private val embeddingWidth = DatasetTools.getTomlConfTable("romain").getLong("inputsize").toInt private val hiddenSize = DatasetTools.getTomlConfTable("romain").getLong("hiddensize").toInt private val numberOfFeats = DatasetTools.getTomlConfTable("romain").getLong("feats").toInt private val numberOfClasses = DatasetTools.getTomlConfTable("romain").getLong("classes").toInt val config: ComputationGraphConfiguration = new NeuralNetConfiguration.Builder() .learningRate(DatasetTools.getTomlConfTable("romain").getDouble("minlr")) .graphBuilder() .addInputs("wordIndeces")
Created Jan 30, 2018
MultiDataSetIterator
View test