forked from stan-dev/cmdstan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial CmdStan interface for low-rank ADVI
- Loading branch information
Showing
6 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef CMDSTAN_ARGUMENTS_VARIATIONAL_LOWRANK_HPP | ||
#define CMDSTAN_ARGUMENTS_VARIATIONAL_LOWRANK_HPP | ||
|
||
#include <cmdstan/arguments/categorical_argument.hpp> | ||
|
||
namespace cmdstan { | ||
|
||
class arg_variational_lowrank : public categorical_argument { | ||
public: | ||
arg_variational_lowrank() { | ||
_name = "lowrank"; | ||
_description = "low-rank covariance"; | ||
} | ||
}; | ||
} // namespace cmdstan | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef CMDSTAN_ARGUMENTS_VARIATIONAL_RANK_HPP | ||
#define CMDSTAN_ARGUMENTS_VARIATIONAL_RANK_HPP | ||
|
||
#include <cmdstan/arguments/singleton_argument.hpp> | ||
#include <boost/lexical_cast.hpp> | ||
#include <string> | ||
|
||
namespace cmdstan { | ||
|
||
using stan::services::experimental::advi::rank; | ||
|
||
class arg_variational_rank : public int_argument { | ||
public: | ||
arg_variational_rank() : int_argument() { | ||
_name = "rank"; | ||
_description = rank::description(); | ||
_validity = "0 <= rank"; | ||
_default = boost::lexical_cast<std::string>(rank::default_value()); | ||
_default_value = rank::default_value(); | ||
_constrained = true; | ||
_good_value = rank::default_value(); | ||
_bad_value = -1.0; | ||
_value = rank::default_value(); | ||
} | ||
bool is_valid(int value) { return value >= 0; } | ||
}; | ||
} // namespace cmdstan | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters