Skip to content

fix: partially fix the bug of load_model #1164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class ExponentialArgs : LayerArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class HardSigmoidArgs : LayerArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;

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

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SoftplusArgs : LayerArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SoftsignArgs : LayerArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SwishArgs : LayerArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class TanhArgs : LayerArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class Conv2DTransposeArgs : Conv2DArgs
{
}
}
10 changes: 10 additions & 0 deletions src/TensorFlowNET.Core/Keras/ArgsDefinition/Merging/AddArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class AddArgs : MergeArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class ConcatenateArgs : MergeArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class SubtractArgs : MergeArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalAveragePooling1DArgs : Pooling1DArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalAveragePooling2DArgs : Pooling2DArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalMaxPooling1DArgs : Pooling1DArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class GlobalMaxPooling2DArgs : Pooling2DArgs
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Tensorflow.Keras.ArgsDefinition
{
public class MaxPooling1DArgs : Pooling1DArgs
{
}
}
14 changes: 7 additions & 7 deletions src/TensorFlowNET.Keras/Layers/LayersApi.Activation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ public partial class LayersApi {
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 { });
}
}
2 changes: 1 addition & 1 deletion src/TensorFlowNET.Keras/Layers/LayersApi.Merging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class LayersApi
/// <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
});
Expand Down
18 changes: 9 additions & 9 deletions src/TensorFlowNET.Keras/Layers/LayersApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public ILayer Conv2DTranspose(int filters,
string kernel_regularizer = null,
string bias_regularizer = null,
string activity_regularizer = null)
=> new Conv2DTranspose(new Conv2DArgs
=> new Conv2DTranspose(new Conv2DTransposeArgs
{
Rank = 2,
Filters = filters,
Expand Down Expand Up @@ -568,7 +568,7 @@ public ILayer MaxPooling1D(int? pool_size = null,
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),
Expand Down Expand Up @@ -944,21 +944,21 @@ public ILayer Rescaling(float scale,
/// </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.
Expand All @@ -968,7 +968,7 @@ public ILayer GlobalAveragePooling2D()
/// </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.
Expand All @@ -977,7 +977,7 @@ public ILayer GlobalAveragePooling1D(string data_format = "channels_last")
/// 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.
Expand All @@ -988,7 +988,7 @@ public ILayer GlobalAveragePooling2D(string data_format = "channels_last")
/// </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.
Expand All @@ -997,7 +997,7 @@ public ILayer GlobalMaxPooling1D(string data_format = "channels_last")
/// 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.
Expand Down