Browse Source

rename folder name Train to Training.

tags/v0.13
Oceania2018 6 years ago
parent
commit
5f0e775a8e
37 changed files with 175 additions and 28 deletions
  1. +0
    -1
      src/TensorFlowNET.Core/TensorFlow.Binding.csproj
  2. +0
    -0
      src/TensorFlowNET.Core/Training/AdamOptimizer.cs
  3. +0
    -0
      src/TensorFlowNET.Core/Training/AutoTrackable.cs
  4. +0
    -0
      src/TensorFlowNET.Core/Training/Checkpointable/CheckpointableBase.cs
  5. +15
    -0
      src/TensorFlowNET.Core/Training/Coordinator.cs
  6. +0
    -0
      src/TensorFlowNET.Core/Training/Distribute.cs
  7. +0
    -0
      src/TensorFlowNET.Core/Training/ExponentialMovingAverage.cs
  8. +0
    -0
      src/TensorFlowNET.Core/Training/GateGradientType.cs
  9. +24
    -24
      src/TensorFlowNET.Core/Training/GradientDescentOptimizer.cs
  10. +0
    -0
      src/TensorFlowNET.Core/Training/Optimizer.cs
  11. +0
    -0
      src/TensorFlowNET.Core/Training/QueueRunner.cs
  12. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/BaseSaverBuilder.cs
  13. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/BulkSaverBuilder.cs
  14. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/ISaverBuilder.cs
  15. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/ReferenceVariableSaveable.cs
  16. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/ResourceVariableSaveable.cs
  17. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/SaveSpec.cs
  18. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/SaveableObject.cs
  19. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/Saver.cs
  20. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs
  21. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/saveable_object_util.py.cs
  22. +0
    -0
      src/TensorFlowNET.Core/Training/Saving/saver.py.cs
  23. +43
    -0
      src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs
  24. +1
    -1
      src/TensorFlowNET.Core/Training/SessionRunArgs.cs
  25. +1
    -1
      src/TensorFlowNET.Core/Training/SessionRunContext.cs
  26. +52
    -0
      src/TensorFlowNET.Core/Training/SessionRunHook.cs
  27. +1
    -1
      src/TensorFlowNET.Core/Training/SessionRunValues.cs
  28. +0
    -0
      src/TensorFlowNET.Core/Training/SlotCreator.cs
  29. +0
    -0
      src/TensorFlowNET.Core/Training/Trackable.cs
  30. +0
    -0
      src/TensorFlowNET.Core/Training/TrainingUtil.cs
  31. +0
    -0
      src/TensorFlowNET.Core/Training/VariableAggregationType.cs
  32. +38
    -0
      src/TensorFlowNET.Core/Training/_HookTimer.cs
  33. +0
    -0
      src/TensorFlowNET.Core/Training/_MonitoredSession.cs
  34. +0
    -0
      src/TensorFlowNET.Core/Training/_OptimizableVariable.cs
  35. +0
    -0
      src/TensorFlowNET.Core/Training/gen_training_ops.py.cs
  36. +0
    -0
      src/TensorFlowNET.Core/Training/moving_averages.cs
  37. +0
    -0
      src/TensorFlowNET.Core/Training/optimizer.py.cs

+ 0
- 1
src/TensorFlowNET.Core/TensorFlow.Binding.csproj View File

@@ -67,7 +67,6 @@ https://tensorflownet.readthedocs.io</Description>
</ItemGroup>

<ItemGroup>
<Folder Include="Estimators\" />
<Folder Include="Keras\Initializers\" />
</ItemGroup>
</Project>

src/TensorFlowNET.Core/Train/AdamOptimizer.cs → src/TensorFlowNET.Core/Training/AdamOptimizer.cs View File


src/TensorFlowNET.Core/Train/AutoTrackable.cs → src/TensorFlowNET.Core/Training/AutoTrackable.cs View File


src/TensorFlowNET.Core/Train/Checkpointable/CheckpointableBase.cs → src/TensorFlowNET.Core/Training/Checkpointable/CheckpointableBase.cs View File


+ 15
- 0
src/TensorFlowNET.Core/Training/Coordinator.cs View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tensorflow.Training
{
/// <summary>
/// A coordinator for threads
/// </summary>
public class Coordinator
{
}
}

