Skip to content

Commit cc6ddc1

Browse files
author
Beacontownfc
committed
Add AdamW optimizer
1 parent 6862d3a commit cc6ddc1

File tree

1 file changed

+1
-4
lines changed
  • src/TensorFlowNET.Keras/Optimizers

1 file changed

+1
-4
lines changed

Diff for: src/TensorFlowNET.Keras/Optimizers/AdamW.cs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Tensorflow.Keras.Optimizers
1+
namespace Tensorflow.Keras.Optimizers
22
{
33
public class AdamW : Adam
44
{
@@ -22,9 +22,6 @@ public AdamW(float learning_rate= 0.001f,
2222

2323
protected Operation _decay_weights_op(IVariableV1 var, float learning_rate, Dictionary<DeviceDType, Dictionary<string, Tensor>> apply_state)
2424
{
25-
var device_dtype = new DeviceDType();
26-
device_dtype.DType = var.dtype;
27-
device_dtype.Device = var.Device;
2825
bool do_decay = _do_use_weight_decay(var.Name);
2926
if (do_decay) return var.assign_add(
3027
-learning_rate * var.AsTensor() * apply_state[deType]["weight_decay"]);

0 commit comments

Comments
 (0)