Skip to content

Commit

Permalink
update overview and add torch operators (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebffischer authored Aug 16, 2024
1 parent 896d049 commit 9a08132
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 18 deletions.
6 changes: 4 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Imports:
mlr3spatiotempcv,
mlr3tuning,
mlr3tuningspaces,
mlr3torch,
mlr3verse,
mlr3viz,
paradox,
Expand All @@ -49,10 +50,11 @@ Imports:
reactable,
rmarkdown,
rprojroot,
stringi
stringi,
torchvision
Remotes:
mlr-org/mlr3extralearners,
mlr-org/mlr3fda,
mlr-org/mlr3torch,
mlr-org/mlr3proba
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

db = new.env()
db$index = c("base", "utils", "datasets", "data.table", "stats", "batchtools")
db$hosted = c("paradox", "mlr3misc", "mlr3", "mlr3data", "mlr3db", "mlr3proba", "mlr3pipelines", "mlr3learners", "mlr3filters", "bbotk", "mlr3tuning", "mlr3viz", "mlr3fselect", "mlr3cluster", "mlr3spatiotempcv", "mlr3spatial", "mlr3extralearners", "mlr3tuningspaces", "mlr3hyperband", "mlr3mbo", "mlr3verse", "mlr3benchmark", "mlr3oml", "mlr3batchmark", "mlr3fairness", "mlr3fda")
db$hosted = c("paradox", "mlr3misc", "mlr3", "mlr3data", "mlr3db", "mlr3proba", "mlr3pipelines", "mlr3learners", "mlr3filters", "bbotk", "mlr3tuning", "mlr3viz", "mlr3fselect", "mlr3cluster", "mlr3spatiotempcv", "mlr3spatial", "mlr3extralearners", "mlr3tuningspaces", "mlr3hyperband", "mlr3mbo", "mlr3verse", "mlr3benchmark", "mlr3oml", "mlr3batchmark", "mlr3fairness", "mlr3fda", "mlr3torch")

lgr = NULL

Expand Down
1 change: 1 addition & 0 deletions mlr-org/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ website:
- text: "---"
- pipeops.qmd
- graphs.qmd
- torch_pipeops.qmd
- text: "---"
- tuners.qmd
- tuning_spaces.qmd
Expand Down
24 changes: 13 additions & 11 deletions mlr-org/ecosystem.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,23 @@ content = rowwise_table(
"data", "mlr3data", "stable", "https://mlr3data.mlr-org.com/", "Data sets and tasks",
"learners", "mlr3learners", "stable", "https://mlr3learners.mlr-org.com/", "Essential learners for mlr3, maintained by the mlr-org team",
"learners", "mlr3extralearners", "stable", "https://mlr3extralearners.mlr-org.com/", "Extra learners for mlr3, implemented by the community",
"learners", "mlr3torch", "experimental", "https://mlr3torch.mlr-org.com", "Deep learning with Torch",
"learners", "mlr3torch", "stable", "https://mlr3torch.mlr-org.com", "Deep learning with torch",
"analysis", "mlr3viz", "stable", "https://mlr3viz.mlr-org.com/", "Visualizations for tasks, predictions, resample results and benchmarks",
"analysis", "mlr3benchmark", "stable", "https://mlr3benchmark.mlr-org.com/", "Analysis and tools for benchmarking",
"analysis", "mlr3inferr", "stable", "https://mlr3inferr.mlr-org.com/", "Statistical methods for inference on the generalization error",
"analysis", "mlr3summary", "stable", "https://github.com/mlr-org/mlr3summary", "Summary methods for mlr3",
"tasks", "mlr3spatiotempcv", "stable", "https://mlr3spatiotempcv.mlr-org.com/", "Spatiotemporal resampling and visualization methods",
"tasks", "mlr3cluster", "stable", "https://mlr3cluster.mlr-org.com/", "Cluster analysis",
"tasks", "mlr3proba", "stable", "https://mlr3proba.mlr-org.com/", "Probabilistic predictions",
"tasks", "mlr3temporal", "experimental", "https://mlr3temporal.mlr-org.com/", "Time series analysis",
"tasks", "mlr3spatial", "stable", "https://mlr3spatial.mlr-org.com/", "Spatial data backends and prediction functions",
"tasks", "mlr3fda", "experimental", "https://mlr3fda.mlr-org.com", "Functional Data Analysis",
"tasks", "mlr3fda", "stable", "https://mlr3fda.mlr-org.com", "Functional Data Analysis",
"tasks", "mlr3fairness", "stable", "https://mlr3fairness.mlr-org.com/", "Fairness in Machine Learning",
"utils", "paradox", "stable", "https://paradox.mlr-org.com/", "Universal parameter space description and tools",
"utils", "mlr3misc", "stable", "https://mlr3misc.mlr-org.com/", "Miscellaneous helper functions for mlr3",
"utils", "mlr3measures", "stable", "https://mlr3measures.mlr-org.com/", "Performance measures for supervised learning",
"parallelization", "mlr3batchmark", "experimental", "https://github.com/mlr-org/mlr3batchmark/", "Connector between mlr3 and batchtools",
"parallelization", "rush", "experimental", "https://github.com/mlr-org/rush", "Asynchronous parallelization"
"other", "paradox", "stable", "https://paradox.mlr-org.com/", "Universal parameter space description and tools",
"other", "mlr3misc", "stable", "https://mlr3misc.mlr-org.com/", "Miscellaneous helper functions for mlr3",
"other", "mlr3measures", "stable", "https://mlr3measures.mlr-org.com/", "Performance measures for supervised learning",
"parallelization", "mlr3batchmark", "stable", "https://github.com/mlr-org/mlr3batchmark/", "Connector between mlr3 and batchtools",
"parallelization", "rush", "stable", "https://github.com/mlr-org/rush", "Asynchronous parallelization"
)
# add CRAN link
content[, on_cran := name %in% rownames(available.packages(repos = "https://cloud.r-project.org"))]
Expand All @@ -105,15 +107,15 @@ setkeyv(content, c("category", "status"))
#| echo: false
package_grid(content[.("core")])
```

## <i class="bi-pen"></i> Learners

```{r}
#| echo: false
package_grid(content[.("learners")])
```

## <i class="bi-sliders"></i> Optimization
## <i class="bi-sliders"></i> Tuning & Optimization

```{r}
#| echo: false
Expand Down Expand Up @@ -149,11 +151,11 @@ package_grid(content[.("data")])
package_grid(content[.("analysis")])
```

## <i class="bi-balloon"></i> Utilities
## <i class="bi-balloon"></i> Other

```{r}
#| echo: false
package_grid(content[.("utils")])
package_grid(content[.("other")])
```

## <i class="bi-share"></i> Parallelization
Expand Down
7 changes: 5 additions & 2 deletions mlr-org/learners.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,29 @@ library("mlr3learners")
library("mlr3extralearners")
library("mlr3proba")
library("mlr3cluster")
library("mlr3torch")
```

To keep the dependencies on other packages reasonable, the base package mlr3 only ships with with regression and classification trees from the `r ref_pkg("rpart")` package and some learners for debugging.
A subjective selection of implementations for essential ML algorithms can be found in `r ref_pkg("mlr3learners")` package.
Survival learners are provided by `r ref_pkg("mlr3proba")`, cluster learners via `r ref_pkg("mlr3cluster")`.
Additional learners, including some learners which are not yet to be considered stable or which are not available on CRAN, are connected via the `r ref_pkg("mlr3extralearners")` package.

For neural networks, see the `r ref_pkg("mlr3torch")` extension.

```{r}
#| echo: false
#| warning: false
#| column: page
content = as.data.table(mlr_learners, objects = TRUE)
content[, base_package := map(object, function(x) strsplit(x$man, "::", TRUE)[[1]][1])]
content[, packages := pmap(list(packages, base_package), function(x, y) setdiff(x, c(y, "mlr3")))]
learners = set_names(content$object, content$key)
content[, `:=`(object = NULL, task_type = NULL)]
ref_cell = function(value) {
if (!length(value)) return(NULL)
mlr3website::ref(sprintf("%s_%s", "mlr_learners", value), text = value, format = "htmltools")
mlr3website::ref(learners[[value]]$man, text = value, format = "htmltools")
}
reactable(content, columns = list(
Expand Down
5 changes: 3 additions & 2 deletions mlr-org/pipeops.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ toc: false
library("mlr3verse")
library("mlr3proba")
library("mlr3fda")
library("mlr3torch")
```

Objects of class `r ref("PipeOp")` are the building blocks to compose linear machine learning pipelines and non-linear `r ref("Graph", text = "Graphs")`.
Expand All @@ -23,10 +24,10 @@ The base objects are implemented in `r ref_pkg("mlr3pipelines")`.
#| column: page
mlr_pipeops$remove("breslowcompose") # workaround
content = as.data.table(mlr_pipeops, objects = TRUE)[, .(key, label, packages, tags)]
content = as.data.table(mlr_pipeops)
content = content[key %nin% c("crankcompose", "distrcompose")] # deprecated, no help page
content[, packages := map(packages, function(value) setdiff(value, "mlr3pipelines"))]
content = content[, .(key, label, packages, tags)]
ref_cell = function(value) {
if (!length(value)) return(NULL)
Expand Down
44 changes: 44 additions & 0 deletions mlr-org/torch_pipeops.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sidebar: false
toc: false
---

# Torch Pipeline Operators

{{< include _setup.qmd >}}

```{r}
#| include: false
library("mlr3pipelines")
library("mlr3torch")
```

`r ref_pkg("mlr3torch")` supports a number of `r ref("PipeOp")` building blocks to define neural networks, including preprocessing and data augmentation steps.

```{r}
#| echo: false
#| column: page
content = as.data.table(mlr_pipeops)
content = content[key %nin% c("crankcompose", "distrcompose")] # deprecated, no help page
content[, packages := map(packages, function(value) setdiff(value, "mlr3pipelines"))]
content = content[, .(key, label, packages, tags)]
content = content[mlr3misc::map_lgl(packages, function(ps) "torch" %in% ps), ]
ref_cell = function(value) {
if (!length(value)) return(NULL)
mlr3website::ref(sprintf("%s_%s", "mlr_pipeops", value), text = value, format = "htmltools")
}
reactable(content, columns = list(
key = colDef(name = "Key", cell = ref_cell),
label = colDef(name = "Label"),
packages = colDef(name = "Packages", cell = package_list_cell),
tags = colDef(name = "Tags", cell = list_cell)
),
searchable = TRUE,
pagination = FALSE,
highlight = TRUE
)
```

0 comments on commit 9a08132

Please sign in to comment.