From 067fdfa36919630bf58431ab92d6e4c09c825630 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Wed, 29 Jan 2025 17:45:14 +0000 Subject: [PATCH] Built site for torch@0.13.0.9001: 8009f88 --- dev/articles/examples/basic-nn-module.html | 32 ++--- dev/articles/indexing.html | 22 +-- dev/articles/loading-data.html | 2 +- dev/articles/tensor-creation.html | 10 +- dev/articles/torchscript.html | 140 +++++++++---------- dev/articles/using-autograd.html | 40 +++--- dev/pkgdown.yml | 2 +- dev/reference/distr_categorical.html | 2 +- dev/reference/distr_gamma.html | 3 +- dev/reference/distr_multivariate_normal.html | 4 +- dev/reference/distr_normal.html | 2 +- dev/reference/jit_compile.html | 2 +- dev/reference/linalg_cholesky_ex.html | 4 +- dev/reference/linalg_det.html | 6 +- dev/reference/linalg_eigh.html | 8 +- dev/reference/linalg_eigvalsh.html | 4 +- dev/reference/linalg_inv.html | 8 +- dev/reference/linalg_pinv.html | 10 +- dev/reference/linalg_slogdet.html | 4 +- dev/reference/linalg_svd.html | 22 +-- dev/reference/linalg_svdvals.html | 6 +- dev/reference/linalg_tensorsolve.html | 2 +- dev/reference/nn_avg_pool1d.html | 2 +- dev/reference/nn_embedding.html | 4 +- dev/reference/nn_flatten.html | 60 ++++---- dev/reference/nn_init_kaiming_normal_.html | 6 +- dev/reference/nn_init_kaiming_uniform_.html | 6 +- dev/reference/nn_init_normal_.html | 6 +- dev/reference/nn_init_orthogonal_.html | 6 +- dev/reference/nn_init_trunc_normal_.html | 6 +- dev/reference/nn_init_uniform_.html | 6 +- dev/reference/nn_init_xavier_normal_.html | 6 +- dev/reference/nn_init_xavier_uniform_.html | 6 +- dev/reference/nn_max_unpool2d.html | 6 +- dev/reference/nn_relu.html | 4 +- dev/reference/nn_rnn.html | 78 +++++------ dev/reference/nn_rrelu.html | 4 +- dev/reference/slc.html | 6 +- dev/reference/torch_acos.html | 4 +- dev/reference/torch_acosh.html | 8 +- dev/reference/torch_add.html | 8 +- dev/reference/torch_addbmm.html | 6 +- dev/reference/torch_addcdiv.html | 6 +- dev/reference/torch_addcmul.html | 6 +- dev/reference/torch_addmm.html | 4 +- dev/reference/torch_addmv.html | 4 +- dev/reference/torch_amax.html | 8 +- dev/reference/torch_amin.html | 8 +- dev/reference/torch_argmax.html | 4 +- dev/reference/torch_argmin.html | 4 +- dev/reference/torch_argsort.html | 8 +- dev/reference/torch_as_strided.html | 4 +- dev/reference/torch_asin.html | 6 +- dev/reference/torch_asinh.html | 8 +- dev/reference/torch_atan.html | 8 +- dev/reference/torch_atan2.html | 8 +- dev/reference/torch_atanh.html | 8 +- dev/reference/torch_baddbmm.html | 36 ++--- dev/reference/torch_bincount.html | 6 +- dev/reference/torch_bmm.html | 36 ++--- dev/reference/torch_cat.html | 4 +- dev/reference/torch_ceil.html | 4 +- dev/reference/torch_chain_matmul.html | 6 +- dev/reference/torch_channel_shuffle.html | 32 ++--- dev/reference/torch_cholesky_solve.html | 6 +- dev/reference/torch_clamp.html | 6 +- dev/reference/torch_conv1d.html | 58 ++++---- dev/reference/torch_conv2d.html | 42 +++--- dev/reference/torch_conv_transpose1d.html | 58 ++++---- dev/reference/torch_conv_transpose2d.html | 42 +++--- dev/reference/torch_cos.html | 8 +- dev/reference/torch_cosh.html | 8 +- dev/reference/torch_cosine_similarity.html | 58 ++++---- dev/reference/torch_count_nonzero.html | 6 +- dev/reference/torch_cross.html | 8 +- dev/reference/torch_cummax.html | 34 ++--- dev/reference/torch_cummin.html | 38 ++--- dev/reference/torch_cumprod.html | 20 +-- dev/reference/torch_cumsum.html | 20 +-- dev/reference/torch_det.html | 6 +- dev/reference/torch_diag_embed.html | 12 +- dev/reference/torch_diagflat.html | 8 +- dev/reference/torch_diagonal.html | 17 +-- dev/reference/torch_dist.html | 2 +- dev/reference/torch_div.html | 8 +- dev/reference/torch_floor.html | 4 +- dev/reference/torch_index_select.html | 6 +- dev/reference/torch_log.html | 6 +- dev/reference/torch_log10.html | 11 +- dev/reference/torch_log1p.html | 10 +- dev/reference/torch_log2.html | 11 +- dev/reference/torch_logcumsumexp.html | 20 +-- dev/reference/torch_logit.html | 10 +- dev/reference/torch_logsumexp.html | 6 +- dev/reference/torch_lu.html | 12 +- dev/reference/torch_lu_solve.html | 2 +- dev/reference/torch_masked_select.html | 6 +- dev/reference/torch_matmul.html | 36 ++--- dev/reference/torch_matrix_power.html | 8 +- dev/reference/torch_max.html | 8 +- dev/reference/torch_mean.html | 2 +- dev/reference/torch_median.html | 16 +-- dev/reference/torch_min.html | 8 +- dev/reference/torch_mm.html | 4 +- dev/reference/torch_mode.html | 4 +- dev/reference/torch_movedim.html | 5 +- dev/reference/torch_mul.html | 8 +- dev/reference/torch_multinomial.html | 2 +- dev/reference/torch_mv.html | 4 +- dev/reference/torch_mvlgamma.html | 4 +- dev/reference/torch_neg.html | 10 +- dev/reference/torch_normal.html | 2 +- dev/reference/torch_pinverse.html | 12 +- dev/reference/torch_poisson.html | 8 +- dev/reference/torch_prod.html | 4 +- dev/reference/torch_rand.html | 4 +- dev/reference/torch_randint.html | 4 +- dev/reference/torch_randn.html | 4 +- dev/reference/torch_randperm.html | 4 +- dev/reference/torch_reciprocal.html | 8 +- dev/reference/torch_round.html | 4 +- dev/reference/torch_rsqrt.html | 8 +- dev/reference/torch_sigmoid.html | 8 +- dev/reference/torch_sin.html | 8 +- dev/reference/torch_sinh.html | 8 +- dev/reference/torch_slogdet.html | 2 +- dev/reference/torch_sort.html | 12 +- dev/reference/torch_sqrt.html | 8 +- dev/reference/torch_square.html | 8 +- dev/reference/torch_std.html | 8 +- dev/reference/torch_std_mean.html | 16 +-- dev/reference/torch_svd.html | 2 +- dev/reference/torch_t.html | 6 +- dev/reference/torch_take_along_dim.html | 10 +- dev/reference/torch_tan.html | 8 +- dev/reference/torch_tanh.html | 8 +- dev/reference/torch_transpose.html | 6 +- dev/reference/torch_trapz.html | 4 +- dev/reference/torch_triangular_solve.html | 8 +- dev/reference/torch_tril.html | 6 +- dev/reference/torch_triu.html | 8 +- dev/reference/torch_trunc.html | 4 +- dev/reference/torch_var.html | 8 +- dev/reference/torch_var_mean.html | 16 +-- dev/reference/with_detect_anomaly.html | 42 +++--- dev/search.json | 2 +- 146 files changed, 880 insertions(+), 877 deletions(-) diff --git a/dev/articles/examples/basic-nn-module.html b/dev/articles/examples/basic-nn-module.html index 60de099a8c..3e32a0b5a4 100644 --- a/dev/articles/examples/basic-nn-module.html +++ b/dev/articles/examples/basic-nn-module.html @@ -133,9 +133,9 @@

