MCPcopy Create free account
hub / github.com/DeepGraphLearning/graphvite / pySGD

Class pySGD

include/bind.h:844–869  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

842};
843
844class pySGD : public py::class_<graphvite::SGD, graphvite::Optimizer> {
845public:
846 typedef graphvite::SGD SGD;
847 typedef py::class_<SGD, graphvite::Optimizer> Base;
848 using Base::def;
849 using Base::def_readonly;
850
851 template<class... Args>
852 pySGD(py::handle scope, const char *name, const Args &...args) :
853 Base(scope, name, args...) {
854 attr("__doc__") = "SGD(lr=1e-4, weight_decay=0, schedule='linear')"
855 R"(
856 Stochastic gradient descent optimizer.
857
858 Parameters:
859 lr (float, optional): initial learning rate
860 weight_decay (float, optional): weight decay (L2 regularization)
861 schedule (str or callable, optional): learning rate schedule
862 )";
863
864 // member functions
865 def(py::init<float, float, graphvite::LRSchedule>(), py::no_gil(),
866 py::arg("lr") = 1e-4, py::arg("weight_decay") = 0,
867 py::arg("schedule") = "linear");
868 }
869};
870
871class pyMomentum : public py::class_<graphvite::Momentum, graphvite::Optimizer> {
872public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected