pub struct HashEncoder {
pub hash_tables: Vec<Vec<Vec<f64>>>,
pub n_levels: usize,
pub n_features_per_level: usize,
pub base_resolution: usize,
pub resolution_growth: f64,
pub table_size: usize,
}Expand description
Multi-resolution hash encoder from Instant-NGP (Müller et al. 2022).
§Fields
hash_tables–[L]levels, each a[table_size × F]array of feature scalars.n_levels– number of resolution levels L.n_features_per_level– number of features F per hash entry.base_resolution– grid resolution at level 0.resolution_growth– per-level resolution multiplier b.table_size– capacity of every hash table (= 2^{log2_hashmap_size}).
Fields§
§hash_tables: Vec<Vec<Vec<f64>>>[L][table_size][F] – learnable feature vectors.
n_levels: usizeNumber of resolution levels L.
n_features_per_level: usizeNumber of feature scalars F stored per hash-table entry.
base_resolution: usizeGrid resolution at the coarsest level (level 0).
resolution_growth: f64Per-level resolution growth factor b = (N_max/N_min)^{1/(L-1)}.
table_size: usizeCapacity of each hash table (= 2^{log2_hashmap_size}).
Implementations§
Source§impl HashEncoder
impl HashEncoder
Sourcepub fn new(
n_levels: usize,
n_features_per_level: usize,
log2_hashmap_size: usize,
base_resolution: usize,
finest_resolution: usize,
seed: u64,
) -> Self
pub fn new( n_levels: usize, n_features_per_level: usize, log2_hashmap_size: usize, base_resolution: usize, finest_resolution: usize, seed: u64, ) -> Self
Construct and randomly initialise a new HashEncoder.
Features are initialised uniformly in [-0.0001, 0.0001].
§Arguments
n_levels– number of resolution levels.n_features_per_level– features per hash entry.log2_hashmap_size– log₂ of hash-table capacity.base_resolution– coarsest grid resolution.finest_resolution– finest grid resolution.seed– PRNG seed.
Sourcepub fn n_output_features(&self) -> usize
pub fn n_output_features(&self) -> usize
Total output feature dimension = n_levels × n_features_per_level.
Auto Trait Implementations§
impl Freeze for HashEncoder
impl RefUnwindSafe for HashEncoder
impl Send for HashEncoder
impl Sync for HashEncoder
impl Unpin for HashEncoder
impl UnsafeUnpin for HashEncoder
impl UnwindSafe for HashEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.