Upload folder using huggingface_hub
Browse files- .gitattributes +1 -34
- README.md +71 -0
- SHA256SUMS +2 -0
- nlg.bin +3 -0
- nlg.vgf +3 -0
.gitattributes
CHANGED
|
@@ -1,35 +1,2 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
| 1 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.vgf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -1,3 +1,74 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- global-illumination
|
| 5 |
+
- neural-light-grid
|
| 6 |
+
- hypernetwork
|
| 7 |
+
- vulkan
|
| 8 |
+
- vgf
|
| 9 |
+
- tosa
|
| 10 |
+
- int8
|
| 11 |
+
- real-time-rendering
|
| 12 |
---
|
| 13 |
+
|
| 14 |
+
# Neural Light Grid generator
|
| 15 |
+
|
| 16 |
+
The generator network of a Neural Light Grid (Iwanicki et al., "Neural Light Grid", Advances in Real-Time Rendering in
|
| 17 |
+
Games, SIGGRAPH 2024).
|
| 18 |
+
|
| 19 |
+
A Neural Light Grid is a lattice of irradiance probes. Every probe owns a weighting function over 8192 support points
|
| 20 |
+
in the cube of one probe spacing around it: trilinear where the probe sees, diffused around corners through the
|
| 21 |
+
visibility graph of the points, zero inside geometry. A small network per probe (3 → 8 → 8 → 1, LeakyReLU, 113
|
| 22 |
+
coefficients) stores that function.
|
| 23 |
+
This model turns a function into the probe's network in one pass: the first 512
|
| 24 |
+
PCA coefficients of the function go through a 6-layer, 512-wide LeakyReLU MLP with skip connections that outputs the 113
|
| 25 |
+
coefficients.
|
| 26 |
+
|
| 27 |
+
## Files
|
| 28 |
+
|
| 29 |
+
| File | Size | Contents |
|
| 30 |
+
|---|---|---|
|
| 31 |
+
| `nlg.vgf` | 6.1 MB | The generator, PCA included, as an int8 TOSA graph in a VGF container, for `VK_ARM_data_graph` |
|
| 32 |
+
| `nlg.bin` | 15.1 MB | The support point pattern, the PCA, the float layers (for GPUs without data graphs) and the output scale of the graph |
|
| 33 |
+
|
| 34 |
+
### `nlg.vgf`
|
| 35 |
+
|
| 36 |
+
- Input: `[1, 256, 1, 8192]` int8, 256 probes per dispatch, every value `round(255 * phi) - 128` of the probe's function
|
| 37 |
+
at the 8192 support points (in the order of the pattern in `nlg.bin`).
|
| 38 |
+
- Output: `[1, 256, 1, 113]` int32 accumulators; coefficient `i` is `output[i] * outputScale[i]` (the last 113 floats of
|
| 39 |
+
`nlg.bin`).
|
| 40 |
+
- Graph: the PCA projection as an int8 1x1 CONV2D with 8192 inputs (the mean folded into its bias), then every layer as an
|
| 41 |
+
int8 CONV2D into int32 with a per-channel RESCALE, LeakyReLU (slope 0.01) as a TABLE, the skip connections summed in an
|
| 42 |
+
int32 stream.
|
| 43 |
+
|
| 44 |
+
### `nlg.bin` (little endian)
|
| 45 |
+
|
| 46 |
+
```
|
| 47 |
+
u32 header[8] 'NLGG' (0x47474C4E), version 2, points 8192, pca 512, width 512, layers 6, coefficients 113, 0
|
| 48 |
+
f32 points[8192][3] support points in [-1, 1]^3, in probe spacings
|
| 49 |
+
f32 mean[8192] PCA mean
|
| 50 |
+
f16 basis[8192][512] PCA basis
|
| 51 |
+
7 linear layers (first, 5 residual blocks, output), each:
|
| 52 |
+
f32 weightsT[inputs][outputs] transpose of the PyTorch weight
|
| 53 |
+
f32 bias[outputs]
|
| 54 |
+
f32 outputScale[113] scale of the int32 outputs of the graph
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
The generator computes `h = leaky(first(pca(phi)))`, `h += leaky(block(h))` five times, `theta = last(h)`.
|
| 58 |
+
|
| 59 |
+
### The 113 coefficients of a probe network
|
| 60 |
+
|
| 61 |
+
For a position `x` relative to the probe, in spacings: `h1 = leaky(W1 x + b1)`, `h2 = leaky(W2 h1 + b2)`, `w = W3 h2 + b3`,
|
| 62 |
+
stored as `W1[8][3]` (row-major), `b1[8]`, `W2[8][8]`, `b2[8]`, `W3[8]`, `b3`.
|
| 63 |
+
|
| 64 |
+
## Training
|
| 65 |
+
|
| 66 |
+
- Loss: the squared difference between the generated network and the function, at 2048 random valid support points per
|
| 67 |
+
step, end to end through the 3-8-8-1 network. 40 epochs, Adam, cosine schedule.
|
| 68 |
+
- Quantization: per-channel post-training quantization, evaluated bit for bit against the integer arithmetic of the graph.
|
| 69 |
+
|
| 70 |
+
## Limitations
|
| 71 |
+
|
| 72 |
+
- One lattice level and one probe spacing; no adaptive hierarchy as in the SIGGRAPH talk.
|
| 73 |
+
- The functions treat a point whose ray to a neighbour meets a back face as inside geometry, so scenes without closed or
|
| 74 |
+
consistently oriented surfaces get fewer valid points.
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
531320edc2fc8b4cab4e94a806e186b874864304384e016992824dca71e8362d nlg.bin
|
| 2 |
+
fc8017d91543647c223c88cad31faf1195b01bb0a6061bd86c555783cf90662f nlg.vgf
|
nlg.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:531320edc2fc8b4cab4e94a806e186b874864304384e016992824dca71e8362d
|
| 3 |
+
size 15055784
|
nlg.vgf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc8017d91543647c223c88cad31faf1195b01bb0a6061bd86c555783cf90662f
|
| 3 |
+
size 6074216
|