use of org.knime.base.data.neural.InputPerceptron in project knime-core by knime.
the class PMMLNeuralNetworkTranslator method initInputLayer.
/**
* @param nnModel the PMML neural network model
*/
private void initInputLayer(final NeuralNetwork nnModel) {
NeuralInputs neuralInputs = nnModel.getNeuralInputs();
m_idPosMap = new HashMap<String, Integer>();
m_curPerceptrons = new Vector<Perceptron>();
m_inputmap = new HashMap<String, Integer>();
m_counter = 0;
m_curLayer = 0;
for (NeuralInput ni : neuralInputs.getNeuralInputArray()) {
m_curPercpetronID = ni.getId();
String fieldName = m_nameMapper.getColumnName(ni.getDerivedField().getFieldRef().getField());
Perceptron p = new InputPerceptron();
p.setClassValue(fieldName);
m_inputmap.put(fieldName, m_counter);
m_curPerceptrons.add(p);
m_idPosMap.put(m_curPercpetronID, m_counter);
m_counter++;
}
Perceptron[] curPerceptrons = new Perceptron[m_curPerceptrons.size()];
curPerceptrons = m_curPerceptrons.toArray(curPerceptrons);
m_predLayer = new InputLayer(curPerceptrons);
m_allLayers.add(m_curLayer, new InputLayer(curPerceptrons));
m_predPerceptrons = curPerceptrons;
m_predidPosMap = new HashMap<String, Integer>(m_idPosMap);
}
use of org.knime.base.data.neural.InputPerceptron in project knime-core by knime.
the class PMMLNeuralNetworkTranslator method initInputLayer.
/**
* @param nnModel the PMML neural network model
*/
private void initInputLayer(final NeuralNetwork nnModel) {
NeuralInputs neuralInputs = nnModel.getNeuralInputs();
m_idPosMap = new HashMap<String, Integer>();
m_curPerceptrons = new Vector<Perceptron>();
m_inputmap = new HashMap<String, Integer>();
m_counter = 0;
m_curLayer = 0;
for (NeuralInput ni : neuralInputs.getNeuralInputArray()) {
m_curPercpetronID = ni.getId();
String fieldName = m_nameMapper.getColumnName(ni.getDerivedField().getFieldRef().getField());
Perceptron p = new InputPerceptron();
p.setClassValue(fieldName);
m_inputmap.put(fieldName, m_counter);
m_curPerceptrons.add(p);
m_idPosMap.put(m_curPercpetronID, m_counter);
m_counter++;
}
Perceptron[] curPerceptrons = new Perceptron[m_curPerceptrons.size()];
curPerceptrons = m_curPerceptrons.toArray(curPerceptrons);
m_predLayer = new InputLayer(curPerceptrons);
m_allLayers.add(m_curLayer, new InputLayer(curPerceptrons));
m_predPerceptrons = curPerceptrons;
m_predidPosMap = new HashMap<String, Integer>(m_idPosMap);
}
Aggregations