This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %ref: | |
| %https://tex.stackexchange.com/questions/516073/how-to-draw-3d-matrix-using-tikz | |
| %https://tikz.net/tikz-table/ | |
| %https://tikz.net/conv2d/ | |
| % | |
| \documentclass[tikz,border=10pt]{standalone} | |
| \usetikzlibrary{matrix,positioning} | |
| \begin{document} | |
| \tikzset{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %ref: | |
| %https://tex.stackexchange.com/questions/516073/how-to-draw-3d-matrix-using-tikz | |
| %https://tikz.net/tikz-table/ | |
| % | |
| \documentclass[tikz,border=10pt]{standalone} | |
| \usetikzlibrary{matrix,positioning} | |
| \begin{document} | |
| \tikzset{ | |
| table/.style={ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ref: | |
| #Jan Laukemann et al. (2025) Accelerating Sparse Tensor Decomposition Using Adaptive Linearized Representation | |
| #https://arxiv.org/abs/2403.06348 | |
| ALTO_indexing <- function(object, data = environment(object), ...) { | |
| mf <- model.frame(object, data, ...) | |
| t <- if (missing(data)) terms(object) else terms(object, data = data) | |
| labs <- attr(t, "term.labels") | |
| mf <- lapply(labs, function(x) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(moltenNMF) | |
| library(Matrix) | |
| df = expand.grid(letters[1:2], LETTERS[1:2]) | |
| X = sparse_onehot(~., data = df) | |
| A = matrix( | |
| c(0.5, 0.5, 0.5, 0.5, 0, 1, 0, 0, 0, 0, 0, 1), | |
| nrow = 4, | |
| ncol = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ref: | |
| #Jan Laukemann et al. (2025) Accelerating Sparse Tensor Decomposition Using Adaptive Linearized Representation | |
| #https://arxiv.org/abs/2403.06348 | |
| library(dplyr) | |
| ALTO_indexing <- function(object, data = environment(object), ...) { | |
| mf <- model.frame(object, data, ...) | |
| t <- if (missing(data)) terms(object) else terms(object, data = data) | |
| labs <- attr(t, "term.labels") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(ggplot2) | |
| library(dplyr) | |
| library(tidyr) | |
| library(rvest) | |
| library(readr) | |
| url = "https://ja.wikipedia.org/wiki/2015年韓国におけるMERSの流行" | |
| taball <- read_html(url) |> | |
| html_table() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(moltenNMF) | |
| library(Matrix) | |
| df = expand.grid(letters[1:2], LETTERS[1:2]) | |
| X = sparse_onehot(~. , data = df) | |
| A=matrix(c(0.5,0.5,0.5,0.5, | |
| 0,1,0,0, | |
| 0,0,0,1), 4,3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module VI | |
| using LogExpFunctions | |
| using SparseArrays | |
| using SpecialFunctions | |
| using Distributions | |
| # A = sparse([1, 1, 2, 3], [1, 3, 2, 3], [0, 1, 2, 0]) | |
| # A.m # Number of rows | |
| # A.n # Number of columns |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(dplyr) | |
| library(gt) | |
| doors = LETTERS[1:3] | |
| policy1 = 0L | |
| policy2 = 0L | |
| iter = 100000 | |
| res_raw = matrix(NA_character_, iter, 4) | |
| set.seed(1124) | |
| system.time({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ut <- function(x,alpha,beta,lambda){ | |
| ifelse(x>0, x^alpha, -lambda*((-x)^beta)) | |
| } | |
| params <- list( | |
| list(alpha=1,beta=1,lambda=1), | |
| list(alpha=1,beta=1,lambda=2), | |
| list(alpha=1/2,beta=1/2,lambda=2), | |
| list(alpha=2,beta=2,lambda=1) | |
| ) |
NewerOlder