python

Simple image classification using TensorFlow and CIFAR-10

Almost one year after following cs231n online and doing the assignments, I met the CIFAR-10 dataset again. This time, instead of implementing my Convolutional Neural Network from scratch using numpy, I had to implement mine using TensorFlow, as part of one of the Deep Learning Nano Degree assignments. As an aside, since this course uses some content from the free Deep Learning course, they took the time to fix the sub par presentation of that course.

Implementing a reader-writer lock for multiple processes in python

Python lacks a lock type that supports multiple readers and a single writer across multiple processes. Here we investigate how one can be implemented using only default python features: ctypes and mmap, and the POSIX reader-writer locks. TL;DR: If you just want to use it, refer to the module's repository. Introduction I had a setting similar to the figure below. A single Python process would start up and spawn N children that would receive requests from the network.