basic-nn-module

model$parameters
## $w
 ## torch_tensor
-## -0.8953
-## -0.7010
-## -0.5082
+## -1.6138
+##  1.0521
+## -0.3141
 ## [ CPUFloatType{3,1} ][ requires_grad = TRUE ]
 ## 
 ## $b
@@ -146,9 +146,9 @@ 

basic-nn-module

# or individually model$w
## torch_tensor
-## -0.8953
-## -0.7010
-## -0.5082
+## -1.6138
+##  1.0521
+## -0.3141
 ## [ CPUFloatType{3,1} ][ requires_grad = TRUE ]
 model$b
@@ -163,16 +163,16 @@

basic-nn-module

 y_pred
## torch_tensor
-## -1.4629
-##  1.2914
-##  0.2961
-##  0.4767
-## -0.4065
-## -2.4399
-##  1.8867
-## -0.9006
-##  0.7585
-##  0.2463
+##  1.5881
+## -1.9840
+##  1.1975
+##  0.1289
+##  1.5620
+##  0.3064
+##  2.8860
+##  0.0016
+## -2.0449
+##  1.6562
 ## [ CPUFloatType{10,1} ][ grad_fn = <AddBackward0> ]
diff --git a/dev/articles/indexing.html b/dev/articles/indexing.html index d5da926725..9a0b540bfd 100644 --- a/dev/articles/indexing.html +++ b/dev/articles/indexing.html @@ -244,23 +244,23 @@

