Neural Network Backpropagation Derivation

I have spent a few days hand-rolling neural networks such as CNN and RNN. This post shows my notes of neural network backpropagation derivation. The derivation of Backpropagation is one of the most complicated algorithms in machine learning. There are many resources for understanding how to compute gradients using backpropagation. But in my opinion, most … Read more

LeetCode – Design Twitter (Java)

Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the user’s news feed. Your design should support the following methods: postTweet(userId, tweetId): Compose a new tweet. getNewsFeed(userId): Retrieve the 10 most recent tweet ids in the user’s news feed. … Read more

Java Runtime.exec() Linux Pipe

If you want to utilize Linux pipe advantages, you can do it in Java. You may want to do the following, which is wrong. String cmd = "ls" Process p = Runtime.getRuntime().exec(cmd);String cmd = "ls" Process p = Runtime.getRuntime().exec(cmd); The correct way of executing shell command is the following: String[] cmd = { "/bin/sh", "-c", … Read more

Blocking, nonblocking, asynchronous, buffered, unbuffered, double buffered, programmed I/O, DMA

Here are all I/O related concepts. Blocking I/O: process is blocked until all bytes are ready. Non-blocking I/O: the OS only reads or writes as many bytes as is possible without blocking the process. Asynchronous I/O: similar to non-blocking I/O. The I/O call returns immediately, without waiting for the operation to complete. I/O subsystem signals … Read more