Browse Source

Merge pull request #1164 from Wanglongzhi2001/master

fix: partially fix the bug of load_model
tags/v0.110.4-Transformer-Model
Haiping GitHub 2 years ago
parent
commit
fed53f1f76
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 178 additions and 17 deletions
  1. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/ExponentialArgs.cs
  2. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/HardSigmoidArgs.cs
  3. +11
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SELUArgs.cs
  4. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SoftplusArgs.cs
  5. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SoftsignArgs.cs
  6. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SwishArgs.cs
  7. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/TanhArgs.cs
  8. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Convolution/Conv2DTransposeArgs.cs
  9. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/AddArgs.cs
  10. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/ConcatenateArgs.cs
  11. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/SubtractArgs.cs
  12. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalAveragePooling1DArgs.cs
  13. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalAveragePooling2DArgs.cs
  14. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalMaxPooling1DArgs.cs
  15. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalMaxPooling2DArgs.cs
  16. +10
    -0
      src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/MaxPooling1DArgs.cs
  17. +7
    -7
      src/TensorFlowNET.Keras/Layers/LayersApi.Activation.cs
  18. +1
    -1
      src/TensorFlowNET.Keras/Layers/LayersApi.Merging.cs
  19. +9
    -9
      src/TensorFlowNET.Keras/Layers/LayersApi.cs

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/ExponentialArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class ExponentialArgs : LayerArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/HardSigmoidArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class HardSigmoidArgs : LayerArgs
{
}
}

+ 11
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SELUArgs.cs View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SELUArgs : LayerArgs
{

}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SoftplusArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SoftplusArgs : LayerArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SoftsignArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SoftsignArgs : LayerArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/SwishArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SwishArgs : LayerArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Activation/TanhArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class TanhArgs : LayerArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Convolution/Conv2DTransposeArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class Conv2DTransposeArgs : Conv2DArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/AddArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class AddArgs : MergeArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/ConcatenateArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class ConcatenateArgs : MergeArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/SubtractArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SubtractArgs : MergeArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalAveragePooling1DArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalAveragePooling1DArgs : Pooling1DArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalAveragePooling2DArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalAveragePooling2DArgs : Pooling2DArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalMaxPooling1DArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalMaxPooling1DArgs : Pooling1DArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/GlobalMaxPooling2DArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalMaxPooling2DArgs : Pooling2DArgs
{
}
}

+ 10
- 0
src/TensorFlowNET.Core/Keras/ArgsDefinition/Pooling/MaxPooling1DArgs.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class MaxPooling1DArgs : Pooling1DArgs
{
}
}

+ 7
- 7
src/TensorFlowNET.Keras/Layers/LayersApi.Activation.cs View File

@@ -10,14 +10,14 @@ namespace Tensorflow.Keras.Layers {
public ILayer ELU ( float alpha = 0.1f )
=> new ELU(new ELUArgs { Alpha = alpha });
public ILayer SELU ()
=> new SELU(new LayerArgs { });
=> new SELU(new SELUArgs { });
public ILayer Softmax(int axis = -1) => new Softmax(new SoftmaxArgs { axis = axis });
public ILayer Softmax ( Axis axis ) => new Softmax(new SoftmaxArgs { axis = axis });
public ILayer Softplus () => new Softplus(new LayerArgs { });
public ILayer HardSigmoid () => new HardSigmoid(new LayerArgs { });
public ILayer Softsign () => new Softsign(new LayerArgs { });
public ILayer Swish () => new Swish(new LayerArgs { });
public ILayer Tanh () => new Tanh(new LayerArgs { });
public ILayer Exponential () => new Exponential(new LayerArgs { });
public ILayer Softplus () => new Softplus(new SoftplusArgs { });
public ILayer HardSigmoid () => new HardSigmoid(new HardSigmoidArgs { });
public ILayer Softsign () => new Softsign(new SoftsignArgs { });
public ILayer Swish () => new Swish(new SwishArgs { });
public ILayer Tanh () => new Tanh(new TanhArgs { });
public ILayer Exponential () => new Exponential(new ExponentialArgs { });
}
}