Getting the complete dimensionx <- torch_randn(2, 3) x #> torch_tensor -#> 1.0407 -1.2171 -0.7123 -#> -1.0583 0.3946 0.3609 +#> -0.8567 -0.5082 -1.0920 +#> 0.5333 0.4624 -1.8096 #> [ CPUFloatType{2,3} ]

The following syntax will give you the first row:

 x[1,]
 #> torch_tensor
-#>  1.0407
-#> -1.2171
-#> -0.7123
+#> -0.8567
+#> -0.5082
+#> -1.0920
 #> [ CPUFloatType{3} ]

And this would give you the first 2 columns:

 x[,1:2]
 #> torch_tensor
-#>  1.0407 -1.2171
-#> -1.0583  0.3946
+#> -0.8567 -0.5082
+#>  0.5333  0.4624
 #> [ CPUFloatType{2,2} ]
@@ -339,15 +339,15 @@

Indexing with vectorsx <- torch_randn(4,4) x[c(1,3), c(1,3)] #> torch_tensor -#> 0.2034 -0.8451 -#> -0.1474 -0.1807 +#> 0.2649 0.3510 +#> -0.0117 -1.2681 #> [ CPUFloatType{2,2} ]

You can also use boolean vectors, for example:

 x[c(TRUE, FALSE, TRUE, FALSE), c(TRUE, FALSE, TRUE, FALSE)]
 #> torch_tensor
-#>  0.2034 -0.8451
-#> -0.1474 -0.1807
+#>  0.2649  0.3510
+#> -0.0117 -1.2681
 #> [ CPUFloatType{2,2} ]

The above examples also work if the index were long or boolean tensors, instead of R vectors. It’s also possible to index with diff --git a/dev/articles/loading-data.html b/dev/articles/loading-data.html index 4df074e926..4e86fa8dc3 100644 --- a/dev/articles/loading-data.html +++ b/dev/articles/loading-data.html @@ -385,7 +385,7 @@

Training with data loaders cat(sprintf("Loss at epoch %d: %3f\n", epoch, mean(l))) } -#> Loss at epoch 1: 159.437053 +#> Loss at epoch 1: 328.241381 #> Loss at epoch 2: 2.068251 #> Loss at epoch 3: 2.068251 #> Loss at epoch 4: 2.068251 diff --git a/dev/articles/tensor-creation.html b/dev/articles/tensor-creation.html index f58aa8b798..101be15321 100644 --- a/dev/articles/tensor-creation.html +++ b/dev/articles/tensor-creation.html @@ -182,11 +182,11 @@

Using creation functionsx <- torch_randn(5, 3) x #> torch_tensor -#> -1.7748 -0.4257 -0.1189 -#> -0.3793 0.0571 0.4344 -#> 1.8353 -0.7538 0.2830 -#> -0.0436 -1.1406 -0.8220 -#> -0.8194 -0.4795 0.5869 +#> -0.3757 -0.6515 -0.3721 +#> -1.5479 -0.4439 -0.9725 +#> 0.7350 1.4460 -0.0507 +#> 0.3312 0.4766 -0.0377 +#> -0.0388 0.3678 1.4032 #> [ CPUFloatType{5,3} ]

Another example is torch_ones, which creates a tensor filled with ones.

diff --git a/dev/articles/torchscript.html b/dev/articles/torchscript.html index ea90c5302b..8b707b901a 100644 --- a/dev/articles/torchscript.html +++ b/dev/articles/torchscript.html @@ -157,9 +157,9 @@

Tracing
 traced_fn(torch_randn(3))
 #> torch_tensor
-#>  0.2000
 #>  0.0000
 #>  0.0000
+#>  1.3620
 #> [ CPUFloatType{3} ]

It’s also possible to trace nn_modules() defined in R, for example:

@@ -189,9 +189,9 @@

Tracing
 traced_module(torch_randn(3, 10))
 #> torch_tensor
-#> -0.3950
-#> -0.4689
-#> -0.9543
+#>  0.2729
+#>  0.3995
+#>  0.7955
 #> [ CPUFloatType{3,1} ][ grad_fn = <AddmmBackward0> ]

Limitations of tracing @@ -229,9 +229,9 @@

Limitations of tracingtraced_dropout <- jit_trace(nn_dropout(), torch_ones(5,5)) traced_dropout(torch_ones(3,3)) #> torch_tensor -#> 0 0 0 -#> 2 0 0 -#> 2 0 0 +#> 2 0 2 +#> 0 2 0 +#> 0 0 2 #> [ CPUFloatType{3,3} ] traced_dropout$eval() #> [1] FALSE @@ -253,69 +253,69 @@

Limitations of tracingjit_trace(fn, torch_tensor(1), 1) #> Error in cpp_trace_function(tr_fn, list(...), .compilation_unit, strict, : Only tensors or (possibly nested) dict or tuples of tensors can be inputs to traced functions. Got float #> Exception raised from addInput at /Users/runner/work/libtorch-mac-m1/libtorch-mac-m1/pytorch/torch/csrc/jit/frontend/tracer.cpp:422 (most recent call first): -#> frame #0: std::__1::shared_ptr<c10::(anonymous namespace)::PyTorchStyleBacktrace> std::__1::make_shared[abi:ue170006]<c10::(anonymous namespace)::PyTorchStyleBacktrace, c10::SourceLocation&, void>(c10::SourceLocation&) + 121 (0x10d525639 in libc10.dylib) -#> frame #1: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 54 (0x10d525776 in libc10.dylib) -#> frame #2: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 149 (0x10d522035 in libc10.dylib) -#> frame #3: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 6225 (0x124b15cf1 in libtorch_cpu.dylib) -#> frame #4: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 4799 (0x124b1575f in libtorch_cpu.dylib) -#> frame #5: torch::jit::tracer::trace(std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>, std::__1::function<std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>> (std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>)> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> (at::Tensor const&)>, bool, bool, torch::jit::Module*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 666 (0x124b12eaa in libtorch_cpu.dylib) -#> frame #6: _lantern_trace_fn + 408 (0x11219ce28 in liblantern.dylib) -#> frame #7: cpp_trace_function(Rcpp::Function_Impl<Rcpp::PreserveStorage>, XPtrTorchStack, XPtrTorchCompilationUnit, XPtrTorchstring, bool, XPtrTorchScriptModule, bool, bool) + 601 (0x1103f6959 in torchpkg.so) -#> frame #8: _torch_cpp_trace_function + 719 (0x11021368f in torchpkg.so) -#> frame #9: R_doDotCall + 13245 (0x10a9164bd in libR.dylib) -#> frame #10: bcEval_loop + 146595 (0x10a97e123 in libR.dylib) -#> frame #11: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #12: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #13: R_execClosure + 761 (0x10a94e039 in libR.dylib) -#> frame #14: applyClosure_core + 128 (0x10a94d140 in libR.dylib) -#> frame #15: Rf_eval + 1189 (0x10a94b7a5 in libR.dylib) -#> frame #16: do_eval + 1253 (0x10a952b65 in libR.dylib) -#> frame #17: bcEval_loop + 44444 (0x10a96521c in libR.dylib) -#> frame #18: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #19: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #20: forcePromise + 230 (0x10a94c026 in libR.dylib) -#> frame #21: Rf_eval + 634 (0x10a94b57a in libR.dylib) -#> frame #22: do_withVisible + 57 (0x10a952ef9 in libR.dylib) -#> frame #23: do_internal + 362 (0x10a9cab6a in libR.dylib) -#> frame #24: bcEval_loop + 45071 (0x10a96548f in libR.dylib) -#> frame #25: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #26: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #27: forcePromise + 230 (0x10a94c026 in libR.dylib) -#> frame #28: Rf_eval + 634 (0x10a94b57a in libR.dylib) -#> frame #29: forcePromise + 230 (0x10a94c026 in libR.dylib) -#> frame #30: bcEval_loop + 19464 (0x10a95f088 in libR.dylib) -#> frame #31: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #32: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #33: R_execClosure + 761 (0x10a94e039 in libR.dylib) -#> frame #34: applyClosure_core + 128 (0x10a94d140 in libR.dylib) -#> frame #35: Rf_eval + 1189 (0x10a94b7a5 in libR.dylib) -#> frame #36: do_eval + 1253 (0x10a952b65 in libR.dylib) -#> frame #37: bcEval_loop + 44444 (0x10a96521c in libR.dylib) -#> frame #38: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #39: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #40: R_execClosure + 761 (0x10a94e039 in libR.dylib) -#> frame #41: applyClosure_core + 128 (0x10a94d140 in libR.dylib) -#> frame #42: Rf_eval + 1189 (0x10a94b7a5 in libR.dylib) -#> frame #43: do_begin + 429 (0x10a950a2d in libR.dylib) -#> frame #44: Rf_eval + 990 (0x10a94b6de in libR.dylib) -#> frame #45: R_execClosure + 761 (0x10a94e039 in libR.dylib) -#> frame #46: applyClosure_core + 128 (0x10a94d140 in libR.dylib) -#> frame #47: Rf_eval + 1189 (0x10a94b7a5 in libR.dylib) -#> frame #48: do_docall + 615 (0x10a8dc2a7 in libR.dylib) -#> frame #49: bcEval_loop + 44444 (0x10a96521c in libR.dylib) -#> frame #50: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #51: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #52: R_execClosure + 761 (0x10a94e039 in libR.dylib) -#> frame #53: applyClosure_core + 128 (0x10a94d140 in libR.dylib) -#> frame #54: Rf_eval + 1189 (0x10a94b7a5 in libR.dylib) -#> frame #55: do_docall + 615 (0x10a8dc2a7 in libR.dylib) -#> frame #56: bcEval_loop + 44444 (0x10a96521c in libR.dylib) -#> frame #57: bcEval + 628 (0x10a94bdf4 in libR.dylib) -#> frame #58: Rf_eval + 506 (0x10a94b4fa in libR.dylib) -#> frame #59: R_execClosure + 761 (0x10a94e039 in libR.dylib) -#> frame #60: applyClosure_core + 128 (0x10a94d140 in libR.dylib) -#> frame #61: Rf_eval + 1189 (0x10a94b7a5 in libR.dylib) -#> frame #62: forcePromise + 230 (0x10a94c026 in libR.dylib) +#> frame #0: std::__1::shared_ptr<c10::(anonymous namespace)::PyTorchStyleBacktrace> std::__1::make_shared[abi:ue170006]<c10::(anonymous namespace)::PyTorchStyleBacktrace, c10::SourceLocation&, void>(c10::SourceLocation&) + 121 (0x10d2ee639 in libc10.dylib) +#> frame #1: c10::Error::Error(c10::SourceLocation, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>) + 54 (0x10d2ee776 in libc10.dylib) +#> frame #2: c10::detail::torchCheckFail(char const*, char const*, unsigned int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&) + 149 (0x10d2eb035 in libc10.dylib) +#> frame #3: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 6225 (0x1248decf1 in libtorch_cpu.dylib) +#> frame #4: torch::jit::tracer::addInput(std::__1::shared_ptr<torch::jit::tracer::TracingState> const&, c10::IValue const&, c10::Type::SingletonOrSharedTypePtr<c10::Type> const&, torch::jit::Value*) + 4799 (0x1248de75f in libtorch_cpu.dylib) +#> frame #5: torch::jit::tracer::trace(std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>, std::__1::function<std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>> (std::__1::vector<c10::IValue, std::__1::allocator<c10::IValue>>)> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> (at::Tensor const&)>, bool, bool, torch::jit::Module*, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&) + 666 (0x1248dbeaa in libtorch_cpu.dylib) +#> frame #6: _lantern_trace_fn + 408 (0x111f65e28 in liblantern.dylib) +#> frame #7: cpp_trace_function(Rcpp::Function_Impl<Rcpp::PreserveStorage>, XPtrTorchStack, XPtrTorchCompilationUnit, XPtrTorchstring, bool, XPtrTorchScriptModule, bool, bool) + 601 (0x1101bf959 in torchpkg.so) +#> frame #8: _torch_cpp_trace_function + 719 (0x10ffdc68f in torchpkg.so) +#> frame #9: R_doDotCall + 13245 (0x10a6df4bd in libR.dylib) +#> frame #10: bcEval_loop + 146595 (0x10a747123 in libR.dylib) +#> frame #11: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #12: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #13: R_execClosure + 761 (0x10a717039 in libR.dylib) +#> frame #14: applyClosure_core + 128 (0x10a716140 in libR.dylib) +#> frame #15: Rf_eval + 1189 (0x10a7147a5 in libR.dylib) +#> frame #16: do_eval + 1253 (0x10a71bb65 in libR.dylib) +#> frame #17: bcEval_loop + 44444 (0x10a72e21c in libR.dylib) +#> frame #18: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #19: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #20: forcePromise + 230 (0x10a715026 in libR.dylib) +#> frame #21: Rf_eval + 634 (0x10a71457a in libR.dylib) +#> frame #22: do_withVisible + 57 (0x10a71bef9 in libR.dylib) +#> frame #23: do_internal + 362 (0x10a793b6a in libR.dylib) +#> frame #24: bcEval_loop + 45071 (0x10a72e48f in libR.dylib) +#> frame #25: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #26: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #27: forcePromise + 230 (0x10a715026 in libR.dylib) +#> frame #28: Rf_eval + 634 (0x10a71457a in libR.dylib) +#> frame #29: forcePromise + 230 (0x10a715026 in libR.dylib) +#> frame #30: bcEval_loop + 19464 (0x10a728088 in libR.dylib) +#> frame #31: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #32: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #33: R_execClosure + 761 (0x10a717039 in libR.dylib) +#> frame #34: applyClosure_core + 128 (0x10a716140 in libR.dylib) +#> frame #35: Rf_eval + 1189 (0x10a7147a5 in libR.dylib) +#> frame #36: do_eval + 1253 (0x10a71bb65 in libR.dylib) +#> frame #37: bcEval_loop + 44444 (0x10a72e21c in libR.dylib) +#> frame #38: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #39: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #40: R_execClosure + 761 (0x10a717039 in libR.dylib) +#> frame #41: applyClosure_core + 128 (0x10a716140 in libR.dylib) +#> frame #42: Rf_eval + 1189 (0x10a7147a5 in libR.dylib) +#> frame #43: do_begin + 429 (0x10a719a2d in libR.dylib) +#> frame #44: Rf_eval + 990 (0x10a7146de in libR.dylib) +#> frame #45: R_execClosure + 761 (0x10a717039 in libR.dylib) +#> frame #46: applyClosure_core + 128 (0x10a716140 in libR.dylib) +#> frame #47: Rf_eval + 1189 (0x10a7147a5 in libR.dylib) +#> frame #48: do_docall + 615 (0x10a6a52a7 in libR.dylib) +#> frame #49: bcEval_loop + 44444 (0x10a72e21c in libR.dylib) +#> frame #50: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #51: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #52: R_execClosure + 761 (0x10a717039 in libR.dylib) +#> frame #53: applyClosure_core + 128 (0x10a716140 in libR.dylib) +#> frame #54: Rf_eval + 1189 (0x10a7147a5 in libR.dylib) +#> frame #55: do_docall + 615 (0x10a6a52a7 in libR.dylib) +#> frame #56: bcEval_loop + 44444 (0x10a72e21c in libR.dylib) +#> frame #57: bcEval + 628 (0x10a714df4 in libR.dylib) +#> frame #58: Rf_eval + 506 (0x10a7144fa in libR.dylib) +#> frame #59: R_execClosure + 761 (0x10a717039 in libR.dylib) +#> frame #60: applyClosure_core + 128 (0x10a716140 in libR.dylib) +#> frame #61: Rf_eval + 1189 (0x10a7147a5 in libR.dylib) +#> frame #62: forcePromise + 230 (0x10a715026 in libR.dylib) #> :

diff --git a/dev/articles/using-autograd.html b/dev/articles/using-autograd.html index 56bd516e80..3103e676af 100644 --- a/dev/articles/using-autograd.html +++ b/dev/articles/using-autograd.html @@ -284,26 +284,26 @@

The simple network, now using aut }) } -#> 10 22.30702 -#> 20 21.10898 -#> 30 20.02328 -#> 40 19.03706 -#> 50 18.1424 -#> 60 17.32488 -#> 70 16.57545 -#> 80 15.88739 -#> 90 15.25412 -#> 100 14.6705 -#> 110 14.1301 -#> 120 13.62825 -#> 130 13.16209 -#> 140 12.72827 -#> 150 12.32391 -#> 160 11.94614 -#> 170 11.5924 -#> 180 11.26179 -#> 190 10.95113 -#> 200 10.6589 +#> 10 78.73093 +#> 20 71.43922 +#> 30 65.02069 +#> 40 59.35413 +#> 50 54.33459 +#> 60 49.87415 +#> 70 45.8984 +#> 80 42.34811 +#> 90 39.17031 +#> 100 36.3188 +#> 110 33.75182 +#> 120 31.43066 +#> 130 29.33244 +#> 140 27.43057 +#> 150 25.70705 +#> 160 24.1435 +#> 170 22.72075 +#> 180 21.4157 +#> 190 20.22462 +#> 200 19.13639

