|
|
|
@ -71,7 +71,7 @@ public class Operation {//进行计算
|
|
|
|
|
int ySize = maxY - minY;
|
|
|
|
|
ThreeChannelMatrix threeChannelMatrix1 = convolution.getRegionMatrix(threeChannelMatrix, minX, minY, xSize, ySize);
|
|
|
|
|
List<Double> feature = convolution.getCenterColor(threeChannelMatrix1, templeConfig.getPoolSize(),
|
|
|
|
|
templeConfig.getSensoryNerves().size());
|
|
|
|
|
templeConfig.getFeatureNub());
|
|
|
|
|
if (templeConfig.isShowLog()) {
|
|
|
|
|
System.out.println(feature);
|
|
|
|
|
}
|
|
|
|
@ -80,7 +80,11 @@ public class Operation {//进行计算
|
|
|
|
|
case Classifier.DNN:
|
|
|
|
|
Map<Integer, Double> map = new HashMap<>();
|
|
|
|
|
map.put(tag, 1.0);
|
|
|
|
|
intoDnnNetwork(1, feature, templeConfig.getSensoryNerves(), true, map, null);
|
|
|
|
|
if (templeConfig.getSensoryNerves().size() == templeConfig.getFeatureNub()) {
|
|
|
|
|
intoDnnNetwork(1, feature, templeConfig.getSensoryNerves(), true, map, null);
|
|
|
|
|
} else {
|
|
|
|
|
throw new Exception("nerves number is not equal featureNub");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Classifier.LVQ:
|
|
|
|
|
Matrix vector = MatrixOperation.listToRowVector(feature);
|
|
|
|
@ -119,7 +123,7 @@ public class Operation {//进行计算
|
|
|
|
|
int ySize = maxY - minY;
|
|
|
|
|
ThreeChannelMatrix threeChannelMatrix1 = convolution.getRegionMatrix(threeChannelMatrix, minX, minY, xSize, ySize);
|
|
|
|
|
List<Double> feature = convolution.getCenterColor(threeChannelMatrix1, templeConfig.getPoolSize(),
|
|
|
|
|
templeConfig.getSensoryNerves().size());
|
|
|
|
|
templeConfig.getFeatureNub());
|
|
|
|
|
if (templeConfig.isShowLog()) {
|
|
|
|
|
System.out.println(feature);
|
|
|
|
|
}
|
|
|
|
@ -131,8 +135,12 @@ public class Operation {//进行计算
|
|
|
|
|
id = getIdByLVQ(myMatrix);
|
|
|
|
|
break;
|
|
|
|
|
case Classifier.DNN:
|
|
|
|
|
intoDnnNetwork(IdCreator.get().nextId(), feature, templeConfig.getSensoryNerves(), false, null, maxPoint);
|
|
|
|
|
id = maxPoint.getId();
|
|
|
|
|
if (templeConfig.getSensoryNerves().size() == templeConfig.getFeatureNub()) {
|
|
|
|
|
intoDnnNetwork(IdCreator.get().nextId(), feature, templeConfig.getSensoryNerves(), false, null, maxPoint);
|
|
|
|
|
id = maxPoint.getId();
|
|
|
|
|
} else {
|
|
|
|
|
throw new Exception("nerves number is not equal featureNub");
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case Classifier.VAvg:
|
|
|
|
|
Matrix myMatrix1 = MatrixOperation.listToRowVector(feature);
|
|
|
|
|