From c630622a071756860499ea7914d3a032a47be1b0 Mon Sep 17 00:00:00 2001 From: Dave Lage Date: Sat, 16 Dec 2023 19:41:56 -0500 Subject: [PATCH] Expose AdamW parameters (#1449) * Expose AdamW parameters * Use reference --- candle-nn/src/optim.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/candle-nn/src/optim.rs b/candle-nn/src/optim.rs index 7704bb4816..2c671fc59e 100644 --- a/candle-nn/src/optim.rs +++ b/candle-nn/src/optim.rs @@ -190,4 +190,12 @@ impl AdamW { }; Self::new(vars, params) } + + pub fn params(&self) -> &ParamsAdamW { + &self.params + } + + pub fn set_params(&mut self, params: ParamsAdamW) { + self.params = params; + } }