-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from NiteshBharadwaj/main
Adding Temporal Latent Bottleneck & Fixing Flax Deprecated dependencies
- Loading branch information
Showing
35 changed files
with
679 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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
38 changes: 38 additions & 0 deletions
38
lra_benchmarks/image/configs/cifar10/transformer_tlb_base.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright 2022 Google LLC | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Configuration and hyperparameter sweeps.""" | ||
|
||
from lra_benchmarks.image.configs.cifar10 import base_cifar10_config | ||
|
||
|
||
def get_config(): | ||
"""Get the hyperparameter configuration.""" | ||
config = base_cifar10_config.get_config() | ||
config.model_type = "transformer_tlb" | ||
config.learning_rate = .001 | ||
config.model.emb_dim = 128 | ||
config.model.mlp_dim = 128 | ||
config.model.num_heads = 8 | ||
config.model.qkv_dim = 64 | ||
config.model.self_to_cross_ratio_input_updater = 1 | ||
config.model.num_cross_layers_input_updater = 1 | ||
config.model.num_cross_layers_state_updater = 1 | ||
config.model.num_state_tokens = 5 | ||
config.model.block_size = 32 | ||
config.model.use_global_pos_encoding = False | ||
return config | ||
|
||
|
||
def get_hyper(hyper): | ||
return hyper.product([]) |
39 changes: 39 additions & 0 deletions
39
lra_benchmarks/image/configs/pathfinder32/transformer_tlb_base.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2022 Google LLC | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Base Configuration.""" | ||
|
||
from lra_benchmarks.image.configs.pathfinder32 import base_pathfinder32_config | ||
|
||
|
||
def get_config(): | ||
"""Get the default hyperparameter configuration.""" | ||
config = base_pathfinder32_config.get_config() | ||
config.model_type = "transformer_tlb" | ||
config.learning_rate = 0.0005 | ||
config.model.num_heads = 8 | ||
config.model.emb_dim = 128 | ||
config.model.dropout_rate = 0.1 | ||
config.model.qkv_dim = 64 | ||
config.model.mlp_dim = 128 | ||
config.model.self_to_cross_ratio_input_updater = 2 | ||
config.model.num_cross_layers_input_updater = 1 | ||
config.model.num_cross_layers_state_updater = 1 | ||
config.model.num_state_tokens = 5 | ||
config.model.block_size = 64 | ||
config.model.use_global_pos_encoding = True | ||
return config | ||
|
||
|
||
def get_hyper(hyper): | ||
return hyper.product([]) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright 2022 Google LLC | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Configuration and hyperparameter sweeps.""" | ||
|
||
from lra_benchmarks.listops.configs import base_listops_config | ||
import ml_collections | ||
|
||
|
||
def get_config(): | ||
"""Get the default hyperparameter configuration.""" | ||
config = base_listops_config.get_config() | ||
config.model_type = "transformer_tlb" | ||
config.model = ml_collections.ConfigDict() | ||
config.learning_rate = 0.05 / 4. | ||
config.model.self_to_cross_ratio_input_updater = 2 | ||
config.model.num_cross_layers_input_updater = 1 | ||
config.model.num_cross_layers_state_updater = 1 | ||
config.model.num_state_tokens = 100 | ||
config.model.block_size = 100 | ||
config.model.use_global_pos_encoding = False | ||
return config | ||
|
||
|
||
def get_hyper(hyper): | ||
return hyper.product([]) |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2022 Google LLC | ||
|
||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Configuration and hyperparameter sweeps.""" | ||
|
||
from lra_benchmarks.matching.configs import base_match_config | ||
import ml_collections | ||
|
||
|
||
def get_config(): | ||
"""Get the default hyperparameter configuration.""" | ||
config = base_match_config.get_config() | ||
config.model_type = "transformer_tlb_dual" | ||
config.batch_size = 128 | ||
config.learning_rate = 0.05 / 2. | ||
config.eval_frequency = 5000 | ||
config.num_train_steps = 20000 | ||
config.model = ml_collections.ConfigDict() | ||
config.model.self_to_cross_ratio_input_updater = 2 | ||
config.model.num_cross_layers_input_updater = 1 | ||
config.model.num_cross_layers_state_updater = 1 | ||
config.model.num_state_tokens = 10 | ||
config.model.block_size = 10 | ||
config.model.use_global_pos_encoding = False | ||
return config | ||
|
||
|
||
def get_hyper(hyper): | ||
return hyper.product([]) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.