Giter VIP home page Giter VIP logo

superpolynomials.jl's Introduction

SuperPolynomials

Exploration of evaluating multivariate Polynomials using the @generated macro.

import SuperPolynomials
const SP = SuperPolynomials
import FixedPolynomials
const FP = FixedPolynomials
using BenchmarkTools

# We have 24 variables
N = 24
# with 20 terms
M = 20
# generate random exponents with degree between 0 and 5 (per variable)
exponents = round.(Int, 5 * rand(N, M))
# some random coefficients
coefficients = rand(M)
g = SP.SuperPolynomial(coefficients, exponents)
w = rand(N)

f = FP.Polynomial(exponents, coefficients)
cfg = FP.GradientConfig(f)

@btime SP.evaluate($g, $w) # 130.837 ns (0 allocations: 0 bytes)
@btime FP.evaluate($f, $w, $cfg) # 1.580 μs (0 allocations: 0 bytes)

superpolynomials.jl's People

Contributors

saschatimme avatar

Stargazers

ebigram avatar David P. Sanders avatar

Watchers

James Cloos avatar Benoît Legat avatar  avatar

superpolynomials.jl's Issues

META: Routines to add

  • Symbol (partial) derivatives
  • Combined evaluation of f and the gradient (or only certain partial derivatives?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.