LMJW Blog My notes.
Posts with the tag python:

Intro to deep learning notes

This is a note for MIT 6.S191 course link course 1. Intro to deep learning The Perceptron: Forward Propagation Single layer neural network with tensorflow: from tf.keras.layers import * inputs = Inputs(m) hidden = Dense(d1)(inputs) outputs = Dense(d2)(hidden) model = Model(inputs, outputs) This four lines of code computes the single layer NN. Deep Neural Network More hidden layers Applying Neural Networks Quantifying Loss Compare Predicted loss vs actual loss Minimize loss Different loss functions Binary cross entropy loss loss = tf.reduce_mean( tf.nn.softmax_cross_entropy_with_logits( model.y, model.pred )) Mean squared error loss loss = tf.

A python example of realizing secure grpc communication

A python example of realizing secure grpc communication Useful links and references: Here are some links that I found it can be helpful when I was trying to work out how to setup the python ssl communication. Secure gRPC with TLS/SSL, This is golang implementation certstrap, a convienient tool to generate openssl keys and certificate gRPC authentication, the official guide of grpc grpcio, python package, the source code and official document of grpc python grpc golang ssl example, another golang example of ssl communication What is the difference between .pem , .csr , .key and .crt?, a stackexchange question which explains the concepts and differences of different types of files

python subprocess

Python subprocess examples Description This is a collection of python subprocess examples for easy usage. Although I found the python documents are very comprehensive, I found there is not much examples of showing how to use. This document act as a note of how to use python subprocess package. Environment settings OS Windows 10 home python Anaconda, python 3.6.3 Main functions subprocess.run() the code is executed in IDLE command line window. >>> import subprocess as sb >>> bash_exec = "C:\\Program Files\\Git\\bin\\bash.exe" >>> sb.run([bash_exe, '-c','pwd'], stdout=sb.PIPE) CompletedProcess(args=[‘C:\Program Files\Git\bin\bash.

An experiment using golang and python to execute command in docker

Description:

Using golang to execute python code, which can in turn execute docker command to control docker container.