Converting Keras 1D Convulution to PyTorch

By Henry Leung 10 Oct 2023

Recently I need to convert a model trained with Keras to PyTorch containing 1D convolution layer. Since Keras uses channels last and PyTorch uses channels first, the weight matrix needs to be transposed in a consistent way such that the output of the two models are the same after flattening. We can do a simple test to make sure we know how to convert the weight matrix. Here we will create the same model in Keras and PyTorch first and get the weight matrix from the Keras model and transpose it to PyTorch format,

Blogging with Hugo

By Henry Leung 01 Jan 2023

Introduction I was looking into how blogging is done with Github Page with Jekyll and come across a nice one developed by https://gaohaoyang.github.io/ and https://tomoya92.github.io/ which this blog is based on. While making new post which is written in markdown is straight-forward, local development such as testing after you modified the code is not easy. Mainly due to Jekyll requires Ruby which requires MSYS2 which personally dislike. So I use Windows Subsystem for Linux (WSL) which is already installed on my Windows to do the job.

Blogging with Jekyll and Developing it on Windows

By Henry Leung 10 Oct 2019

Introduction I was looking into how blogging is done with Github Page with Jekyll and come across a nice one developed by https://gaohaoyang.github.io/ and https://tomoya92.github.io/ which this blog is based on. While making new post which is written in markdown is straight-forward, local development such as testing after you modified the code is not easy. Mainly due to Jekyll requires Ruby which requires MSYS2 which personally dislike. So I use Windows Subsystem for Linux (WSL) which is already installed on my Windows to do the job.

You're up and running!

By Henry Leung 03 Mar 2014

test testing testing Next you can update your site name, avatar and other options using the _config.yml file in the root of your repository (shown below). ![_config.yml]({{ site.baseurl }}/images/config.png) The easiest way to make your first post is to edit this one. Go into /_posts/ and update the Hello World markdown file. For more instructions head over to the Jekyll Now repository on GitHub.