Using @SuperBuilder for LayerConfigurations

Signed-off-by: brian <brian@brutex.de>
master
Brian Rosenberger 2023-04-25 11:54:49 +02:00
parent ad870c5281
commit 9139940101
30 changed files with 30 additions and 30 deletions

View File

@ -90,7 +90,7 @@ public abstract class NumericalColumnAnalysis implements ColumnAnalysis {
public abstract double getMaxDouble();
@SuppressWarnings("unchecked")
public abstract static class Builder<T extends Builder<T>> {
public static abstract class Builder<T extends Builder<T>> {
protected double mean;
protected double sampleStdev;
protected double sampleVariance;

View File

@ -970,7 +970,7 @@ public class InferenceSession extends AbstractSession<INDArray, Pair<SameDiffOp,
}
@Data
public abstract static class Dep {
public static abstract class Dep {
protected String frame;
protected FrameIter parentFrame;
}

View File

@ -555,7 +555,7 @@ public abstract class NeuralNetBaseBuilderConfiguration implements INeuralNetwor
return clone;
}
public abstract static class NeuralNetBaseBuilderConfigurationBuilder<
public static abstract class NeuralNetBaseBuilderConfigurationBuilder<
C extends NeuralNetBaseBuilderConfiguration,
B extends NeuralNetBaseBuilderConfiguration.NeuralNetBaseBuilderConfigurationBuilder<C, B>> {

View File

@ -133,7 +133,7 @@ public class ActivationLayer extends NoParamLayer {
// No op
}
public abstract static class ActivationLayerBuilder<
public static abstract class ActivationLayerBuilder<
C extends ActivationLayer, B extends ActivationLayerBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {
public C build() {

View File

@ -202,7 +202,7 @@ public abstract class BaseLayerConfiguration extends LayerConfiguration
}
public abstract static class BaseLayerConfigurationBuilder<
public static abstract class BaseLayerConfigurationBuilder<
C extends BaseLayerConfiguration, B extends BaseLayerConfigurationBuilder<C, B>>
extends LayerConfigurationBuilder<C, B> {

View File

@ -114,7 +114,7 @@ public class Cnn3DLossLayer extends FeedForwardLayer {
// No op
}
public abstract static class Cnn3DLossLayerBuilder<
public static abstract class Cnn3DLossLayerBuilder<
C extends Cnn3DLossLayer, B extends Cnn3DLossLayerBuilder<C, B>>
extends FeedForwardLayerBuilder<C, B> {

View File

@ -184,7 +184,7 @@ public class Convolution1DLayer extends ConvolutionLayer {
return true;
}
public abstract static class Convolution1DLayerBuilder<
public static abstract class Convolution1DLayerBuilder<
C extends ConvolutionLayer, B extends Convolution1DLayerBuilder<C, B>>
extends ConvolutionLayerBuilder<C, B> {
public C build() {

View File

@ -238,7 +238,7 @@ public class Convolution3D extends ConvolutionLayer {
// public Builder(int[] kernelSize, int[] stride, int[] padding, int[] dilation) {
// sup/er(kernelSize, stride, padding, dilation, 3);
public abstract static class Convolution3DBuilder<
public static abstract class Convolution3DBuilder<
C extends Convolution3D, B extends Convolution3DBuilder<C, B>>
extends ConvolutionLayer.ConvolutionLayerBuilder<C, B> {
public C build() {

View File

@ -355,7 +355,7 @@ public class ConvolutionLayer extends FeedForwardLayer {
}
public abstract static class ConvolutionLayerBuilder<
public static abstract class ConvolutionLayerBuilder<
C extends ConvolutionLayer, B extends ConvolutionLayerBuilder<C, B>>
extends FeedForwardLayerBuilder<C, B> {

View File

@ -164,7 +164,7 @@ public class Deconvolution3D extends ConvolutionLayer {
//private int[] padding;
//private int[] dilation;
public abstract static class Deconvolution3DBuilder<
public static abstract class Deconvolution3DBuilder<
C extends Deconvolution3D, B extends Deconvolution3DBuilder<C, B>>
extends ConvolutionLayerBuilder<C, B> {
public C build() {

View File

@ -147,7 +147,7 @@ public class DropoutLayer extends FeedForwardLayer {
.build();
}
public abstract static class DropoutLayerBuilder<
public static abstract class DropoutLayerBuilder<
C extends DropoutLayer, B extends DropoutLayerBuilder<C, B>>
extends FeedForwardLayerBuilder<C, B> {

View File

@ -173,7 +173,7 @@ public class LearnedSelfAttentionLayer extends SameDiffLayer {
return null;
}
public abstract static class LearnedSelfAttentionLayerBuilder<
public static abstract class LearnedSelfAttentionLayerBuilder<
C extends LearnedSelfAttentionLayer, B extends LearnedSelfAttentionLayerBuilder<C, B>>
extends SameDiffLayerBuilder<C, B> {
public C build() {

View File

@ -175,7 +175,7 @@ public class LocalResponseNormalization extends LayerConfiguration {
.build();
}
public abstract static class LocalResponseNormalizationBuilder<
public static abstract class LocalResponseNormalizationBuilder<
C extends LocalResponseNormalization, B extends LocalResponseNormalizationBuilder<C, B>>
extends LayerConfigurationBuilder<C, B> {
public B helperAllowFallback(boolean b) {

View File

@ -319,7 +319,7 @@ public class LocallyConnected2D extends SameDiffLayer {
}
}
public abstract static class LocallyConnected2DBuilder<
public static abstract class LocallyConnected2DBuilder<
C extends LocallyConnected2D, B extends LocallyConnected2DBuilder<C, B>>
extends SameDiffLayerBuilder<C, B> {
public C build() {

View File

@ -92,7 +92,7 @@ public class LossLayer extends FeedForwardLayer {
return EmptyParamInitializer.getInstance();
}
public abstract static class LossLayerBuilder<
public static abstract class LossLayerBuilder<
C extends LossLayer, B extends LossLayerBuilder<C, B>>
extends FeedForwardLayerBuilder<C, B> {
@Override

View File

@ -83,7 +83,7 @@ public class OutputLayer extends BaseOutputLayer {
return DefaultParamInitializer.getInstance();
}
public abstract static class OutputLayerBuilder<
public static abstract class OutputLayerBuilder<
C extends OutputLayer, B extends OutputLayerBuilder<C, B>>
extends BaseOutputLayerBuilder<C, B> {
public C build() {

View File

@ -130,7 +130,7 @@ public class PReLULayer extends BaseLayerConfiguration {
.build();
}
public abstract static class PReLULayerBuilder<
public static abstract class PReLULayerBuilder<
C extends PReLULayer, B extends PReLULayerBuilder<C, B>>
extends BaseLayerConfigurationBuilder<C, B> {
public C build() {

View File

@ -336,7 +336,7 @@ public class PrimaryCapsules extends SameDiffLayer {
}
}
public abstract static class PrimaryCapsulesBuilder<
public static abstract class PrimaryCapsulesBuilder<
C extends PrimaryCapsules, B extends PrimaryCapsulesBuilder<C, B>>
extends SameDiffLayerBuilder<C, B> {

View File

@ -120,7 +120,7 @@ public class RnnLossLayer extends FeedForwardLayer {
// No op
}
public abstract static class RnnLossLayerBuilder<
public static abstract class RnnLossLayerBuilder<
C extends RnnLossLayer, B extends RnnLossLayerBuilder<C, B>>
extends FeedForwardLayerBuilder<C, B> {
@Override

View File

@ -145,7 +145,7 @@ public class SelfAttentionLayer extends SameDiffLayer {
}
}
public abstract static class SelfAttentionLayerBuilder<
public static abstract class SelfAttentionLayerBuilder<
C extends SelfAttentionLayer, B extends SelfAttentionLayerBuilder<C, B>>
extends SameDiffLayerBuilder<C, B> {
public C build() {

View File

@ -177,7 +177,7 @@ public class SeparableConvolution2D extends ConvolutionLayer {
SeparableConvolution2DLayer.class);
}
public abstract static class SeparableConvolution2DBuilder<
public static abstract class SeparableConvolution2DBuilder<
C extends SeparableConvolution2D, B extends SeparableConvolution2DBuilder<C, B>>
extends ConvolutionLayerBuilder<C, B> {
public C build() {

View File

@ -170,7 +170,7 @@ public class SpaceToBatchLayer extends NoParamLayer {
throw new UnsupportedOperationException("SpaceToBatchLayer does not contain parameters");
}
public abstract static class SpaceToBatchLayerBuilder<
public static abstract class SpaceToBatchLayerBuilder<
C extends SpaceToBatchLayer, B extends SpaceToBatchLayerBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {
/**

View File

@ -281,7 +281,7 @@ public class Subsampling3DLayer extends NoParamLayer {
}
}
public abstract static class Subsampling3DLayerBuilder<
public static abstract class Subsampling3DLayerBuilder<
C extends Subsampling3DLayer, B extends Subsampling3DLayerBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {

View File

@ -385,7 +385,7 @@ public class SubsamplingLayer extends NoParamLayer {
}
}
public abstract static class SubsamplingLayerBuilder<
public static abstract class SubsamplingLayerBuilder<
C extends SubsamplingLayer, B extends SubsamplingLayerBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {

View File

@ -138,7 +138,7 @@ public class ZeroPadding1DLayer extends NoParamLayer {
.build();
}
public abstract static class ZeroPadding1DLayerBuilder<
public static abstract class ZeroPadding1DLayerBuilder<
C extends ZeroPadding1DLayer, B extends ZeroPadding1DLayerBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {
public B padding(int... padding) {

View File

@ -119,7 +119,7 @@ public class Cropping1D extends NoParamLayer {
return null;
}
public abstract static class Cropping1DBuilder<
public static abstract class Cropping1DBuilder<
C extends Cropping1D, B extends Cropping1DBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {
public B cropping(int... cropping) {

View File

@ -139,7 +139,7 @@ public class Cropping2D extends NoParamLayer {
this.dataFormat = ((InputType.InputTypeConvolutional) inputType).getFormat();
}
public abstract static class Cropping2DBuilder<
public static abstract class Cropping2DBuilder<
C extends Cropping2D, B extends Cropping2DBuilder<C, B>>
extends NoParamLayerBuilder<C, B> {
public B cropping(int... cropping) {

View File

@ -245,7 +245,7 @@ public abstract class AbstractSameDiffLayer extends LayerConfiguration {
}
}
public abstract static class AbstractSameDiffLayerBuilder<
public static abstract class AbstractSameDiffLayerBuilder<
C extends AbstractSameDiffLayer, B extends AbstractSameDiffLayerBuilder<C, B>>
extends LayerConfigurationBuilder<C, B> {
/**

View File

@ -176,7 +176,7 @@ public class VariationalAutoencoder extends BasePretrainNetwork {
.build();
}
public abstract static class VariationalAutoencoderBuilder<
public static abstract class VariationalAutoencoderBuilder<
C extends VariationalAutoencoder, B extends VariationalAutoencoderBuilder<C, B>>
extends BasePretrainNetworkBuilder<C, B> {

View File

@ -120,7 +120,7 @@ public class OCNNOutputLayer extends BaseOutputLayer {
return null;
}
public abstract static class OCNNOutputLayerBuilder<
public static abstract class OCNNOutputLayerBuilder<
C extends OCNNOutputLayer, B extends OCNNOutputLayerBuilder<C, B>>
extends BaseOutputLayerBuilder<C, B> {