@JsonIgnore private INDArray getX() { INDArray ret = sameDiff.getArrForVarName(args()[0].getVarName()); return ret; }
@JsonIgnore protected SameDiff sameDiff; @JsonIgnore protected boolean inPlace; @JsonIgnore protected Number scalarValue; @JsonIgnore protected int[] dimensions; @JsonIgnore protected Object[] extraArgs; @JsonIgnore private String ownName;
@JsonIgnore private INDArray getY() { if(args().length > 1) { INDArray ret = sameDiff.getArrForVarName(args()[1].getVarName()); return ret; } return null; }
@JsonIgnore private INDArray getZ() { if(isInPlace()) return getX(); SDVariable opId = outputVariables()[0]; INDArray ret = opId.getArr(); return ret; }
/** * Is this ParameterSpace a leaf? (i.e., does it contain other ParameterSpaces internally?) */ @JsonIgnore boolean isLeaf();
@JsonIgnore public Iterable<? extends AnnotatorComponent> getChildren() { return taggers; }
@Override @JsonIgnore public long getEmbeddingVectorSize() { return 1; }
/** * @return Model reference as String (file reference or URL) */ @JsonIgnore public String getModel() { return model == null ? "" : model; }
/** * Is this ParameterSpace a leaf? (i.e., does it contain other ParameterSpaces internally?) */ @JsonIgnore boolean isLeaf();
@JsonIgnore public EncoderSet getEncoders() { return encoders; }
@JsonIgnore public EncoderSet getTargetEncoders() { return targetEncoders; }
@JsonIgnore public Model getNN() { return net; }
@JsonIgnore public abstract Type getType();
/** * @return True, iff all models in this Component (including children) are loaded and trained. */ @JsonIgnore public boolean isModelAvailable() { return modelAvailable && isModelAvailableInChildren(); }
@JsonIgnore public List<String> getWords() { return vocab.words().stream().map( a -> a.getWord()).collect(Collectors.toList()); }
/** * @return True, iff all models in all children components are loaded and trained. */ @JsonIgnore public boolean isModelAvailableInChildren() { return StreamSupport.stream(encoders.spliterator(), false).allMatch(child -> child.isModelAvailable()) && taggers.stream().allMatch(child -> child.isModelAvailable()); }
@Override @JsonIgnore public long getEmbeddingVectorSize() { return encode("Test").length(); }
@Override @JsonIgnore public long getEmbeddingVectorSize() { return encode("Test").length(); }
@Override @JsonIgnore public long getEmbeddingVectorSize() { return wordAsVector("", false, false, false, false).length(); }
/** * @return JSON representation of Component configuration */ @JsonIgnore public String getConf() { try { //NeuralNetConfiguration.mapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); String json = NeuralNetConfiguration.mapper().writer().writeValueAsString(this); return json.replaceAll("\\s", ""); } catch (JsonProcessingException ex) { log.error("Could not serialize class to JSON: " + ex.toString()); return null; } }