Skip to content

Instantly share code, notes, and snippets.

// smallgdpt: a simple implementation of gradient domain path tracing
// https://mediatech.aalto.fi/publications/graphics/GPT/
// adapted from smallpt by Kevin Beason http://www.kevinbeason.com/smallpt/
// and a screened poisson solver by Pravin Bhat http://grail.cs.washington.edu/projects/screenedPoissonEq/
// to build, type: g++ -o smallgdpt -fopenmp -O3 smallgdpt.cpp -L/usr/local/lib -lm -lfftw3
// you will need fftw3 http://www.fftw.org/ to compile
// usage: ./smallgdpt [number of samples per pixel]
#include <fftw3.h>
#include <math.h>
#include <stdlib.h>
% Some predefined strings for conferences & journals
@string{AAAI = "Conference on Artificial Intelligence (AAAI)"}
@string{AISTATS = "International Conference on Artificial Intelligence and Statistics (AISTATS)"}
@string{Bernoulli = "Bernoulli"}
@string{Biometrika = "Biometrika"}
@string{CandG = "Computers \& Graphics"}
@string{CACM = "Commun. ACM"}
@string{CG_SIGGRAPH = "Comput. Graph. (Proc. SIGGRAPH)"}
@string{CGA = "IEEE Comput. Graph. Appl."}
@string{CGF = "Comput. Graph. Forum"}
@BachiLi
BachiLi / rfactor_split.cpp
Last active January 8, 2019 16:35
Halide bug?
// g++ rfactor_split.cpp -I ${HALIDE_DIR}/include -I ${HALIDE_DIR}/tools -L ${HALIDE_DIR}/bin -lHalide -o rfactor_split -std=c++11 -O2
// LD_LIBRARY_PATH=${HALIDE_DIR}/bin ./rfactor_split
#include "Halide.h"
using namespace Halide;
int main(int argc, char *argv[]) {
Var x("x");
int n = 10000;
#ifndef AUTODIFF_H__
#define AUTODIFF_H__
#include "delta_ray.h"
#include <vector>
#include <cmath>
#include <algorithm>
#include <iostream>
from adt import ADT
from adt import memo as ADTMemo
import ast
import inspect
# Define the grammar
cohe = ADT("""
module cohe {
float_expr = FloatConst ( float val )
| FloatAdd ( float_expr lhs, float_expr rhs )
import jax.numpy as np
import skimage
import skimage.io
import matplotlib.pyplot as plt
import math
lambda_d = 1
img = skimage.img_as_float(skimage.io.imread('cameraman.png'))
grad_x = np.roll(img, 1, axis=[1]) - img