Skip to content

Commit

Permalink
Add minor doc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesYang007 committed Nov 18, 2024
1 parent 98f1356 commit 6a45e85
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 18 deletions.
74 changes: 56 additions & 18 deletions adelie/src/py_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ void state_gaussian_pin_naive(py::module_& m, const char* name)
.def_readonly("resid_sum", &state_t::resid_sum, R"delimiter(
Weighted (by :math:`W`) sum of ``resid``.
)delimiter")
.def("solve", [](state_t state) { return _solve(state); })
.def("solve", [](state_t state) { return _solve(state); }, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -663,7 +665,9 @@ void state_gaussian_pin_cov(py::module_& m, const char* name)
``b = screen_begins[i]``,
and ``p = group_sizes[k]``.
)delimiter")
.def("solve", [](state_t state) { return _solve(state); })
.def("solve", [](state_t state) { return _solve(state); }, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -1217,7 +1221,9 @@ void state_gaussian_naive(py::module_& m, const char* name)
std::function<bool(const state_t&)> exit_cond
) {
return _solve(state, pb, exit_cond);
})
}, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -1368,7 +1374,9 @@ void state_multigaussian_naive(py::module_& m, const char* name)
std::function<bool(const state_t&)> exit_cond
) {
return _solve(state, pb, exit_cond);
})
}, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -1526,7 +1534,9 @@ void state_gaussian_cov(py::module_& m, const char* name)
std::function<bool(const state_t&)> exit_cond
) {
return _solve(state, pb, exit_cond);
})
}, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -1703,7 +1713,9 @@ void state_glm_naive(py::module_& m, const char* name)
std::function<bool(const state_t&)> exit_cond
) {
return _solve(state, glm, pb, exit_cond);
})
}, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -1857,7 +1869,9 @@ void state_multiglm_naive(py::module_& m, const char* name)
std::function<bool(const state_t&)> exit_cond
) {
return _solve(state, glm, pb, exit_cond);
})
}, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -1981,7 +1995,9 @@ void state_bvls(py::module_& m, const char* name)
.def_readonly("dbg_loss", &state_t::dbg_loss, R"delimiter(
List of the losses at each outer loop.
)delimiter")
.def("solve", [](state_t state) { return _solve(state); })
.def("solve", [](state_t state) { return _solve(state); }, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -2029,15 +2045,35 @@ void state_css_cov(py::module_& m, const char* name)
}, R"delimiter(
Selected subset.
)delimiter")
.def("solve", [](state_t state) { return _solve(state); })
.def_readonly("S_resid", &state_t::S_resid)
.def_readonly("L_T", &state_t::L_T)
.def_readonly("benchmark_init", &state_t::benchmark_init)
.def_readonly("benchmark_L_U", &state_t::benchmark_L_U)
.def_readonly("benchmark_S_resid", &state_t::benchmark_S_resid)
.def_readonly("benchmark_scores", &state_t::benchmark_scores)
.def_readonly("benchmark_L_T", &state_t::benchmark_L_T)
.def_readonly("benchmark_resid_fwd", &state_t::benchmark_resid_fwd)
.def_readonly("S_resid", &state_t::S_resid, R"delimiter(
Residual covariance matrix :math:`\Sigma - \Sigma_{\cdot T} \Sigma_{TT}^{\dagger} \Sigma_{T \cdot}`
where :math:`T` is the current subset.
)delimiter")
.def_readonly("L_T", &state_t::L_T, R"delimiter(
Lower Cholesky factor of :math:`\Sigma_{TT}`
where :math:`T` is the current subset.
)delimiter")
.def_readonly("benchmark_init", &state_t::benchmark_init, R"delimiter(
Benchmark time for the initialization.
)delimiter")
.def_readonly("benchmark_L_U", &state_t::benchmark_L_U, R"delimiter(
Benchmark time for updating the Cholesky factor after removing a feature.
)delimiter")
.def_readonly("benchmark_S_resid", &state_t::benchmark_S_resid, R"delimiter(
Benchmark time for updating the residual covariance matrix after removing a feature.
)delimiter")
.def_readonly("benchmark_scores", &state_t::benchmark_scores, R"delimiter(
Benchmark time for computing the scores.
)delimiter")
.def_readonly("benchmark_L_T", &state_t::benchmark_L_T, R"delimiter(
Benchmark time for updating the Cholesky factor after adding a feature.
)delimiter")
.def_readonly("benchmark_resid_fwd", &state_t::benchmark_resid_fwd, R"delimiter(
Benchmark time for updating the residual covariance matrix after adding a feature.
)delimiter")
.def("solve", [](state_t state) { return _solve(state); }, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down Expand Up @@ -2171,7 +2207,9 @@ void state_pinball(py::module_& m, const char* name)
.def_readonly("dbg_loss", &state_t::dbg_loss, R"delimiter(
List of the losses at each outer loop.
)delimiter")
.def("solve", [](state_t state) { return _solve(state); })
.def("solve", [](state_t state) { return _solve(state); }, R"delimiter(
Solves the state-specific problem.
)delimiter")
;
}

Expand Down
6 changes: 6 additions & 0 deletions docs/sphinx/api_reference/internal.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ Internal
adelie_core.matrix.MatrixNaiveCConcatenate64
adelie_core.matrix.MatrixNaiveRConcatenate32
adelie_core.matrix.MatrixNaiveRConcatenate64
adelie_core.matrix.MatrixNaiveConvexGatedReluDense32C
adelie_core.matrix.MatrixNaiveConvexGatedReluDense32F
adelie_core.matrix.MatrixNaiveConvexGatedReluDense64C
adelie_core.matrix.MatrixNaiveConvexGatedReluDense64F
adelie_core.matrix.MatrixNaiveConvexGatedReluSparse32F
adelie_core.matrix.MatrixNaiveConvexGatedReluSparse64F
adelie_core.matrix.MatrixNaiveConvexReluDense32C
adelie_core.matrix.MatrixNaiveConvexReluDense32F
adelie_core.matrix.MatrixNaiveConvexReluDense64C
Expand Down

0 comments on commit 6a45e85

Please sign in to comment.