Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
knowledge_base:programming:machine_learning [2022/12/02 14:45] – removed - external edit (Unknown date) 127.0.0.1 | knowledge_base:programming:machine_learning [2023/02/18 12:12] (current) – [Useful Resources] Normal User | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Machine Learning ====== | ||
+ | |||
+ | |||
+ | ===== Useful Resources ===== | ||
+ | |||
+ | http:// | ||
+ | https:// | ||
+ | https:// | ||
+ | https:// | ||
+ | [[https:// | ||
+ | |||
+ | References | ||
+ | |||
+ | [1] C.J. Wu et al., Machine Learning at Facebook: Understanding Inference at the Edge [From Facebook]\\ | ||
+ | [2] N.P. Jouppi et. al., In Datacenter Performance Analysis of a Tensor Processing Unit [From Google]\\ | ||
+ | [3] Vivien Sze et. al., Efficient Processing of Deep Neural Networks: A tutorial and survey [From MIT]\\ | ||
+ | [4] Amr Suleiman et. al., Navion: A 2mW Fully Integrated Real-Time Visual-Inertial Odometry Accelerator for Autonomous Navigation of Nano Drones [From MIT] | ||
+ | ====== Handwriting Learning Code Example ====== | ||
+ | |||
+ | ===== Example 1 ===== | ||
+ | |||
+ | < | ||
+ | library(h2o) | ||
+ | h2o.init(nthreads = 6) | ||
+ | h2o.removeAll() | ||
+ | traindat=read.csv(" | ||
+ | traindat[, | ||
+ | traindat[, | ||
+ | par(mfrow = c(10,10), mar = c(0,0,0,0)) | ||
+ | for (i in 1:100) { | ||
+ | y = as.matrix(traindat[i, | ||
+ | dim(y) = c(28,28) | ||
+ | image(y[, | ||
+ | text(0.2, 0, traindat[i, | ||
+ | } | ||
+ | train.h2o = as.h2o(traindat) | ||
+ | nnmodel.h2o = h2o.deeplearning( | ||
+ | x = 2:785, | ||
+ | y = 1, | ||
+ | training_frame = train.h2o, | ||
+ | activation = " | ||
+ | input_dropout_ratio = 0.2, | ||
+ | balance_classes = TRUE, | ||
+ | hidden = c(1024, | ||
+ | l1 = 1e-5, | ||
+ | classification_stop = 0.001, | ||
+ | epochs = 100 | ||
+ | ) | ||
+ | testdat = read.csv(" | ||
+ | testdat = ifelse(testdat> | ||
+ | test.h2o = as.h2o(testdat) | ||
+ | pred.h2o = h2o.predict(nnmodel.h2o, | ||
+ | pred = as.data.frame(pred.h2o) | ||
+ | par(mfrow = c(10,10), mar = c(0,0,0,0)) | ||
+ | for (i in 1:100) { | ||
+ | y = as.matrix(testdat[i, | ||
+ | dim(y) = c(28,28) | ||
+ | image(y[, | ||
+ | text(0.2, 0, pred[i,1], cex = 3, col = 2, pos = c(3,4)) | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Example 2 ===== | ||
+ | < | ||
+ | library(h2o) | ||
+ | h2o.init(nthreads = 6) | ||
+ | h2o.removeAll() | ||
+ | train.h2o = h2o.importFile(" | ||
+ | train.h2o[, | ||
+ | nnmodel.h2o = h2o.deeplearning( | ||
+ | x = 2:785, | ||
+ | y = 1, | ||
+ | training_frame = train.h2o, | ||
+ | activation = " | ||
+ | input_dropout_ratio = 0.2, | ||
+ | balance_classes = TRUE, | ||
+ | hidden = c(1024, | ||
+ | l1 = 1e-5, | ||
+ | classification_stop = 0.001, | ||
+ | epochs = 100 | ||
+ | ) | ||
+ | test.h2o = h2o.importFile(" | ||
+ | pred.h2o = h2o.predict(nnmodel.h2o, | ||
+ | testdat = as.data.frame(test.h2o) | ||
+ | pred = as.data.frame(pred.h2o) | ||
+ | par(mfrow = c(10,10), mar = c(0,0,0,0)) | ||
+ | for (i in 1:100) { | ||
+ | y = as.matrix(testdat[i, | ||
+ | dim(y) = c(28,28) | ||
+ | image(y[, | ||
+ | text(0.2, 0, pred[i,1], cex = 3, col = 2, pos = c(3,4)) | ||
+ | } | ||
+ | </ | ||
+ | |||