src/TensorFlowNET.Core/Train/Distribute.cs → src/TensorFlowNET.Core/Training/Distribute.cs View File


src/TensorFlowNET.Core/Train/ExponentialMovingAverage.cs → src/TensorFlowNET.Core/Training/ExponentialMovingAverage.cs View File


src/TensorFlowNET.Core/Train/GateGradientType.cs → src/TensorFlowNET.Core/Training/GateGradientType.cs View File


src/TensorFlowNET.Core/Train/GradientDescentOptimizer.cs → src/TensorFlowNET.Core/Training/GradientDescentOptimizer.cs View File

@@ -1,26 +1,26 @@
/*****************************************************************************
Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
/*****************************************************************************
Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************/

namespace Tensorflow.Train
{
/// <summary>
/// Optimizer that implements the gradient descent algorithm.
/// <summary>
/// Optimizer that implements the gradient descent algorithm.
/// </summary>
public class GradientDescentOptimizer : Optimizer
{
{
/// <summary>
/// Construct a new gradient descent optimizer.
/// </summary>
@@ -41,9 +41,9 @@ namespace Tensorflow.Train
{
_lr = learning_rate;
_useTensor = false;
}
public GradientDescentOptimizer(Tensor learning_rate, bool use_locking = false, string name = "GradientDescent")
}
public GradientDescentOptimizer(Tensor learning_rate, bool use_locking = false, string name = "GradientDescent")
: base(learning_rate, use_locking, name)
{
_lr_t = learning_rate;
@@ -52,10 +52,10 @@ namespace Tensorflow.Train

public override void _prepare()
{
if(!_useTensor)
{
var lr = _call_if_callable(_lr);
_lr_t = ops.convert_to_tensor(lr, name: "learning_rate");
if(!_useTensor)
{
var lr = _call_if_callable(_lr);
_lr_t = ops.convert_to_tensor(lr, name: "learning_rate");
}
}

src/TensorFlowNET.Core/Train/Optimizer.cs → src/TensorFlowNET.Core/Training/Optimizer.cs View File


src/TensorFlowNET.Core/Train/QueueRunner.cs → src/TensorFlowNET.Core/Training/QueueRunner.cs View File


src/TensorFlowNET.Core/Train/Saving/BaseSaverBuilder.cs → src/TensorFlowNET.Core/Training/Saving/BaseSaverBuilder.cs View File


src/TensorFlowNET.Core/Train/Saving/BulkSaverBuilder.cs → src/TensorFlowNET.Core/Training/Saving/BulkSaverBuilder.cs View File


src/TensorFlowNET.Core/Train/Saving/ISaverBuilder.cs → src/TensorFlowNET.Core/Training/Saving/ISaverBuilder.cs View File


src/TensorFlowNET.Core/Train/Saving/ReferenceVariableSaveable.cs → src/TensorFlowNET.Core/Training/Saving/ReferenceVariableSaveable.cs View File


src/TensorFlowNET.Core/Train/Saving/ResourceVariableSaveable.cs → src/TensorFlowNET.Core/Training/Saving/ResourceVariableSaveable.cs View File


src/TensorFlowNET.Core/Train/Saving/SaveSpec.cs → src/TensorFlowNET.Core/Training/Saving/SaveSpec.cs View File


src/TensorFlowNET.Core/Train/Saving/SaveableObject.cs → src/TensorFlowNET.Core/Training/Saving/SaveableObject.cs View File


src/TensorFlowNET.Core/Train/Saving/Saver.cs → src/TensorFlowNET.Core/Training/Saving/Saver.cs View File


src/TensorFlowNET.Core/Train/Saving/checkpoint_management.py.cs → src/TensorFlowNET.Core/Training/Saving/checkpoint_management.py.cs View File


src/TensorFlowNET.Core/Train/Saving/saveable_object_util.py.cs → src/TensorFlowNET.Core/Training/Saving/saveable_object_util.py.cs View File


src/TensorFlowNET.Core/Train/Saving/saver.py.cs → src/TensorFlowNET.Core/Training/Saving/saver.py.cs View File


+ 43
- 0
src/TensorFlowNET.Core/Training/SecondOrStepTimer.cs View File

@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tensorflow.Training
{
public class SecondOrStepTimer : _HookTimer
{
int _every_secs = 60;
int _every_steps = 0;
int _last_triggered_step = 0;
int _last_triggered_time = 0;

public SecondOrStepTimer(int every_secs, int every_steps)
{
_every_secs = every_secs;
_every_steps = every_steps;
}

public override void reset()
{
_last_triggered_step = 0;
_last_triggered_time = 0;
}

public override int last_triggered_step()
{
return _last_triggered_step;
}

public override bool should_trigger_for_step(int step)
{
throw new NotImplementedException();
}

public override void update_last_triggered_step(int step)
{
throw new NotImplementedException();
}
}
}

src/TensorFlowNET.Core/Train/SessionRunArgs.cs → src/TensorFlowNET.Core/Training/SessionRunArgs.cs View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Train
namespace Tensorflow.Training
{
public class SessionRunArgs
{

src/TensorFlowNET.Core/Train/SessionRunContext.cs → src/TensorFlowNET.Core/Training/SessionRunContext.cs View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Train
namespace Tensorflow.Training
{
public class SessionRunContext
{

+ 52
- 0
src/TensorFlowNET.Core/Training/SessionRunHook.cs View File

@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tensorflow.Training
{
/// <summary>
/// Hook to extend calls to MonitoredSession.run().
/// </summary>
public abstract class SessionRunHook
{
/// <summary>
/// Called once before using the session.
/// </summary>
public virtual void begin()
{
}

/// <summary>
/// Called when new TensorFlow session is created.
/// </summary>
/// <param name="session"></param>
/// <param name="coord"></param>
public virtual void after_create_session(Session session, Coordinator coord)
{
}

/// <summary>
/// Called before each call to run().
/// </summary>
/// <param name="run_context"></param>
public virtual void before_run(SessionRunContext run_context)
{
}

/// <summary>
/// Called after each call to run().
/// </summary>
public virtual void after_run(SessionRunContext run_context, SessionRunValues run_values)
{
}

/// <summary>
/// Called at the end of session.
/// </summary>
public virtual void end(Session session)
{
}
}
}

src/TensorFlowNET.Core/Train/SessionRunValues.cs → src/TensorFlowNET.Core/Training/SessionRunValues.cs View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Train
namespace Tensorflow.Training
{
public class SessionRunValues
{

src/TensorFlowNET.Core/Train/SlotCreator.cs → src/TensorFlowNET.Core/Training/SlotCreator.cs View File


src/TensorFlowNET.Core/Train/Trackable.cs → src/TensorFlowNET.Core/Training/Trackable.cs View File


src/TensorFlowNET.Core/Train/TrainingUtil.cs → src/TensorFlowNET.Core/Training/TrainingUtil.cs View File


src/TensorFlowNET.Core/Train/VariableAggregationType.cs → src/TensorFlowNET.Core/Training/VariableAggregationType.cs View File


+ 38
- 0
src/TensorFlowNET.Core/Training/_HookTimer.cs View File

@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tensorflow.Training
{
/// <summary>
/// Base timer for determining when Hooks should trigger.
/// </summary>
public abstract class _HookTimer
{
/// <summary>
/// Resets the timer.
/// </summary>
public abstract void reset();

/// <summary>
/// Return true if the timer should trigger for the specified step.
/// </summary>
/// <param name="step"></param>
/// <returns></returns>
public abstract bool should_trigger_for_step(int step);

/// <summary>
/// Update the last triggered time and step number.
/// </summary>
/// <param name="step"></param>
public abstract void update_last_triggered_step(int step);

/// <summary>
/// Returns the last triggered time step or None if never triggered.
/// </summary>
/// <returns></returns>
public abstract int last_triggered_step();
}
}

src/TensorFlowNET.Core/Train/_MonitoredSession.cs → src/TensorFlowNET.Core/Training/_MonitoredSession.cs View File


src/TensorFlowNET.Core/Train/_OptimizableVariable.cs → src/TensorFlowNET.Core/Training/_OptimizableVariable.cs View File


src/TensorFlowNET.Core/Train/gen_training_ops.py.cs → src/TensorFlowNET.Core/Training/gen_training_ops.py.cs View File


src/TensorFlowNET.Core/Train/moving_averages.cs → src/TensorFlowNET.Core/Training/moving_averages.cs View File


src/TensorFlowNET.Core/Train/optimizer.py.cs → src/TensorFlowNET.Core/Training/optimizer.py.cs View File


Loading…
Cancel
Save