Skip to content

Commit

Permalink
[Feat] Add decision dimension to builder and config
Browse files Browse the repository at this point in the history
  • Loading branch information
ephoris committed Jan 26, 2024
1 parent 97ebed5 commit c0de1ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions endure.toml
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ output_features = ["z0_cost", "z1_cost", "q_cost", "w_cost"]
embedding_size = 8
hidden_length = 3
hidden_width = 32
decision_dim = 64

# Dropout percentage
dropout = 0.0
Expand Down
1 change: 1 addition & 0 deletions endure/lcm/model/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def build_model(self, policy: Policy) -> torch.nn.Module:
"hidden_length": model_params["hidden_length"],
"hidden_width": model_params["hidden_width"],
"dropout_percentage": model_params["dropout"],
"decision_dim": model_params["decision_dim"],
}

if model_params["norm_layer"] == "Batch":
Expand Down
3 changes: 2 additions & 1 deletion endure/ltune/util/ltune_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from endure.lcm.util import eval_lcm_impl
from endure.lsm.cost import EndureCost
from endure.lsm.types import LSMDesign, System, Policy
from endure.lsm.types import LSMDesign, System, Policy, STR_POLICY_DICT
from endure.ltune.data.generator import LTuneGenerator
from endure.ltune.loss import LearnedCostModelLoss
import endure.lsm.solver as Solver
Expand All @@ -19,6 +19,7 @@ def __init__(
model: torch.nn.Module,
design_type: str = "Level",
) -> None:
self.policy = STR_POLICY_DICT.get(design_type, Policy.KHybrid)
self.gen = LTuneGenerator(config)
self.loss = LearnedCostModelLoss(
config,
Expand Down

0 comments on commit c0de1ef

Please sign in to comment.