DeepMind UCL Deep Learning Online Course 2 Summary

History The original idea of developing neural networks came from the human study of the brain, which has a large number of biological neurons, as shown in the figure above. In the biological neuron model, electrical signals flow through the dendrite into the cell body, which is equivalent to a data processing center, and when there is enough stimulus response, it sends a weak electrical signal to the cable-like axon, which flows through the axon and then reaches the synaptic terminals. terminals), a neuron will have multiple dendrites and a single axon, and the signaling between neurons and neurons is accomplished through a conductive fluid in the synaptic gap. By modeling the biological neuron, an artificial neuron is obtained, and the four elements to build the corresponding model are as follows. ...

June 9, 2020 · 6 min · alexchen

DeepMind UCL Deep Learning Online Course 1 Summary

Intro to Machine Learning & AI course address Course content: Solving intelligence Alpha Go & Alpha Zero Learning to play capture the flag Folding protein with AlphaFold Overview of lecture series Regarding the understanding of intelligence, there is a formula mentioned in the course The source of the formula is from the paper A Definition of Machine Intelligence Alpha Go and Alpha Zero use reinforcement learning to train themselves. An untrained neural network plays with itself to determine processing and adjust for errors, and then adjusts its own parameters to win more rewards through constant self-play. ...

June 5, 2020 · 2 min · alexchen

RaspberryPis Tensorflow 分布式训练1

为什么 目前自己采购了35块树莓派4core4G用来计算Rosetta@home,等到COVID-2019过去之后,会用这些开发板测试TF项目,因为TF的生态链齐全,所以在工业上会考虑使用TF来做为最终的产品技术使用方案。 未来的趋势会面向边缘计算领域,像自动驾驶,智能家居,家庭医疗辅助系统,农业生产,制造业零部件质量检测,工业机械磨损检测等等,都会考虑到数据的实时接受和传输,还有计算成本,在机器学习上,如果依靠云计算平台,去辅助上述这些项目,那么就需要考虑本地到服务中心的网络,带宽延迟,数据安全性,计算实时性的问题。如果依托边缘计算,采用工业的微控制器,在微控制器上部署模型以及Tensorflow Lite用于模型的推演,在本地解决计算高可用问题,无需将数据传递到公网上,减少带宽的消耗,从而降低计算成本。 Tensorflow aarch64 源码构建 安装依赖 apt-get install libatlas3-base libopenblas-dev libopenblas-base libblas-dev gcc gfortran python3-dev libgfortran5 g++ libhdf5-dev libfreetype-dev build-essential openjdk-11-jdk zip unzip python3-h5py python3-numpy python3-pip sudo pip3 install keras_preprocessing keras_applications 安装 Bazel install-compile-bootstrap-unix bazel 官方未给出arm64架构的二进制文件,所以需要自己手工编译 下载 bazel-2.0.0-dist.zip 运行 EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh 拷贝 output/bazel 到 /usr/local/bin/hazel 编译 Tensorflow Raspberry pi 4B 上安装的系统是Ubuntu 20.04 ARM64架构,Python Version: 3.8,Tensorflow官方未给出对应版本的python whl安装包,所以需要自己手动从源码构建 git clone https://github.com/tensorflow/tensorflow.git git checkout v2.2.0 ./configure 配置选项 编译操作之前需要增加swap分区,4G系统内存编译是完全不够的,建议swap设置6G 最好能够单独增加一块USB3转SATA的移动硬盘用来单独增加SWAP分区 fallocate -l 6G /swapfile chmod 0600 /swapfile mkswap /swapfile swapon /swapfile 执行编译操作 bazel build --config=noaws --config=nogcp --config=nohdfs --config=nonccl --config=monolithic --config=v2 --local_cpu_resources=3 //tensorflow/tools/pip_package:build_pip_package 由于是直接在4核4G的Raspberry pi 上构建,所以需要耐心等待,编译时间大概在 15 - 25 小时之间 ☕️☕️☕️ 编译完成之后执行构建pip安装包 bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg tensorflow-2.2.0-cp38-cp38-linux_aarch64.whl 安装包构建完成 最后执行 pip install tensorflow-2.2.0-cp38-cp38-linux_aarch64.whl TF 测试 使用官方的最简MNIST教程中的代码 ...

June 3, 2020 · 5 min · alexchen

认识 Goold Coral Dev Board

参考文档: Coral Dev Board 硬件配置与布局 Edge TPU SOM Quad Core ARM Cortex A53 Google Edge TPU ML accelerator 8GB eMMC 1GB LPDDR4 OS Mendel Linux Video 39Pin MIPI DSI Display 24Pin MIPI CSI-2 Camera VPU (Video Processing Unit) 4K p60 H.265 decoder 4K p60 && 4K p30 AVC/H.264 decoder 1080 p60 MPEG-2, MPEG-4p2, VC-1, VP8, RV9, AVS, MJPEG, H.263 decoder 图片取自Coral官网 GPIO 布局 文档 原型设计和工业生产环境 Coral的产品线 原型设计: CoralDev Board 开发板 ...

May 31, 2020 · 1 min · alexchen

Mathemtica Machine Learning Convolutional Neural Networks(1)

Convolutional neural networks About convolution can be abstracted into mathematical expressions: I can represent the matrix of an image, K is the convolution kernel The computational layer of the convolution Object Recogition with Gradient-Based Learning input layer Input Layer Convolution Layer Conv Layer Restricted Layer RELU Layer pooling layer Pooling Layer full connected layer Creating a network Basic learning to distinguish between dogs and cats (* Create model *) myCatDogModel = NetChain[{ ConvolutionLayer[32, 3], Ramp, PoolingLayer[2, 2], ConvolutionLayer[64, 3], Ramp, PoolingLayer[2, 2], FlattenLayer[], 128, Ramp, 2, SoftmaxLayer[]}, "Input" -> NetEncoder[{"Image", {224, 224}, ColorSpace -> "RGB"}] , "Output" -> NetDecoder[{"Class", {"cat", "dog"}}]] (* Collect samples, training set and test set *) (* Convert data sets to Association format *) dataSetsConvert[dateSets_] := Module[ {}, File[#] -> StringSplit[FileBaseName[#], "."] [[1]] & /@ dateSets] traingDataFiles = RandomSample[dataSetsConvert[traingData]]; testDataFiles = RandomSample[dataSetsConvert[testData]]; SetDirectory[ "/Users/alexchen/datasets/Convolutional_Neural_Networks/dataset"]; FileNames["*.jpg", "training_set/cats/"]; FileNames["*.jpg", "training_set/dogs/"]; traingData = Join[FileNames["*.jpg", "training_set/cats/"], FileNames["*.jpg", "training_set/dogs/"]]; testData = Join[FileNames["*.jpg", "test_set/cats"], FileNames["*.jpg", "test_set/dogs"]]; (* Generate training and validation sets *) traingDataFiles = RandomSample[dataSetsConvert[traingData]]; testDataFiles = RandomSample[dataSetsConvert[testData]]; (* sample is randomly selected for display *) RandomSample[traingDataFiles, 5] (* train the model *) mytrainedModel = NetTrain[catdogModel, traingDataFiles, All, ValidationSet -> testDataFiles, MaxTrainingRounds -> 20] (* Generate training model evaluation report *) myModelPlot = mytrainedModel["FinalPlots"] (* Generate the trained model to calculate the model correctness *) myTrainedNet = mytrainedModel["TrainedNet"] ClassifierMeasurements[myTrainedNet, testDataFiles, "Accuracy"] ...

May 22, 2020 · 8 min · alexchen