parent
c758cf918f
commit
8d73a7a410
|
@ -90,7 +90,6 @@ import java.util.*;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
// The inner builder, that we can then extend ...
|
// The inner builder, that we can then extend ...
|
||||||
@SuperBuilder // TODO fix access
|
@SuperBuilder // TODO fix access
|
||||||
@Jacksonized
|
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode
|
||||||
public abstract class NeuralNetBaseBuilderConfiguration implements INeuralNetworkConfiguration {
|
public abstract class NeuralNetBaseBuilderConfiguration implements INeuralNetworkConfiguration {
|
||||||
|
|
||||||
|
@ -340,6 +339,7 @@ public abstract class NeuralNetBaseBuilderConfiguration implements INeuralNetwor
|
||||||
* and can be overridden on a per-layer basis.
|
* and can be overridden on a per-layer basis.
|
||||||
*/
|
*/
|
||||||
@Getter @Setter @lombok.Builder.Default private IWeightInit weightInit = new WeightInitXavier();
|
@Getter @Setter @lombok.Builder.Default private IWeightInit weightInit = new WeightInitXavier();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the convolution mode for convolutional layers, which impacts padding and output sizes. See
|
* Sets the convolution mode for convolutional layers, which impacts padding and output sizes. See
|
||||||
* {@link ConvolutionMode} for details. Defaults to ConvolutionMode.TRUNCATE<br>
|
* {@link ConvolutionMode} for details. Defaults to ConvolutionMode.TRUNCATE<br>
|
||||||
|
|
|
@ -23,10 +23,7 @@ package org.deeplearning4j.nn.conf;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.*;
|
||||||
import com.fasterxml.jackson.databind.MapperFeature;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import com.fasterxml.jackson.databind.exc.InvalidTypeIdException;
|
import com.fasterxml.jackson.databind.exc.InvalidTypeIdException;
|
||||||
import com.fasterxml.jackson.databind.json.JsonMapper;
|
import com.fasterxml.jackson.databind.json.JsonMapper;
|
||||||
|
@ -170,7 +167,9 @@ public class NeuralNetConfiguration extends NeuralNetBaseBuilderConfiguration {
|
||||||
*/
|
*/
|
||||||
public static NeuralNetConfiguration fromJson(String json) {
|
public static NeuralNetConfiguration fromJson(String json) {
|
||||||
//ObjectMapper mapper = NeuralNetConfiguration.mapper();
|
//ObjectMapper mapper = NeuralNetConfiguration.mapper();
|
||||||
JsonMapper mapper = JsonMapper.builder().build();
|
JsonMapper mapper = JsonMapper.builder()
|
||||||
|
.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||||
|
.build();
|
||||||
try {
|
try {
|
||||||
return mapper.readValue(json, NeuralNetConfiguration.class);
|
return mapper.readValue(json, NeuralNetConfiguration.class);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
|
|
|
@ -49,6 +49,9 @@ import java.util.Map;
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
public abstract class SameDiffLayer extends AbstractSameDiffLayer {
|
public abstract class SameDiffLayer extends AbstractSameDiffLayer {
|
||||||
|
|
||||||
|
public static abstract class SameDiffLayerBuilder<C extends SameDiffLayer, B extends SameDiffLayerBuilder<C, B>> extends AbstractSameDiffLayerBuilder<C,B> {
|
||||||
|
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* WeightInit, default is XAVIER.
|
* WeightInit, default is XAVIER.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue