forked from SciSharp/TensorFlow.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptimizer.py.cs
More file actions
36 lines (30 loc) · 736 Bytes
/
optimizer.py.cs
File metadata and controls
36 lines (30 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
using System.Text;
namespace Tensorflow
{
public class optimizer
{
public static _OptimizableVariable _get_processor(RefVariable v)
{
return new _RefVariableProcessor(v);
}
}
public class _RefVariableProcessor : _OptimizableVariable
{
private RefVariable _v;
public _RefVariableProcessor(RefVariable v)
{
_v = v;
}
public Tensor target()
{
return _v._ref();
}
public Operation update_op(Optimizer optimizer, Tensor g)
{
var update_op = optimizer._apply_dense(g, _v);
return update_op;
}
}
}