use of ml.shifu.shifu.core.dtrain.dataset.CacheBasicFloatNetwork in project shifu by ShifuML.
the class VarSelectMapper method copy.
/**
* Copy existing model to {@link CacheBasicFloatNetwork} model for fast scoring in sensitivity computing.
*
* @param network
* the raw network model
* @return the cache network model instance.
*/
public static final CacheBasicFloatNetwork copy(final BasicFloatNetwork network) {
final CacheBasicFloatNetwork result = new CacheBasicFloatNetwork(network);
final CacheFlatNetwork flat = new CacheFlatNetwork();
result.getProperties().putAll(network.getProperties());
flat.setBeginTraining(network.getFlat().getBeginTraining());
flat.setConnectionLimit(network.getFlat().getConnectionLimit());
flat.setContextTargetOffset(network.getFlat().getContextTargetOffset());
flat.setContextTargetSize(network.getFlat().getContextTargetSize());
flat.setEndTraining(network.getFlat().getEndTraining());
flat.setHasContext(network.getFlat().getHasContext());
flat.setInputCount(network.getFlat().getInputCount());
flat.setLayerCounts(network.getFlat().getLayerCounts());
flat.setLayerFeedCounts(network.getFlat().getLayerFeedCounts());
flat.setLayerContextCount(network.getFlat().getLayerContextCount());
flat.setLayerIndex(network.getFlat().getLayerIndex());
flat.setLayerOutput(network.getFlat().getLayerOutput());
flat.setLayerSums(network.getFlat().getLayerSums());
flat.setOutputCount(network.getFlat().getOutputCount());
flat.setWeightIndex(network.getFlat().getWeightIndex());
flat.setWeights(network.getFlat().getWeights());
flat.setBiasActivation(network.getFlat().getBiasActivation());
flat.setActivationFunctions(network.getFlat().getActivationFunctions());
result.setFeatureSet(network.getFeatureSet());
result.getStructure().setFlat(flat);
return result;
}
Aggregations