diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e8d6c0bd..89e50006 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -90,7 +90,7 @@ Allows composing multiple encodings. The following example replicates the Neural From NeRF [[Mildenhall et al. 2020]](https://www.matthewtancik.com/nerf). Works better than OneBlob encoding if the dynamic range of the encoded dimension is high. However, suffers from stripe artifacts. -The number of encoded dimensions is twice the specified number of frequencies for each input dimension. +The number of encoded dimensions is twice the specified number of frequencies for each input dimension. E.g. with `n_frequencies == 4`, an input dimension `x` becomes `sin(πx), cos(πx), sin(2πx), cos(2πx), sin(4πx), cos(4πx), sin(8πx), cos(8πx)`. ```json5 { diff --git a/include/tiny-cuda-nn/encodings/frequency.h b/include/tiny-cuda-nn/encodings/frequency.h index 938b89e9..c041b652 100644 --- a/include/tiny-cuda-nn/encodings/frequency.h +++ b/include/tiny-cuda-nn/encodings/frequency.h @@ -65,17 +65,15 @@ __global__ void frequency_encoding( * frequency-encoded input dimension 0 * frequency-encoded input dimension 1 * frequency-encoded input dimension ... - * passthrough inputs * padding (value 1.f) */ if (j >= fan_out_encoded) { data_out(j, i) = 1; } else { /* Layout of encoded features (e.g. when inputs abcd.. are XYZ positions): - * sin(a.x), cos(a.x) sin(2pi a.x), cos(2pi a.x) sin(4pi a.x) ... - * sin(a.y), cos(a.y) sin(2pi a.y), cos(2pi a.y) sin(4pi a.y) ... - * sin(a.z), cos(a.z) sin(2pi a.z), cos(2pi a.z) sin(4pi a.z) ... - * (passthrough features) + * sin(pi a.x), cos(pi a.x) sin(2pi a.x), cos(2pi a.x) sin(4pi a.x) ... + * sin(pi a.y), cos(pi a.y) sin(2pi a.y), cos(2pi a.y) sin(4pi a.y) ... + * sin(pi a.z), cos(pi a.z) sin(2pi a.z), cos(2pi a.z) sin(4pi a.z) ... * (padding) */ const uint32_t encoded_input_feature_i = j / (n_frequencies * 2);