Skip to content

Instantly share code, notes, and snippets.

View beader's full-sized avatar
🏠
Working from home

beader beader

🏠
Working from home
  • 上海
View GitHub Profile
@beader
beader / DESCRIPTION
Last active August 6, 2020 02:21
ShinyApp - Dynamically Add/Remove UI Elements
Title: Dynamically Remove UI Elements
Author: beader.chen@gmail.com
DisplayMode: Showcase
Type: Shiny
@beader
beader / conv2libsvm
Last active January 24, 2017 20:50
Convert a dgcMatrix to libsvm format
#' convert a dgcMatrix to libsvm format
#' @param sm A sparse matrix of class "dgcMatrix"
#' @param label label for dataset, default is 0
#' @return a vector of characters containing index:value
#' @example
#' regMat <- matrix(runif(16), 4, 4)
#' regMat[sample(16, 5)] <- 0
#' sparseMat <- Matrix(regMat, sparse = T)
#' conv2libsvm(sparseMat)
conv2libsvm <- function(sm, label = rep(0, dim(sm)[1])) {
@beader
beader / id_maker.R
Created December 30, 2015 09:44
simple shiny dashboard
id_maker <- function(prefix = make_random_string()) {
function(id) {
paste(prefix, id, sep = "_")
}
}
make_random_string <- function(n=1, len=12, chars=c(0:9, letters, LETTERS)) {
randomString <- sapply(seq(n), function(i) {
paste(sample(chars, len, replace = TRUE), collapse = "")
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@beader
beader / README.md
Last active December 23, 2016 08:03

bl.ocks.org test

@beader
beader / mnist_cnn.ipynb
Last active December 26, 2017 12:33
Smaller strides with pooling or bigger strides without pooling?
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@beader
beader / mnist_cnn_hidden_layer_feature_representation_visualization.ipynb
Last active January 2, 2018 02:46
visualize the discriminative ability of hidden layers as feature representations of original images
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@beader
beader / hw1.ipynb
Created January 4, 2018 07:39
NTU Machine Learning 2017 Fall - Assignment 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.