View timeseries.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from functools import reduce | |
from sortedcontainers import SortedSet, SortedDict | |
from typing import List, Callable, TypeVar, Any, Generic, Optional, Tuple, Dict | |
from collections import namedtuple, defaultdict | |
import haiku | |
import jax | |
import jax.scipy | |
import numpy.random |
View gist:43ce7fc4adc1503bcfddd8c24afc45eb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Translating Stan model to C++ code --- | |
bin/stanc --o=lv.hpp lv.stan | |
--- Compiling, linking C++ code --- | |
clang++ -std=c++1y -D_REENTRANT -Wno-sign-compare -Wno-ignored-attributes -I stan/lib/stan_math/lib/tbb_2020.3/include -O3 -I src -I stan/src -I lib/rapidjson_1.1.0/ -I lib/CLI11-1.9.1/ -I stan/lib/stan_math/ -I stan/lib/stan_math/lib/eigen_3.3.9 -I stan/lib/stan_math/lib/boost_1.75.0 -I stan/lib/stan_math/lib/sundials_5.7.0/include -DBOOST_DISABLE_ASSERTS -c -include-pch stan/src/stan/model/model_header.hpp.gch -x c++ -o lv.o lv.hpp | |
In file included from lv.hpp:1: | |
In file included from stan/src/stan/model/model_header.hpp:4: | |
In file included from /home/bbales2/tmp/cmdstan-ode-adjoint-v3/stan/lib/stan_math/stan/math.hpp:19: | |
In file included from /home/bbales2/tmp/cmdstan-ode-adjoint-v3/stan/lib/stan_math/stan/math/rev.hpp:11: | |
In file included from /home/bbales2/tmp/cmdstan-ode-adjoint-v3/stan/lib/stan_math/stan/math/rev/functor.hpp:20: |
View constrain.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code generated by stanc 4f8f010 | |
#include <stan/model/model_header.hpp> | |
namespace constrain_model_namespace { | |
inline void validate_positive_index(const char* var_name, const char* expr, | |
int val) { | |
if (val < 1) { | |
std::stringstream msg; |
View vector_sum.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <benchmark/benchmark.h> | |
#include <stan/math.hpp> | |
#include <utility> | |
static void toss_me(benchmark::State& state) { | |
using stan::math::var; | |
Eigen::Matrix<double, -1, -1> x_vals = Eigen::MatrixXd::Random(256, 256); | |
Eigen::Matrix<double, -1, -1> y_vals = Eigen::MatrixXd::Random(256, 256); | |
using stan::math::var; | |
using stan::math::sum; |
View scalar_bench2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <benchmark/benchmark.h> | |
#include <stan/math.hpp> | |
#include <utility> | |
static void toss_me(benchmark::State& state) { | |
using stan::math::var; | |
Eigen::Matrix<double, -1, -1> x_vals = Eigen::MatrixXd::Random(256, 256); | |
Eigen::Matrix<double, -1, -1> y_vals = Eigen::MatrixXd::Random(256, 256); | |
using stan::math::var; | |
using stan::math::sum; |
View scalar_bench.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <benchmark/benchmark.h> | |
#include <stan/math.hpp> | |
#include <utility> | |
static void toss_me(benchmark::State& state) { | |
using stan::math::var; | |
Eigen::Matrix<double, -1, -1> x_vals = Eigen::MatrixXd::Random(256, 256); | |
Eigen::Matrix<double, -1, -1> y_vals = Eigen::MatrixXd::Random(256, 256); | |
using stan::math::var; | |
using stan::math::sum; |
View scalar_adj_jac.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <benchmark/benchmark.h> | |
#include <stan/math.hpp> | |
#include <utility> | |
// Just to kick off the stack allocation | |
static void geometric_series(benchmark::State& state) { | |
using stan::math::var; | |
for (auto _ : state) { | |
auto start = std::chrono::high_resolution_clock::now(); | |
var r = 1.0; |
View prim_fun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MatrixExponential | |
accumulator | |
add | |
add_diag | |
append_col | |
append_row | |
assign | |
autocorrelation | |
autocovariance | |
block |
View apply_x_unary
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
These are all the files in stan/math/prim/fun that reference apply_scalar_unity: | |
acosh.hpp | |
acos.hpp | |
approx.hpp | |
asinh.hpp | |
asin.hpp | |
atanh.hpp | |
atan.hpp | |
cbrt.hpp |
View rev_fun.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
adj_jac_apply - deprecated | |
# Fully converted to var<mat> | |
softmax | |
dot_self | |
columns_dot_self | |
determinant | |
inverse | |
sum | |
multiply |
NewerOlder