Skip to content

Commit

Permalink
renamed torso to trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdviviano committed Oct 24, 2024
1 parent eb13a2d commit fd3d9dc
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ module_PF = NeuralNet(
module_PB = NeuralNet(
input_dim=env.preprocessor.output_dim,
output_dim=env.n_actions - 1,
torso=module_PF.torso # We share all the parameters of P_F and P_B, except for the last layer
trunk=module_PF.trunk # We share all the parameters of P_F and P_B, except for the last layer
)
module_logF = NeuralNet(
input_dim=env.preprocessor.output_dim,
Expand Down
2 changes: 1 addition & 1 deletion testing/test_parametrizations_and_losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def PFBasedGFlowNet_with_return(
hidden_dim=32,
n_hidden_layers=2,
n_components=ndim + 1,
torso=pf_module.torso if tie_pb_to_pf else None,
trunk=pf_module.trunk if tie_pb_to_pf else None,
)
elif module_name == "NeuralNet" and env_name != "Box":
pb_module = NeuralNet(
Expand Down
2 changes: 1 addition & 1 deletion testing/test_samplers_and_trajectories.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def trajectory_sampling_with_return(
hidden_dim=32,
n_hidden_layers=2,
n_components=n_components,
torso=pf_module.torso,
trunk=pf_module.trunk,
)
pf_estimator = BoxPFEstimator(
env=env,
Expand Down
4 changes: 2 additions & 2 deletions tutorials/examples/train_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def main(args): # noqa: C901
hidden_dim=args.hidden_dim,
n_hidden_layers=args.n_hidden,
n_components=args.n_components,
torso=pf_module.torso if args.tied else None,
trunk=pf_module.trunk if args.tied else None,
)

pf_estimator = BoxPFEstimator(
Expand Down Expand Up @@ -148,7 +148,7 @@ def main(args): # noqa: C901
output_dim=1,
hidden_dim=args.hidden_dim,
n_hidden_layers=args.n_hidden,
torso=None, # We do not tie the parameters of the flow function to PF
trunk=None, # We do not tie the parameters of the flow function to PF
logZ_value=logZ,
)
logF_estimator = ScalarEstimator(module=module, preprocessor=env.preprocessor)
Expand Down
4 changes: 2 additions & 2 deletions tutorials/examples/train_conditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def build_conditional_pf_pb(env):
input_dim=env.preprocessor.output_dim,
output_dim=CONCAT_SIZE,
hidden_dim=256,
torso=module_PF.torso,
trunk=module_PF.trunk,
)

# Encoder for the Conditioning information.
Expand All @@ -43,7 +43,7 @@ def build_conditional_pf_pb(env):
module_final_PB = NeuralNet(
input_dim=CONCAT_SIZE * 2,
output_dim=env.n_actions - 1,
torso=module_final_PF.torso,
trunk=module_final_PF.trunk,
)

pf_estimator = ConditionalDiscretePolicyEstimator(
Expand Down
2 changes: 1 addition & 1 deletion tutorials/examples/train_hypergrid_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
module_PB = NeuralNet(
input_dim=env.preprocessor.output_dim,
output_dim=env.n_actions - 1,
torso=module_PF.torso,
trunk=module_PF.trunk,
)
pf_estimator = DiscretePolicyEstimator(
module_PF, env.n_actions, is_backward=False, preprocessor=env.preprocessor
Expand Down

0 comments on commit fd3d9dc

Please sign in to comment.