We still manually compute the forward pass, and we still manually update the weights. In the last two chapters of this section, we’ll see how these parts of the logic can be made more modular and reusable, as diff --git a/dev/pkgdown.yml b/dev/pkgdown.yml index 880df69b19..c86cca69ca 100644 --- a/dev/pkgdown.yml +++ b/dev/pkgdown.yml @@ -20,7 +20,7 @@ articles: tensor-creation: tensor-creation.html torchscript: torchscript.html using-autograd: using-autograd.html -last_built: 2025-01-29T16:50Z +last_built: 2025-01-29T17:36Z urls: reference: https://torch.mlverse.org/docs/reference article: https://torch.mlverse.org/docs/articles diff --git a/dev/reference/distr_categorical.html b/dev/reference/distr_categorical.html index 4f3f92f718..5a93bc4b57 100644 --- a/dev/reference/distr_categorical.html +++ b/dev/reference/distr_categorical.html @@ -120,7 +120,7 @@

Examplesm$sample() # equal probability of 1,2,3,4 } #> torch_tensor -#> 4 +#> 2 #> [ CPULongType{} ] diff --git a/dev/reference/distr_gamma.html b/dev/reference/distr_gamma.html index f29aaed9e4..320918fdbc 100644 --- a/dev/reference/distr_gamma.html +++ b/dev/reference/distr_gamma.html @@ -111,7 +111,8 @@

