This file contains 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
# adapted from | |
# Keras_code_sample_for_Google_IO_2021 | |
# Modern Keras design patterns | Session | |
# https://www.youtube.com/watch?v=FCz9m4T0DI0 | |
# code: https://goo.gle/3t0rSpo | |
# by Martin Gorner, François Chollet | |
using Flux | |
using MLDatasets | |
using Random |
This file contains 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
# 单行注释由「#」号开始 | |
#= 以「#=」开头,用「=#」结尾就可以得到多行注释 | |
多行注释可以嵌套。 | |
=# | |
# VSC 代码高亮 patch' | |
#################################################### | |
## 1. 原始类型与操作符 | |
#################################################### |
This file contains 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
# Generate random matrix with dim = N | |
N <- 3 | |
A <- matrix(runif(N*N), N, N, byrow=TRUE) | |
A <- A+t(A) | |
# Setting up eigenvalues lambda, true eigenvector V and derived eigenvector U | |
ev <- eigen(A) | |
(lambda <- ev$values) | |
(V <- ev$vectors) | |
U <- matrix(0L, N, N) |