Skip to content

Commit fed53f1

Browse files
authored
Merge pull request #1164 from Wanglongzhi2001/master
fix: partially fix the bug of load_model
2 parents adeed05 + f679af6 commit fed53f1

19 files changed

+178
-17
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class ExponentialArgs : LayerArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class HardSigmoidArgs : LayerArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class SELUArgs : LayerArgs
8+
{
9+
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class SoftplusArgs : LayerArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class SoftsignArgs : LayerArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class SwishArgs : LayerArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class TanhArgs : LayerArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class Conv2DTransposeArgs : Conv2DArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class AddArgs : MergeArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class ConcatenateArgs : MergeArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class SubtractArgs : MergeArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class GlobalAveragePooling1DArgs : Pooling1DArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class GlobalAveragePooling2DArgs : Pooling2DArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class GlobalMaxPooling1DArgs : Pooling1DArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class GlobalMaxPooling2DArgs : Pooling2DArgs
8+
{
9+
}
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace Tensorflow.Keras.ArgsDefinition
6+
{
7+
public class MaxPooling1DArgs : Pooling1DArgs
8+
{
9+
}
10+
}

src/TensorFlowNET.Keras/Layers/LayersApi.Activation.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ public partial class LayersApi {
1010
public ILayer ELU ( float alpha = 0.1f )
1111
=> new ELU(new ELUArgs { Alpha = alpha });
1212
public ILayer SELU ()
13-
=> new SELU(new LayerArgs { });
13+
=> new SELU(new SELUArgs { });
1414
public ILayer Softmax(int axis = -1) => new Softmax(new SoftmaxArgs { axis = axis });
1515
public ILayer Softmax ( Axis axis ) => new Softmax(new SoftmaxArgs { axis = axis });
16-
public ILayer Softplus () => new Softplus(new LayerArgs { });
17-
public ILayer HardSigmoid () => new HardSigmoid(new LayerArgs { });
18-
public ILayer Softsign () => new Softsign(new LayerArgs { });
19-
public ILayer Swish () => new Swish(new LayerArgs { });
20-
public ILayer Tanh () => new Tanh(new LayerArgs { });
21-
public ILayer Exponential () => new Exponential(new LayerArgs { });
16+
public ILayer Softplus () => new Softplus(new SoftplusArgs { });
17+
public ILayer HardSigmoid () => new HardSigmoid(new HardSigmoidArgs { });
18+
public ILayer Softsign () => new Softsign(new SoftsignArgs { });
19+
public ILayer Swish () => new Swish(new SwishArgs { });
20+
public ILayer Tanh () => new Tanh(new TanhArgs { });
21+
public ILayer Exponential () => new Exponential(new ExponentialArgs { });
2222
}
2323
}

src/TensorFlowNET.Keras/Layers/LayersApi.Merging.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class LayersApi
1414
/// <param name="axis">Axis along which to concatenate.</param>
1515
/// <returns></returns>
1616
public ILayer Concatenate(int axis = -1)
17-
=> new Concatenate(new MergeArgs
17+
=> new Concatenate(new ConcatenateArgs
1818
{
1919
Axis = axis
2020
});

src/TensorFlowNET.Keras/Layers/LayersApi.cs

+9-9
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ public ILayer Conv2DTranspose(int filters,
240240
string kernel_regularizer = null,
241241
string bias_regularizer = null,
242242
string activity_regularizer = null)
243-
=> new Conv2DTranspose(new Conv2DArgs
243+
=> new Conv2DTranspose(new Conv2DTransposeArgs
244244
{
245245
Rank = 2,
246246
Filters = filters,
@@ -568,7 +568,7 @@ public ILayer MaxPooling1D(int? pool_size = null,
568568
int? strides = null,
569569
string padding = "valid",
570570
string data_format = null)
571-
=> new MaxPooling1D(new Pooling1DArgs
571+
=> new MaxPooling1D(new MaxPooling1DArgs
572572
{
573573
PoolSize = pool_size ?? 2,
574574
Strides = strides ?? (pool_size ?? 2),
@@ -944,21 +944,21 @@ public ILayer Rescaling(float scale,
944944
/// </summary>
945945
/// <returns></returns>
946946
public ILayer Add()
947-
=> new Add(new MergeArgs { });
947+
=> new Add(new AddArgs { });
948948

949949
/// <summary>
950950
///
951951
/// </summary>
952952
/// <returns></returns>
953953
public ILayer Subtract()
954-
=> new Subtract(new MergeArgs { });
954+
=> new Subtract(new SubtractArgs { });
955955

956956
/// <summary>
957957
/// Global max pooling operation for spatial data.
958958
/// </summary>
959959
/// <returns></returns>
960960
public ILayer GlobalAveragePooling2D()
961-
=> new GlobalAveragePooling2D(new Pooling2DArgs { });
961+
=> new GlobalAveragePooling2D(new GlobalAveragePooling2DArgs { });
962962

963963
/// <summary>
964964
/// Global average pooling operation for temporal data.
@@ -968,7 +968,7 @@ public ILayer GlobalAveragePooling2D()
968968
/// </param>
969969
/// <returns></returns>
970970
public ILayer GlobalAveragePooling1D(string data_format = "channels_last")
971-
=> new GlobalAveragePooling1D(new Pooling1DArgs { DataFormat = data_format });
971+
=> new GlobalAveragePooling1D(new GlobalAveragePooling1DArgs { DataFormat = data_format });
972972

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

982982
/// <summary>
983983
/// Global max pooling operation for 1D temporal data.
@@ -988,7 +988,7 @@ public ILayer GlobalAveragePooling2D(string data_format = "channels_last")
988988
/// </param>
989989
/// <returns></returns>
990990
public ILayer GlobalMaxPooling1D(string data_format = "channels_last")
991-
=> new GlobalMaxPooling1D(new Pooling1DArgs { DataFormat = data_format });
991+
=> new GlobalMaxPooling1D(new GlobalMaxPooling1DArgs { DataFormat = data_format });
992992

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

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

0 commit comments

Comments
 (0)