Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different learning rate per encoding level #407

Open
aboelela924 opened this issue Jan 31, 2024 · 0 comments
Open

Different learning rate per encoding level #407

aboelela924 opened this issue Jan 31, 2024 · 0 comments

Comments

@aboelela924
Copy link

aboelela924 commented Jan 31, 2024

I have 16 levels of Hash Encoding is there a way of setting a different learning rate per level. I have alreadly estimated the shift in each level using the following code:
`
base_resolution = self.model.hash_encoder.encoding_config['base_resolution']
log2_hashmap_size = self.model.hash_encoder.encoding_config['log2_hashmap_size']
per_level_scale = self.model.hash_encoder.encoding_config['per_level_scale']
n_levels = self.model.hash_encoder.encoding_config['n_levels']
n_features_per_level = self.model.hash_encoder.encoding_config['n_features_per_level']
N_POS_DIMS = 3
offset = 0

    levels = torch.zeros_like(self.model.hash_encoder.params)
    self.offset_table = torch.zeros((n_levels, 2), dtype=torch.int32)
    for i in range(n_levels):
        resolution = math.ceil((math.exp(math.log(per_level_scale) * i) * base_resolution) - 1) + 1
        params_in_level = resolution ** N_POS_DIMS
        params_in_level = min(params_in_level, 2 ** log2_hashmap_size)
        params_in_level = math.ceil(params_in_level / 8) * 8
        levels[offset * n_features_per_level:(offset + params_in_level) * n_features_per_level] = i
        self.offset_table[i, 0] = offset * n_features_per_level
        self.offset_table[i, 1] = (offset + params_in_level) * n_features_per_level
        offset += params_in_level
    self.param_level = levels

`

but i can't find a way in pytroch to set a different learning rate per level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant