프로젝트
GitHub에서 보기 torch
mlverse/torch
소개
Torch용 R 인터페이스
AI 및 머신러닝측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- +1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originaltorch 
Installation
torch can be installed from CRAN with:
install.packages("torch")
You can also install the development version with:
remotes::install_github("mlverse/torch")
At the first package load additional software will be installed. See also the full installation guide here.
Examples
You can create torch tensors from R objects with the torch_tensor
function and convert them back to R objects with as_array.
library(torch)
x <- array(runif(8), dim = c(2, 2, 2))
y <- torch_tensor(x, dtype = torch_float64())
y
#> torch_tensor
#> (1,.,.) =
#> 0.6192 0.5800
#> 0.2488 0.3681
#>
#> (2,.,.) =
#> 0.0042 0.9206
#> 0.4388 0.5664
#> [ CPUDoubleType{2,2,2} ]
identical(x, as_array(y))
#> [1] TRUE
Simple Autograd Example
In the following snippet we let torch, using the autograd feature, calculate the derivatives:
x <- torch_tensor(1, requires_grad = TRUE)
w <- torch_tensor(2, requires_grad = TRUE)
b <- torch_tensor(3, requires_grad = TRUE)
y <- w * x + b
y$backward()
x$grad
#> torch_tensor
#> 2
#> [ CPUFloatType{1} ]
w$grad
#> torch_tensor
#> 1
#> [ CPUFloatType{1} ]
b$grad
#> torch_tensor
#> 1
#> [ CPUFloatType{1} ]
Contributing
No matter your current skills it’s possible to contribute to torch
development. See the contributing
guide for more
information.
관련 프로젝트 살펴보기
불러오는 중…