Examplesm$sample() # Gamma distributed with concentration=1 and rate=1 } #> torch_tensor -#> 0.6156 +#> 0.01 * +#> 3.4395 #> [ CPUFloatType{1} ] diff --git a/dev/reference/distr_multivariate_normal.html b/dev/reference/distr_multivariate_normal.html index 6ed74e78a4..4a799e4786 100644 --- a/dev/reference/distr_multivariate_normal.html +++ b/dev/reference/distr_multivariate_normal.html @@ -145,8 +145,8 @@

Examplesm$sample() # normally distributed with mean=`[0,0]` and covariance_matrix=`I` } #> torch_tensor -#> -1.0911 -#> -1.5919 +#> -1.6044 +#> 2.1363 #> [ CPUFloatType{2} ] diff --git a/dev/reference/distr_normal.html b/dev/reference/distr_normal.html index ca7cb705c9..8f843a83f1 100644 --- a/dev/reference/distr_normal.html +++ b/dev/reference/distr_normal.html @@ -116,7 +116,7 @@

Examplesm$sample() # normally distributed with loc=0 and scale=1 } #> torch_tensor -#> 1.0794 +#> 0.1798 #> [ CPUFloatType{1} ] diff --git a/dev/reference/jit_compile.html b/dev/reference/jit_compile.html index a8324addbd..4f9990911f 100644 --- a/dev/reference/jit_compile.html +++ b/dev/reference/jit_compile.html @@ -103,7 +103,7 @@

Examplescomp$foo(torch_randn(10)) } #> torch_tensor -#> -4.05253 +#> -5.04028 #> [ CPUFloatType{} ] diff --git a/dev/reference/linalg_cholesky_ex.html b/dev/reference/linalg_cholesky_ex.html index 92d1c0fb41..575848bfe5 100644 --- a/dev/reference/linalg_cholesky_ex.html +++ b/dev/reference/linalg_cholesky_ex.html @@ -178,8 +178,8 @@

Examples} #> $L #> torch_tensor -#> -1.6310 0.0000 -#> -2.1641 -0.5793 +#> -0.6368 0.0000 +#> -0.4798 -1.1550 #> [ CPUFloatType{2,2} ] #> #> $info diff --git a/dev/reference/linalg_det.html b/dev/reference/linalg_det.html index 0a888ae59d..cf9ef176c9 100644 --- a/dev/reference/linalg_det.html +++ b/dev/reference/linalg_det.html @@ -129,9 +129,9 @@

Exampleslinalg_det(a) } #> torch_tensor -#> -3.2136 -#> -5.0983 -#> -2.4798 +#> 1.3223 +#> -0.7705 +#> 2.2559 #> [ CPUFloatType{3} ] diff --git a/dev/reference/linalg_eigh.html b/dev/reference/linalg_eigh.html index 9ac68176dd..1ccd3b28c2 100644 --- a/dev/reference/linalg_eigh.html +++ b/dev/reference/linalg_eigh.html @@ -192,14 +192,14 @@

Examples} #> [[1]] #> torch_tensor -#> -0.6244 -#> 1.7012 +#> -2.2555 +#> 1.7787 #> [ CPUFloatType{2} ] #> #> [[2]] #> torch_tensor -#> -0.9877 0.1565 -#> 0.1565 0.9877 +#> 0.6775 -0.7356 +#> 0.7356 0.6775 #> [ CPUFloatType{2,2} ] #> diff --git a/dev/reference/linalg_eigvalsh.html b/dev/reference/linalg_eigvalsh.html index 47451c4be1..c908b5ed1a 100644 --- a/dev/reference/linalg_eigvalsh.html +++ b/dev/reference/linalg_eigvalsh.html @@ -153,8 +153,8 @@

Exampleslinalg_eigvalsh(a) } #> torch_tensor -#> -1.9047 -#> 0.8279 +#> -1.8154 +#> 0.9302 #> [ CPUFloatType{2} ] diff --git a/dev/reference/linalg_inv.html b/dev/reference/linalg_inv.html index 4d49fb8236..ede8b86e5d 100644 --- a/dev/reference/linalg_inv.html +++ b/dev/reference/linalg_inv.html @@ -144,10 +144,10 @@

