| 198 | } |
| 199 | |
| 200 | DeepPolyElement *DeepPolyAnalysis::createDeepPolyElement( Layer *layer ) |
| 201 | { |
| 202 | Layer::Type type = layer->getLayerType(); |
| 203 | DeepPolyElement *deepPolyElement; |
| 204 | if ( type == Layer::INPUT ) |
| 205 | deepPolyElement = new DeepPolyInputElement( layer ); |
| 206 | else if ( type == Layer::WEIGHTED_SUM ) |
| 207 | { |
| 208 | deepPolyElement = new DeepPolyWeightedSumElement( layer ); |
| 209 | // Weighted sum layers need working memory for back substitution |
| 210 | deepPolyElement->setWorkingMemory( _work1SymbolicLb, |
| 211 | _work1SymbolicUb, |
| 212 | _work2SymbolicLb, |
| 213 | _work2SymbolicUb, |
| 214 | _workSymbolicLowerBias, |
| 215 | _workSymbolicUpperBias ); |
| 216 | } |
| 217 | else if ( type == Layer::RELU ) |
| 218 | deepPolyElement = new DeepPolyReLUElement( layer ); |
| 219 | else if ( type == Layer::ROUND ) |
| 220 | deepPolyElement = new DeepPolyRoundElement( layer ); |
| 221 | else if ( type == Layer::LEAKY_RELU ) |
| 222 | deepPolyElement = new DeepPolyLeakyReLUElement( layer ); |
| 223 | else if ( type == Layer::SIGN ) |
| 224 | deepPolyElement = new DeepPolySignElement( layer ); |
| 225 | else if ( type == Layer::ABSOLUTE_VALUE ) |
| 226 | deepPolyElement = new DeepPolyAbsoluteValueElement( layer ); |
| 227 | else if ( type == Layer::MAX ) |
| 228 | deepPolyElement = new DeepPolyMaxPoolElement( layer ); |
| 229 | else if ( type == Layer::SIGMOID ) |
| 230 | deepPolyElement = new DeepPolySigmoidElement( layer ); |
| 231 | else if ( type == Layer::SOFTMAX ) |
| 232 | deepPolyElement = new DeepPolySoftmaxElement( layer, _maxLayerSize ); |
| 233 | else if ( type == Layer::BILINEAR ) |
| 234 | deepPolyElement = new DeepPolyBilinearElement( layer ); |
| 235 | else |
| 236 | throw NLRError( NLRError::LAYER_TYPE_NOT_SUPPORTED, |
| 237 | Stringf( "Layer %u not yet supported", layer->getLayerType() ).ascii() ); |
| 238 | return deepPolyElement; |
| 239 | } |
| 240 | |
| 241 | void DeepPolyAnalysis::log( const String &message ) |
| 242 | { |
nothing calls this directly
no test coverage detected