Example usage for com.google.gson JsonObject getAsJsonPrimitive

List of usage examples for com.google.gson JsonObject getAsJsonPrimitive

Introduction

In this page you can find the example usage for com.google.gson JsonObject getAsJsonPrimitive.

Prototype

public JsonPrimitive getAsJsonPrimitive(String memberName) 

Source Link

Document

Convenience method to get the specified member as a JsonPrimitive element.

Usage

From source file:com.simiacryptus.mindseye.layers.cudnn.ImgTileSubnetLayer.java

License:Apache License

/**
 * Instantiates a new Rescaled subnet key.
 *
 * @param json the json/*from   w w  w  .  j  av a 2s  .c o  m*/
 * @param rs   the rs
 */
protected ImgTileSubnetLayer(@Nonnull final JsonObject json, Map<CharSequence, byte[]> rs) {
    super(json, rs);
    this.precision = Precision.valueOf(json.getAsJsonPrimitive("precision").getAsString());
    height = json.getAsJsonPrimitive("height").getAsInt();
    width = json.getAsJsonPrimitive("width").getAsInt();
    strideX = json.getAsJsonPrimitive("strideX").getAsInt();
    strideY = json.getAsJsonPrimitive("strideY").getAsInt();
    this.parallel = json.get("parallel").getAsBoolean();
}

From source file:com.simiacryptus.mindseye.layers.cudnn.ImgZeroPaddingLayer.java

License:Apache License

/**
 * Instantiates a new Img eval key.//w w  w  .ja  v  a 2s  .c o  m
 *
 * @param json the json
 * @param rs   the rs
 */
protected ImgZeroPaddingLayer(@Nonnull final JsonObject json, Map<CharSequence, byte[]> rs) {
    super(json);
    sizeX = json.get("sizeX").getAsInt();
    sizeY = json.get("sizeY").getAsInt();
    this.precision = Precision.valueOf(json.getAsJsonPrimitive("precision").getAsString());
    assert sizeY != 0 || sizeX != 0;
}

From source file:com.simiacryptus.mindseye.layers.cudnn.NProductLayer.java

License:Apache License

/**
 * Instantiates a new Product inputs key.
 *
 * @param id the id/*  w w  w  .ja  v a  2  s .c om*/
 */
protected NProductLayer(@Nonnull final JsonObject id) {
    super(id);
    this.precision = Precision.valueOf(id.getAsJsonPrimitive("precision").getAsString());
}

From source file:com.simiacryptus.mindseye.layers.cudnn.ProductLayer.java

License:Apache License

/**
 * Instantiates a new Product inputs key.
 *
 * @param id the id//  ww w . j  a  v  a  2  s  .  c  o  m
 */
protected ProductLayer(@Nonnull final JsonObject id) {
    super(id);
    this.precision = Precision.valueOf(id.getAsJsonPrimitive("precision").getAsString());
}

From source file:com.simiacryptus.mindseye.layers.cudnn.RescaledSubnetLayer.java

License:Apache License

/**
 * Instantiates a new Img eval key./*from   ww w  .  j  av  a 2 s  . co m*/
 *
 * @param json the json
 * @param rs   the rs
 */
protected RescaledSubnetLayer(@Nonnull final JsonObject json, Map<CharSequence, byte[]> rs) {
    super(json);
    scale = json.get("scale").getAsInt();
    layer = Layer.fromJson(json, rs);
    this.precision = Precision.valueOf(json.getAsJsonPrimitive("precision").getAsString());
}

From source file:com.simiacryptus.mindseye.layers.cudnn.SquareActivationLayer.java

License:Apache License

/**
 * Instantiates a new Product inputs key.
 *
 * @param id the id//from  w w  w  .j  ava2s .com
 */
protected SquareActivationLayer(@Nonnull final JsonObject id) {
    super(id);
    this.precision = Precision.valueOf(id.getAsJsonPrimitive("precision").getAsString());
    this.alpha = id.getAsJsonPrimitive("alpha").getAsDouble();
}

From source file:com.simiacryptus.mindseye.layers.cudnn.StochasticSamplingSubnetLayer.java

License:Apache License

/**
 * Instantiates a new Rescaled subnet key.
 *
 * @param json the json//from ww  w. j  a va2 s  .  co  m
 * @param rs   the rs
 */
protected StochasticSamplingSubnetLayer(@Nonnull final JsonObject json, Map<CharSequence, byte[]> rs) {
    super(json, rs);
    samples = json.getAsJsonPrimitive("samples").getAsInt();
    seed = json.getAsJsonPrimitive("seed").getAsInt();
    layerSeed = json.getAsJsonPrimitive("layerSeed").getAsInt();
    this.precision = Precision.valueOf(json.getAsJsonPrimitive("precision").getAsString());
}

From source file:com.simiacryptus.mindseye.layers.java.HyperbolicActivationLayer.java

License:Apache License

/**
 * Instantiates a new Hyperbolic activation key.
 *
 * @param json      the json/*  ww w . j  a v a2  s. com*/
 * @param resources the resources
 */
protected HyperbolicActivationLayer(@Nonnull final JsonObject json, Map<CharSequence, byte[]> resources) {
    super(json);
    weights = Tensor.fromJson(json.get("weights"), resources);
    negativeMode = json.getAsJsonPrimitive("negativeMode").getAsInt();
}

From source file:com.simiacryptus.mindseye.layers.java.ImgCropLayer.java

License:Apache License

/**
 * Instantiates a new Img crop key./* ww  w  .j a  v a2  s .co m*/
 *
 * @param json the json
 */
protected ImgCropLayer(@Nonnull final JsonObject json) {
    super(json);
    sizeX = json.getAsJsonPrimitive("sizeX").getAsInt();
    sizeY = json.getAsJsonPrimitive("sizeY").getAsInt();
}

From source file:com.simiacryptus.mindseye.layers.java.ImgReshapeLayer.java

License:Apache License

/**
 * Instantiates a new Img reshapeCast key.
 *
 * @param json the json//from w w w  . j a va2 s  .  c o m
 */
protected ImgReshapeLayer(@Nonnull final JsonObject json) {
    super(json);
    kernelSizeX = json.getAsJsonPrimitive("kernelSizeX").getAsInt();
    kernelSizeY = json.getAsJsonPrimitive("kernelSizeY").getAsInt();
    expand = json.getAsJsonPrimitive("expandPlasma").getAsBoolean();
}