tests/testthat/test-activation_curve.R

test_that("activation_curve works", {
  expect_equal(activation_curve(expr = "sigmoid"), c( "% To make the code work in any 'LaTeX' editor, users need to install and import two 'TeX' packages in the setting, including 'TikZ'. ",
                                                      "% Users are recommended to try the output 'LaTeX' code in Overleaf. ",
                                                      " ",
                                                      "\\usepackage{tikz} ",
                                                      "\\usepackage{pgfplots} ",
                                                      "\\pgfplotsset{compat=1.18} ",
                                                      "\\begin{figure}[!ht] ",
                                                      "\\centering ",
                                                      "\\begin{tikzpicture}[scale=1] ",
                                                      "  \\begin{axis}[ ",
                                                      "      axis on top = true, ",
                                                      "      axis x line = bottom, ",
                                                      "      axis y line = left, ",
                                                      "      xlabel = $$, ",
                                                      "      ylabel = $$, ",
                                                      "      ymin = , ",
                                                      "      ymax =  ",
                                                      "  ] ",
                                                      "  \\addplot[ ",
                                                      "      domain=-10:10, ",
                                                      "      samples=100 ",
                                                      "  ] {1/(1+exp(-x))}; ",
                                                      "  \\end{axis} ",
                                                      "\\end{tikzpicture} ",
                                                      "\\caption{Sigmoid Function} ",
                                                      "\\label{} ",
                                                      "\\end{figure} "                                                                                                                 ))
})

Try the nndiagram package in your browser

Any scripts or data that you put into this service are public.

nndiagram documentation built on April 18, 2023, 5:11 p.m.