Showing 6,111 of 13,975 total issues
Method mergeFrom
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@java.lang.Override
public Builder mergeFrom(
org.nd4j.shade.protobuf.CodedInputStream input,
org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Method mergeFrom
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@java.lang.Override
public Builder mergeFrom(
org.nd4j.shade.protobuf.CodedInputStream input,
org.nd4j.shade.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
Method getSerializedSize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
Method deserialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public T deserialize(JsonParser jp, DeserializationContext deserializationContext) throws IOException {
//Manually parse old format
JsonNode node = jp.getCodec().readTree(jp);
Method close
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public void close() {
if (run != null) {
run.releaseReference();
}
Method listGitPropertiesFiles
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static List<URI> listGitPropertiesFiles() {
Enumeration<URL> roots;
try {
roots = VersionCheck.class.getClassLoader().getResources("ai/skymind/");
} catch (IOException e){
Method writeXml
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void writeXml(OutputStream out) throws IOException {
Properties properties = getProps();
try {
Document doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
Element conf = doc.createElement("configuration");
Method find
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public int find(String what, int start) {
try {
ByteBuffer src = ByteBuffer.wrap(this.bytes, 0, this.length);
ByteBuffer tgt = encode(what);
byte b = tgt.get();
Method fromEntry
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static Writable fromEntry(int item,FieldVector from,ColumnType columnType) {
if(from.getValueCount() < item) {
throw new IllegalArgumentException("Index specified greater than the number of items in the vector with length " + from.getValueCount());
}
Method loadFromMetaData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public MultiDataSet loadFromMetaData(List<RecordMetaData> list) throws IOException {
//First: load the next values from the RR / SeqRRs
Map<String, List<List<Writable>>> nextRRVals = new HashMap<>();
Map<String, List<List<List<Writable>>>> nextSeqRRVals = new HashMap<>();
List<RecordMetaDataComposableMap> nextMetas =
Method calcHistogram
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@JsonIgnore
private synchronized void calcHistogram() {
max = sourceArray.maxNumber().doubleValue();
min = sourceArray.minNumber().doubleValue();
Method getMemoryReport
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public NetworkMemoryReport getMemoryReport(InputType... inputTypes) {
Map<String, MemoryReport> memoryReportMap = new LinkedHashMap<>();
List<String> topologicalOrdering = topologicalOrdering();
Method handleLegacyWeightInitFromJson
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static void handleLegacyWeightInitFromJson(String json, Layer layer, ObjectMapper mapper, JsonNode vertices) {
if (layer instanceof BaseLayer && ((BaseLayer) layer).getWeightInitFn() == null) {
String layerName = layer.getLayerName();
try {
Method handleLegacyWeightInitFromJson
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static boolean handleLegacyWeightInitFromJson(String json, Layer l, ObjectMapper mapper, JsonNode confs, int layerCount) {
if ((l instanceof BaseLayer) && ((BaseLayer) l).getWeightInitFn() == null) {
try {
JsonNode jsonNode = mapper.readTree(json);
if (confs == null) {
Method toString
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public String toString() {
long fixedMemBytes = getTotalMemoryBytes(0, MemoryUseMode.INFERENCE, CacheMode.NONE, DataType.FLOAT);
long perEx = getTotalMemoryBytes(1, MemoryUseMode.INFERENCE, CacheMode.NONE, DataType.FLOAT)
Method getGradientsFromFlattened
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Map<String, INDArray> getGradientsFromFlattened(NeuralNetConfiguration conf, INDArray gradientView) {
ConvolutionLayer layerConf =
(ConvolutionLayer) conf.getLayer();
Method preOutput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected INDArray preOutput(boolean training, boolean forBackprop, LayerWorkspaceMgr workspaceMgr) {
assertInputSet(false);
applyDropOutIfNecessary(training, null);
if (input.rank() != 4) {
Method getGradientsAndDelta
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private Pair<Gradient, INDArray> getGradientsAndDelta(INDArray preOut, LayerWorkspaceMgr workspaceMgr) {
ILossFunction lossFunction = layerConf().getLossFn();
INDArray labels2d = getLabels2d(workspaceMgr, ArrayType.BP_WORKING_MEM);
if (labels2d.size(1) != preOut.size(1)) {
throw new DL4JInvalidInputException(
Method doBackward
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@Override
public Pair<Gradient, INDArray[]> doBackward(boolean tbptt, LayerWorkspaceMgr workspaceMgr) {
if (!canDoBackward())
throw new IllegalStateException("Cannot do backward pass: errors not set");
Method importTrainingConfiguration
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void importTrainingConfiguration(String trainingConfigJson)
throws IOException, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
Map<String, Object> trainingConfig = KerasModelUtils.parseJsonString(trainingConfigJson);
Map<String, Object> optimizerConfig = getOptimizerConfig(trainingConfig);