Exampleslinalg_inv(A) } #> torch_tensor -#> -0.7437 -0.0578 0.2346 -0.1406 -#> -0.5981 0.3492 0.1369 -0.2512 -#> 0.2396 0.4948 -0.0834 0.7036 -#> 0.3922 -0.2080 0.3139 0.0651 +#> 0.0572 -0.3039 -0.1363 0.0364 +#> 0.2231 0.0342 -0.2581 -0.2933 +#> 1.2393 0.3403 0.3642 -0.2719 +#> 0.2872 0.1886 -0.1920 0.3303 #> [ CPUFloatType{4,4} ] diff --git a/dev/reference/linalg_pinv.html b/dev/reference/linalg_pinv.html index 89b65200e4..19cb4ea033 100644 --- a/dev/reference/linalg_pinv.html +++ b/dev/reference/linalg_pinv.html @@ -177,11 +177,11 @@

Exampleslinalg_pinv(A) } #> torch_tensor -#> 0.1760 0.0852 0.0850 -#> -0.0337 -0.2104 0.1533 -#> 0.2154 0.2900 0.4035 -#> 0.2175 -0.5815 0.1646 -#> 0.2447 -0.0660 -0.1269 +#> 0.4543 -0.2898 -0.2170 +#> -0.2237 -0.3511 -0.0215 +#> -0.6818 -0.0817 0.3365 +#> 0.5973 -0.3220 0.1816 +#> -0.4138 0.8357 0.0950 #> [ CPUFloatType{5,3} ] diff --git a/dev/reference/linalg_slogdet.html b/dev/reference/linalg_slogdet.html index 74361d817c..93a565098b 100644 --- a/dev/reference/linalg_slogdet.html +++ b/dev/reference/linalg_slogdet.html @@ -146,12 +146,12 @@

Examples} #> [[1]] #> torch_tensor -#> -1 +#> 1 #> [ CPUFloatType{} ] #> #> [[2]] #> torch_tensor -#> 0.867417 +#> -0.0984993 #> [ CPUFloatType{} ] #> diff --git a/dev/reference/linalg_svd.html b/dev/reference/linalg_svd.html index c703bfa65a..58780a1d25 100644 --- a/dev/reference/linalg_svd.html +++ b/dev/reference/linalg_svd.html @@ -203,25 +203,25 @@

Examples} #> [[1]] #> torch_tensor -#> 0.4816 0.5060 -0.1932 -#> 0.6406 -0.4833 0.2812 -#> 0.2074 -0.5805 -0.6470 -#> 0.2632 0.3775 -0.5582 -#> -0.4953 -0.1757 -0.3917 +#> -0.6162 -0.4065 0.4483 +#> -0.6869 0.6354 -0.0103 +#> -0.1499 -0.0479 0.0111 +#> 0.2900 0.6527 0.3544 +#> 0.2047 -0.0513 0.8205 #> [ CPUFloatType{5,3} ] #> #> [[2]] #> torch_tensor -#> 3.6537 -#> 1.9513 -#> 1.0523 +#> 4.3524 +#> 3.1251 +#> 1.3316 #> [ CPUFloatType{3} ] #> #> [[3]] #> torch_tensor -#> 0.2868 -0.9035 0.3187 -#> -0.8655 -0.1017 0.4904 -#> -0.4107 -0.4164 -0.8111 +#> 0.7626 0.6444 -0.0554 +#> -0.6344 0.7620 0.1304 +#> 0.1263 -0.0643 0.9899 #> [ CPUFloatType{3,3} ] #> diff --git a/dev/reference/linalg_svdvals.html b/dev/reference/linalg_svdvals.html index afb8d104e5..0f6156fb94 100644 --- a/dev/reference/linalg_svdvals.html +++ b/dev/reference/linalg_svdvals.html @@ -135,9 +135,9 @@

ExamplesS } #> torch_tensor -#> 2.9909 -#> 1.5758 -#> 0.4192 +#> 2.8674 +#> 1.5003 +#> 0.7873 #> [ CPUFloatType{3} ] diff --git a/dev/reference/linalg_tensorsolve.html b/dev/reference/linalg_tensorsolve.html index 91503711d2..1611b94c8e 100644 --- a/dev/reference/linalg_tensorsolve.html +++ b/dev/reference/linalg_tensorsolve.html @@ -155,7 +155,7 @@

ExamplesA <- A$permute(c(2, 4, 5, 1, 3)) torch_allclose(torch_tensordot(A, X, dims = X$ndim), B, atol = 1e-6) } -#> [1] TRUE +#> [1] FALSE