Buckets:
| namespace neuroflow { | |
| struct ParamState { | |
| Tensor m; | |
| Tensor v; | |
| }; | |
| struct ParamGroup { | |
| std::vector<Tensor*> params; | |
| std::vector<Tensor*> grads; | |
| float lr; | |
| float weight_decay; | |
| }; | |
| class AdamW { | |
| public: | |
| float lr_; | |
| float beta1_; | |
| float beta2_; | |
| float eps_; | |
| float weight_decay_; | |
| size_t step_; | |
| std::vector<ParamGroup> param_groups_; | |
| std::vector<std::vector<ParamState>> states_; | |
| AdamW(float lr, float beta1 = 0.9f, float beta2 = 0.999f, | |
| float eps = 1e-8f, float weight_decay = 0.01f); | |
| void add_param_group(const ParamGroup& group); | |
| void step(); | |
| void set_lr(float lr); | |
| float get_lr() const { return lr_; } | |
| size_t get_step() const { return step_; } | |
| }; | |
| } // namespace neuroflow | |
Xet Storage Details
- Size:
- 953 Bytes
- Xet hash:
- 49ea96cd0c6c42935aff4bdbb41853024c86b5b8b82e1bc2923ef4a9b24bec71
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.