QA Official

Netty Getting Started Example (1)

https://qaofficial.com/post/2019/04/03/68728-netty-getting-started-example-1.html 2019-04-03
The following demonstration is a time server. Start Server and Client; in turn;Client reads the time from the server and prints it on the console. ChannelInitializer,ChannelInboundHandlerAdapter Server Provide time service. Listening to 8080 port, the subclass TimeServerHandlerAdapter is an implementation of ChannelInboundHandlerAdapter. By implementing the method channelActive, enter the local time when a new request enters. Catch exceptions by implementing the method exceptionCaught. import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.ByteBuf; import io.

PCA and 2DPCA and 2D-2DPCA Zero Basic Understanding (Part I)

https://qaofficial.com/post/2019/04/03/68758-pca-and-2dpca-and-2d-2dpca-zero-basic-understanding-part-i.html 2019-04-03
First you need to know why PCA is what and why PCA is used.PCA is principal component analysis. For example, for an image, its main part can be used to represent it. This can reduce the difficulty of data processing in image processing, for example, it can reduce the storage capacity of data.Then, what method can reduce the difficulty of data processing? Dimension reduction is a good method, which leads to PCA (principal component analysis, which is the main part obtained through dimension reduction).

PCA implementation

https://qaofficial.com/post/2019/04/03/68768-pca-implementation.html 2019-04-03
Principle: to be added Process: to be supplemented code transferred from: def percentage2n(eigVals,percentage): sortArray=np.sort(eigVals) #升序 sortArray=sortArray[-1::-1] #逆转,即降序 arraySum=sum(sortArray) tmpSum=0 num=0 for i in sortArray: tmpSum+=i num+=1 if tmpSum>=arraySum*percentage: return num import numpy as np def zeroMean(dataMat): meanVal=np.mean(dataMat,axis=0) #按列求均值,即求各个特征的均值 newData=dataMat-meanVal return newData,meanVal def pca(dataMat,n): newData,meanVal=zeroMean(dataMat) covMat=np.cov(newData,rowvar=0) #求

caffe training and BN layer network when loss is 87.3365

https://qaofficial.com/post/2019/04/03/68652-caffe-training-and-bn-layer-network-when-loss-is-87.3365.html 2019-04-03
Detailed Description about BatchNormLayer “Normalizes the input to have 0-mean and/or unit (1) variance across the batch. This layer computes Batch Normalization as described in [1]. For each channel in the data (i.e. axis 1), it subtracts the mean and divides by the variance, where both statistics are computed across both spatial dimensions and across the different examples in the

echo client

https://qaofficial.com/post/2019/04/03/68752-echo-client.html 2019-04-03
Write an echo client What the client has to do is: Connect to ServerSend InformationEach message sent waits for and receives the same message returned from the serverClose connectionImplement Client Logic with ChannelHandler Like the write server, we provide ChannelInboundHandler to process data.In the following example, we use SimpleChannelInboundHandler to handle all tasks, covering three methods: channelActive()-Called after the connection to the server is establishedchannelRead0()-call received from server after dataexceptionCaught()-Called when an exception is caught Listing 2.

import datetime

https://qaofficial.com/post/2019/04/03/68619-import-datetime.html 2019-04-03
datetime is Python's standard library for handling dates and times. Gets the current date and timeLet's first look at how to get the current date and time: >>> from datetime import datetime >>> now = datetime.now() # 获取当前datetime >>> print(now) 2015-05-18 16:28:07.198690 >>> print(type(now)) <class 'datetime.datetime'> Note that datetime is a module, and the datetime module also contains a

netty QuickStart Demo Program

https://qaofficial.com/post/2019/04/03/68750-netty-quickstart-demo-program.html 2019-04-03
From: https://blog.csdn.net/the_fool_/article/details/80611148  many excerpts or hand-typing, in order to score ten points, the cheek is marked as original, ashamed and ashamed ~ this article is used to build a simple netty for quick start. application, if you want to know more about the system, please refer to my next blog, link:  Reference Address: Official Document: http://netty.io/wiki/user-guide-for-4.x.html copy part: Baidu Encyclopedia: https://baike.baidu.com/item/Netty/10061624?fr=aladdin NIO: https://blog.csdn.net/skiof007/article/details/52873421 Code Part: https://blog.

netty QuickStart Instance

https://qaofficial.com/post/2019/04/03/68741-netty-quickstart-instance.html 2019-04-03
In fact, I've watched netty for a long time, and I've also watched IO/NIO for a long time. I've been familiar with netty development since I just opened it. I'm full of bitterness.This time, I'll give you a demo, which can be run in the project. I'll give you a detailed introduction about netty and update it after studying. The effect of this demo is to run the server first

netty3 entry case

https://qaofficial.com/post/2019/04/03/68731-netty3-entry-case.html 2019-04-03
Netty is a network application framework that provides asynchronous event driving to rapidly develop high performance and high reliability network server and client programs.In other words, it is a NIO framework, which can be used to develop network applications simply and quickly.Netty greatly simplifies the development process of network programs such as Socket development of TCP and UDP.Before learning netty, you need to have a thorough understanding of NIO. Please

vgg16 neural network reuse

https://qaofficial.com/post/2019/04/03/68705-vgg16-neural-network-reuse.html 2019-04-03
Load vgg16 data to reproduce neural network #!/usr/bin/python #coding:utf-8 import inspect import os import numpy as np import tensorflow as tf import time import matplotlib.pyplot as plt VGG_MEAN = [103.939, 116.779, 123.68] # 图像的平均像素值 class Vgg16(): def __init__(self, vgg16_path=None): if vgg16_path is None: vgg16_path = os.path.join(os.getcwd(), "vgg16.npy") # os函数拼接路径 self.data_dict = np.load(vgg16_path, encoding='latin1').item() # 读取