Blog Archives

SIMD Map-Reduction with RcppNT2

February 1, 2016
By
SIMD Map-Reduction with RcppNT2

Introduction The Numerical Template Toolbox (NT2) collection of header-only C++ libraries that make it possible to explicitly request the use of SIMD instructions when possible, while falling back to regular scalar operations when not. NT2 itself is powered by Boost, alongside two proposed Boost libraries – Boost.Dispatch, which provides a mechanism for efficient tag-based dispatch for functions, and Boost.SIMD, which provides a framework for the implementation of...

Read more »

Using RcppNT2 to Compute the Variance

January 31, 2016
By
Using RcppNT2 to Compute the Variance

Introduction The Numerical Template Toolbox (NT2) collection of header-only C++ libraries that make it possible to explicitly request the use of SIMD instructions when possible, while falling back to regular scalar operations when not. NT2 itself is powered by Boost, alongside two proposed Boost libraries – Boost.Dispatch, which provides a mechanism for efficient tag-based dispatch for functions, and Boost.SIMD, which provides a framework for the implementation of...

Read more »

Introduction to RcppNT2

January 31, 2016
By
Introduction to RcppNT2

Modern CPU processors are built with new, extended instruction sets that optimize for certain operations. A class of these allow for vectorized operations, called Single Instruction / Multiple Data (SIMD) instructions. Although modern compilers will use these instructions when possible, they are often unable to reason about whether or not a particular block of code can be executed using SIMD instructions. The Numerical Template Toolbox...

Read more »

Writing fast asynchronous SGD/AdaGrad with RcppParallel

January 23, 2016
By
Writing fast asynchronous SGD/AdaGrad with RcppParallel

Word embeddings After Tomas Mikolov et al. released word2vec tool, there was a boom of articles about words vector representations. One of the greatest is GloVe, which did a big thing by explaining how such algorithms work. It also refolmulates word2vec optimization as a special kind of factoriazation for word cooccurences matrix. This post is devided into two main...

Read more »

Writing fast asynchronous SGD/AdaGrad with RcppParallel

January 23, 2016
By
Writing fast asynchronous SGD/AdaGrad with RcppParallel

Word embeddings After Tomas Mikolov et al. released word2vec tool, there was a boom of articles about words vector representations. One of the greatest is GloVe, which did a big thing by explaining how such algorithms work. It also refolmulates word2vec optimization as a special kind of factoriazation for word cooccurences matrix. This post is devided into two main...

Read more »

Serialize and Deserialize a C++ Object in Rcpp

November 6, 2015
By
Serialize and Deserialize a C++ Object in Rcpp

This post shows how to serialize a C++ object into a R raw vector object—the base type used by the internal R serialization—and how to deserialize it. The following example shows a toy C++ class and the related serialize/deserialize functions. It shows how one can use the cereal header-only C++ library and Boost Iostreams in Rcpp. It relies...

Read more »

Serialize and Deserialize a C++ Object in Rcpp

November 6, 2015
By
Serialize and Deserialize a C++ Object in Rcpp

This post shows how to serialize a c++ object to the raw vector in R and deserialize it with the help of Rcereal and BH. First, please install the Rcpp, Rcereal, and BH from CRAN and enable the support of C++11 via Sys.setenv("PKG_CXXFLAGS"="-std=c++11"). We can use the cereal library and boost iostreams in Rcpp. The following example shows a toy C++...

Read more »

Stochastic SIR Epidemiological Compartment Model

April 24, 2015
By
Stochastic SIR Epidemiological Compartment Model

Introduction This post is a simple introduction to Rcpp for disease ecologists, epidemiologists, or dynamical systems modelers - the sorts of folks who will benefit from a simple but fully-working example. My intent is to provide a complete, self-contained introduction to modeling with Rcpp. My hope is that this model can be easily modified to run any dynamical simulation that has dependence on the...

Read more »

Stochastic SIR Epidemiological Compartment Model

April 24, 2015
By
Stochastic SIR Epidemiological Compartment Model

Introduction This post is a simple introduction to Rcpp for disease ecologists, epidemiologists, or dynamical systems modelers - the sorts of folks who will benefit from a simple but fully-working example. My intent is to provide a complete, self-contained introduction to modeling with Rcpp. My hope is that this model can be easily modified to run any dynamical simulation that has dependence on the...

Read more »

Call matplotlib from R

April 1, 2015
By
Call matplotlib from R

Motivation I often use Python and matplotlib for exploring measurement data (from e.g. accelerometers), even if I use R for the actual analysis. The reason is that I like to be able to flexibly zoom into different parts of the plot using the mouse and this works well for me with matplotlib. So I decided to try to call matplotlib from R using...

Read more »

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)