updated some errors from previous pr on adapting nearest interpolation

This commit is contained in:
Andrew Furey
2024-07-29 09:57:28 +01:00
parent 5ab4a775b8
commit 06ed29551e
3 changed files with 5 additions and 3 deletions
+1
View File
@@ -14,6 +14,7 @@ _????-??-??_
* Bump minimum Armadillo version to 10.8 (#3760).
* Adapt `NearestInterpolation` ANN layer to new Layer Inteface
## mlpack 4.4.0
_2024-05-26_
@@ -36,7 +36,8 @@ class NearestInterpolationType : public Layer<MatType>
NearestInterpolationType();
/**Create NearestInterpolation Object with the same scaleFactor along
* each dimension
* each dimension.
* NOTE: Currently this only supports 2 scaleFactors, and we plan to generalize to 1d, 2d and 3d in the future.
*
* @param scaleFactor Scale factors to scale each dimension by.
*/
@@ -149,8 +149,8 @@ void NearestInterpolationType<MatType>::Backward(
template<typename MatType>
void NearestInterpolationType<MatType>::ComputeOutputDimensions()
{
if (this->inputDimensions.size() - 1 != scaleFactors.size()) {
throw std::runtime_error("Scale factors must match number of rows and columns.");
if (this->inputDimensions.size() < scaleFactors.size()) {
throw std::runtime_error("Insufficient number of input dimensions.");
}
this->outputDimensions = this->inputDimensions;
for (size_t i = 0; i < this->InputDimensions().size()-1; i++)