1- /*****************************************************************************
2- Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
3-
4- Licensed under the Apache License, Version 2.0 (the "License");
5- you may not use this file except in compliance with the License.
6- You may obtain a copy of the License at
7-
8- http://www.apache.org/licenses/LICENSE-2.0
9-
10- Unless required by applicable law or agreed to in writing, software
11- distributed under the License is distributed on an "AS IS" BASIS,
12- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- See the License for the specific language governing permissions and
14- limitations under the License.
1+ /*****************************************************************************
2+ Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
3+
4+ Licensed under the Apache License, Version 2.0 (the "License");
5+ you may not use this file except in compliance with the License.
6+ You may obtain a copy of the License at
7+
8+ http://www.apache.org/licenses/LICENSE-2.0
9+
10+ Unless required by applicable law or agreed to in writing, software
11+ distributed under the License is distributed on an "AS IS" BASIS,
12+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ See the License for the specific language governing permissions and
14+ limitations under the License.
1515******************************************************************************/
1616
1717namespace Tensorflow . Train
1818{
19- /// <summary>
20- /// Optimizer that implements the gradient descent algorithm.
19+ /// <summary>
20+ /// Optimizer that implements the gradient descent algorithm.
2121 /// </summary>
2222 public class GradientDescentOptimizer : Optimizer
23- {
23+ {
2424 /// <summary>
2525 /// Construct a new gradient descent optimizer.
2626 /// </summary>
@@ -41,9 +41,9 @@ public GradientDescentOptimizer(float learning_rate, bool use_locking = false, s
4141 {
4242 _lr = learning_rate ;
4343 _useTensor = false ;
44- }
45-
46- public GradientDescentOptimizer ( Tensor learning_rate , bool use_locking = false , string name = "GradientDescent" )
44+ }
45+
46+ public GradientDescentOptimizer ( Tensor learning_rate , bool use_locking = false , string name = "GradientDescent" )
4747 : base ( learning_rate , use_locking , name )
4848 {
4949 _lr_t = learning_rate ;
@@ -52,10 +52,10 @@ public GradientDescentOptimizer(Tensor learning_rate, bool use_locking = false,
5252
5353 public override void _prepare ( )
5454 {
55- if ( ! _useTensor )
56- {
57- var lr = _call_if_callable ( _lr ) ;
58- _lr_t = ops . convert_to_tensor ( lr , name : "learning_rate" ) ;
55+ if ( ! _useTensor )
56+ {
57+ var lr = _call_if_callable ( _lr ) ;
58+ _lr_t = ops . convert_to_tensor ( lr , name : "learning_rate" ) ;
5959 }
6060
6161 }
0 commit comments