What I Learned from Stanford XCS236: Deep Generative Models

My key takeaways from Stanford XCS236, from likelihood-based modeling to diffusion and model tradeoffs in practice.

2026-02-19 · #Technology

Accelerated Raytracing Kernel in Python

I did some experimental work in April, where I build bindings for Nvidia's raytracing engine PyOptiX to support writing device kernel in python. Original post: https://developer.nvidia.com/b...

2022-11-01 · #Technology

Fast Point in Polygon (PiP) Primitive

Point in polygon test is one of the most fundamental building block in ray tracing. Given a point on a surface and a vertices array representing a polygon, is the point in the polygon? It al...

2022-10-28 · #Technology

PL:Types intro

This is a series of notes taken from the . Types are essential components of a programming language. From practicality, types separates the definition of different categories of data within...

2021-03-20 · #Technology

PL:HoF and Closure Idioms

This is a series of notes taken from the . From our of higher order functions, functions can be evaluated, stored and passed as arguments just as other variables. Storing a function (closure...

2021-01-03 · #Technology

PL:Higher-order functions and closures

This is a series of notes taken from the by professor Dan Grossman. In this note and next one, I will discuss higher-order functions and their applications. One key feature that distincts fu...

2021-01-02 · #Technology

Pointer Generator Network

This article introduces the Pointer Generator Network and Coverage Mechanism. After the seminal paper from Sutzkever in 2014 and Bahdanau in 2015, before Transformer shook the ground in 2017...

2020-04-23 · #Technology

Fairseq Distributed Training Notes

Fairseq distributed training is largely built on top of the distributed training feature provided by . A couple important notes from their tutorial that will be useful: 1. The example provid...

2020-03-19 · #Technology

Fairseq Transformer, BART (II)

This is a 2 part tutorial for the Fairseq model BART. In the first part I have walked through the details how a Transformer model is built. Please refer to . A BART class is, in essence, a F...

2020-03-19 · #Technology

Fairseq Transformer, BART

BART is a novel denoising autoencoder that achieved excellent result on Summarization. It is proposed by FAIR and a great implementation is included in its production grade seq2seq framework...

2020-03-15 · #Technology

4 Implementation Details of Tiger Type Checker

So I wrapped my Tiger type checker assignment. It's 973 lines of code as of first submission. And it's not even styled in the most readable way. But anyway, I hope only minor modification is...

2020-03-01 · #Technology

How TFDS build a dataset - A Survey Study Using XSUM as an Example

Tensorflow Dataset defines a unified wrapper for all kinds of dataset handling. Traditionally, to process a dataset, one needs to download a dataset, process them into the type that works fo...

2020-02-24 · #Technology

Cancer Survival Rate Visualization

This is a project I worked for CPSC 546 - Data and Information Visualization. It presents the 5 to 20-year survival rate for different type of cancer. Best view in laptop with Chrome browser...

2019-10-21 · #Technology

Leetcode Summary

Data Structures: 78 Subset(Also Bitset) 94 Binary Tree Inorder Traversal (Inorder Tree Traversal Iterative Approach) 98 Validate Binary Tree 102 Level Order Traversal 114 Binary Tree To Link...

2019-07-02 · #Technology

309: Best Time to Buy and Sell Stock with Cooldown

Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie,...

2019-05-18 · #Technology

279: Perfect Squares

Given a natural number n, find the minimum number of perfect square numbers that sums up to n. ex1: 12 = 4 + 4 + 4 ans: 3 ex2: 13 = 9 + 4 ans: 2 We call the result . Naive (BST): For a numbe...

2019-05-17 · #Technology

Android Inject Events

出于安全考虑,安卓禁止开发者进行事件注入。仅有系统级权限的应用才可以进行事件注入。 获得系统级权限的方法有两个: 1. root手机 2. 对应用进行签名 root手机 Disclaimer: root会给手机带来极大风险,请责任自负。 Root之后可以给应用执行SU命令,可以实现一些按钮,屏幕滑动等事件的注入。但是想要完全绕开 INJECT EVENT权限的限制还是需要进行签...

2019-03-12 · #Technology

Camera2Basic 例程(II)

初始化设置流程 首先从CameraActivity开始, 方法设置了 作为view,如果初始化状态为null,新建 实例。 继承 ,用来显示预览。处理相机服务相关的大部分方法也都定义在这里面。UI生命周期行为: |生命周期|行为| |--|--| | |用 layout去初始化view| | |为两个Button设置 ,记录texture的handle,注意这里的texture...

2019-02-25 · #Technology

Camera2Basic 例程(I)

感觉Android例程不是很友好= =(与AVCam相比缺少一篇完整的文章解释) 截图 {: height="400px"} 拍摄管道(概览) 按下"Picture"之后发生了什么? 首先调用 方法,这里调用了 。显然,是要去拍照。 只有一行,调用了 。拍摄前,需要锁定对焦。 首先要求对焦锁定: 自动对焦状态: 有以下几个状态: , , , 。不管在哪个状态下,只要接受了 命令...

2019-02-25 · #Technology

Camera2 API Introduction

自Android SDK 21以来,Camera2 API成为了新的相机接口。与以前的接口相比,Camera2API提供了完整的摄影流水线自定义的方案,并且可以对设备进行参数级,图像进行像素级的调整。本文翻译自 。 包提供了一个对单独相机设备控制的接口,取代了旧的 类。 这个包将相机设备定义为一个流水线。该流水线取一个拍摄请求作为输入,根据请求拍摄单帧,之后输出一组拍摄元数据和...

2019-02-24 · #Technology

Tensorflow on Ubuntu 18

Installation of Tensorflow-GPU on Ubuntu 18 System Initial Setup: 1. Install with Ubuntu 18.04.2 LTS with minumum setup. 2. Use "Software & Updates" - Additional Drivers to install nvidia-dr...

2019-02-23 · #Technology

IOS 文件系统

本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. IOS File System iOS 10.3以后使用APFS文件系统。 沙盒模式 iOS上的文件系统结构是为了让每个App独立运行而设计的。沙盒文件夹(Sandbox)是App的活动边界,其下分多个容器文件夹(Container): - Bundle Container 存放程序包 - Data Cont...

2019-02-10 · #Technology

IOS RAW图像获取

RAW 图像获取是ios8加入的新功能,为ios相机服务加入了类似DSLR的RAW格式文件存储。并添加了手动控制快门的功能。 本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. RAW Photo Capture in IOS 总体上,RAW图像获取的工作流与正常图像获取的没有太大区别。仅需修改AVCapturePhotoSettings的初始化代码即可。 R...

2019-02-10 · #Technology

AVCam 例程解读(IV)

AVCam 是苹果公司为AVFoundation开发者准备的教学例程。该例程构建了一个最基本的ios摄影应用, 调用了大量AVFoundation的基本接口,考量了诸多使用AVFoundation可能出现的异常情况并展示了其处理方式, 同时说明了苹果公司在设计该API时背后的逻辑。本文大量参考 . 本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. AVCam...

2019-02-06 · #Technology

AVCam 例程解读(III)

AVCam 是苹果公司为AVFoundation开发者准备的教学例程。该例程构建了一个最基本的ios摄影应用, 调用了大量AVFoundation的基本接口,考量了诸多使用AVFoundation可能出现的异常情况并展示了其处理方式, 同时说明了苹果公司在设计该API时背后的逻辑。本文大量参考 . 本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. AVCam...

2019-02-05 · #Technology

KVO With Swift

观察者模式是重要的代码设计模式,极大地推进了逻辑分离。早在objc时代苹果公司已经通过Key-Value Observing加以实现,swift中Apple进一步将代码简化,变得非常易用。本文借用 中的代码进行分析。 本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. Key-Value Observing with Swift KVO方法中一定有(一个或多个...

2019-02-05 · #Technology

AVCam 例程解读(II)

AVCam 是苹果公司为AVFoundation开发者准备的教学例程。该例程构建了一个最基本的ios摄影应用, 调用了大量AVFoundation的基本接口,考量了诸多使用AVFoundation可能出现的异常情况并展示了其处理方式, 同时说明了苹果公司在设计该API时背后的逻辑。本文大量参考 . 本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. AVCam...

2019-02-05 · #Technology

AVCam 例程解读(I)

AVCam 是苹果公司为AVFoundation开发者准备的教学例程。该例程构建了一个最基本的ios摄影应用, 调用了大量AVFoundation的基本接口,考量了诸多使用AVFoundation可能出现的异常情况并展示了其处理方式, 同时说明了苹果公司在设计该API时背后的逻辑。本文大量参考 . 本文使用到的来自Apple的代码,文本以及图片,版权属于Apple. AVCam...

2019-02-04 · #Technology

IOS Camera Note (III)

Camera Session Setup Target: - Setup a camera session that has 1 input from camera device, 1 output to photo file. - Configure session profile as photo . - Connect session data flow to a pre...

2019-02-03 · #Technology

IOS Camera Note (I)

Camera Overview - Session - Connects one or more inputs to one or more outputs. - Inputs - Source of media. Camera, microphone, ... - Outputs - Consumer of media. Movie file object, frame bu...

2019-01-19 · #Technology

IOS Camera Note (II)

Camera Authorization 1. Add (Privacy-Camera Usage Description) key in info.plist to describe the need for using camera. 2. Test authorization before each camera setup. 1. Test , four results...

2019-01-19 · #Technology