+ 1
- 1
src/TensorFlowNET.Keras/Layers/LayersApi.Merging.cs View File

@@ -14,7 +14,7 @@ namespace Tensorflow.Keras.Layers
/// <param name="axis">Axis along which to concatenate.</param>
/// <returns></returns>
public ILayer Concatenate(int axis = -1)
=> new Concatenate(new MergeArgs
=> new Concatenate(new ConcatenateArgs
{
Axis = axis
});


+ 9
- 9
src/TensorFlowNET.Keras/Layers/LayersApi.cs View File

@@ -240,7 +240,7 @@ namespace Tensorflow.Keras.Layers
string kernel_regularizer = null,
string bias_regularizer = null,
string activity_regularizer = null)
=> new Conv2DTranspose(new Conv2DArgs
=> new Conv2DTranspose(new Conv2DTransposeArgs
{
Rank = 2,
Filters = filters,
@@ -568,7 +568,7 @@ namespace Tensorflow.Keras.Layers
int? strides = null,
string padding = "valid",
string data_format = null)
=> new MaxPooling1D(new Pooling1DArgs
=> new MaxPooling1D(new MaxPooling1DArgs
{
PoolSize = pool_size ?? 2,
Strides = strides ?? (pool_size ?? 2),
@@ -944,21 +944,21 @@ namespace Tensorflow.Keras.Layers
/// </summary>
/// <returns></returns>
public ILayer Add()
=> new Add(new MergeArgs { });
=> new Add(new AddArgs { });

/// <summary>
///
/// </summary>
/// <returns></returns>
public ILayer Subtract()
=> new Subtract(new MergeArgs { });
=> new Subtract(new SubtractArgs { });

/// <summary>
/// Global max pooling operation for spatial data.
/// </summary>
/// <returns></returns>
public ILayer GlobalAveragePooling2D()
=> new GlobalAveragePooling2D(new Pooling2DArgs { });
=> new GlobalAveragePooling2D(new GlobalAveragePooling2DArgs { });

/// <summary>
/// Global average pooling operation for temporal data.
@@ -968,7 +968,7 @@ namespace Tensorflow.Keras.Layers
/// </param>
/// <returns></returns>
public ILayer GlobalAveragePooling1D(string data_format = "channels_last")
=> new GlobalAveragePooling1D(new Pooling1DArgs { DataFormat = data_format });
=> new GlobalAveragePooling1D(new GlobalAveragePooling1DArgs { DataFormat = data_format });

/// <summary>
/// Global max pooling operation for spatial data.
@@ -977,7 +977,7 @@ namespace Tensorflow.Keras.Layers
/// channels_last corresponds to inputs with shape (batch, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, height, width).</param>
/// <returns></returns>
public ILayer GlobalAveragePooling2D(string data_format = "channels_last")
=> new GlobalAveragePooling2D(new Pooling2DArgs { DataFormat = data_format });
=> new GlobalAveragePooling2D(new GlobalAveragePooling2DArgs { DataFormat = data_format });

/// <summary>
/// Global max pooling operation for 1D temporal data.
@@ -988,7 +988,7 @@ namespace Tensorflow.Keras.Layers
/// </param>
/// <returns></returns>
public ILayer GlobalMaxPooling1D(string data_format = "channels_last")
=> new GlobalMaxPooling1D(new Pooling1DArgs { DataFormat = data_format });
=> new GlobalMaxPooling1D(new GlobalMaxPooling1DArgs { DataFormat = data_format });

/// <summary>
/// Global max pooling operation for spatial data.
@@ -997,7 +997,7 @@ namespace Tensorflow.Keras.Layers
/// channels_last corresponds to inputs with shape (batch, height, width, channels) while channels_first corresponds to inputs with shape (batch, channels, height, width).</param>
/// <returns></returns>
public ILayer GlobalMaxPooling2D(string data_format = "channels_last")
=> new GlobalMaxPooling2D(new Pooling2DArgs { DataFormat = data_format });
=> new GlobalMaxPooling2D(new GlobalMaxPooling2DArgs { DataFormat = data_format });

/// <summary>
/// Get an weights initializer from its name.


Loading…
Cancel
Save