Skip to content

Instantly share code, notes, and snippets.

View gyk's full-sized avatar

Yukun Guo gyk

  • Hangzhou, China
  • 14:00 (UTC +08:00)
View GitHub Profile
@gyk
gyk / generateTest.m
Last active August 29, 2015 14:05
Compute histogram of shape contexts (assuming that SC has already been calculated). Written for the stupid professor, who keeps failing at the FizzBuzz test. It may contain bugs, as most code written for the academic papers is really buggy.
% Generates test data
nPoints = 20;
nBins = 6;
nImages = 72;
shapeContexts = cell(nImages, 1);
for i = 1:nImages
sc = zeros(nPoints, nBins);
for j = 1:nPoints
@gyk
gyk / trySAE.matlab
Created July 17, 2014 06:23
Stacked Denoising Auto-Encoder of DeepLearnToolbox (https://github.com/rasmusbergpalm/DeepLearnToolbox) - a simple example
% Playing with the Stacked Denoising Auto-Encoder in the DeepLearnToolbox
% (https://github.com/rasmusbergpalm/DeepLearnToolbox),
% and trying to use it to extract features.
%% Loads data
load mnist_uint8;
% I don't have much memory
clear test_x test_y
(* ::Package:: *)
heron[side1_,side2_,base_]:=Module[{p,s},(
p=(side1+side2+base)/2;
s=Sqrt[p (p-side1)(p-side2)(p-base)])]
getHeight[side1_,side2_,base_]:=Module[{cos,sin,h},(
cos=(side1*side1+base*base-side2*side2)/(2*side1*base);
sin=Sqrt[1-cos*cos];