Skip to content

Commit

Permalink
ensure gamma is between 0 and 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrei committed Mar 28, 2018
1 parent 16f9dc1 commit 258df36
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/artm/core/check_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,12 @@ inline void FixMessage(::artm::RegularizerConfig* message) {
BOOST_THROW_EXCEPTION(InternalError("Given RegularizerType is not supported for json serialization"));
}
}

if (message->has_gamma() && (message->gamma() < 0) || (message->gamma() > 1)) {
BOOST_THROW_EXCEPTION(InvalidOperation(
"Regularization parameter 'gamma' must be between 0 and 1. "
"Refer to documentation for more details. "));
}
}

template<>
Expand Down

0 comments on commit 258df36

Please sign in to comment.