summaryrefslogtreecommitdiff
path: root/candle-nn
diff options
context:
space:
mode:
authorDave Lage <rockerboo@gmail.com>2023-12-16 19:41:56 -0500
committerGitHub <noreply@github.com>2023-12-16 18:41:56 -0600
commitc630622a071756860499ea7914d3a032a47be1b0 (patch)
tree3e8b21acf142af6389878dc7548f934fddf95bad /candle-nn
parentc4cfcf15398578a016618d408f492295a914ce6a (diff)
downloadcandle-c630622a071756860499ea7914d3a032a47be1b0.tar.gz
candle-c630622a071756860499ea7914d3a032a47be1b0.tar.bz2
candle-c630622a071756860499ea7914d3a032a47be1b0.zip
Expose AdamW parameters (#1449)
* Expose AdamW parameters * Use reference
Diffstat (limited to 'candle-nn')
-rw-r--r--candle-nn/src/optim.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/candle-nn/src/optim.rs b/candle-nn/src/optim.rs
index 7704bb48..2c671fc5 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;
+ }
}