This file contains hidden or 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
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 |
This file contains hidden or 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 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 ) |
This file contains hidden or 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
#ifndef AUTODIFF_H__ | |
#define AUTODIFF_H__ | |
#include "delta_ray.h" | |
#include <vector> | |
#include <cmath> | |
#include <algorithm> | |
#include <iostream> |
This file contains hidden or 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
// 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; |
This file contains hidden or 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
% 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"} |
This file contains hidden or 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
// 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> |