This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Simplex Method | |
% /DAA/simplex.m | |
% Solve LP problem using Simplex Method and Bland's Law. | |
% chaonan99(R) | |
% 2016/03/20 | |
% [Note] The input should already have a initial basic feasible solution. | |
% [Thanks to] http://wenku.baidu.com/link?url=bUal8_VtNYHdIXF97JKo_r6vzYt3lGlSFO2W2Wz6wInLnw-3STZpbyxSoaOIu2XKE3z5O4D5xjErH5_tqXY-j3-DubAapkfCuyraVMxMNNO | |
%% code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Two-Stage Method | |
% /DAA/twostage.m | |
% [Function] Solve LP problem using Two-Stage Method and Bland's Law. | |
% [Author] chaonan99(R) | |
% [Last modify] 2016/03/28 | |
% [Contect me] [email protected] | |
% [Note] | |
% 1. There are no examination on input size, which the user should ensure | |
% its correctness. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robo = java.awt.Robot; | |
t = java.awt.Toolkit.getDefaultToolkit(); | |
rectangle = java.awt.Rectangle(t.getScreenSize()); | |
image = robo.createScreenCapture(rectangle); | |
filehandle = java.io.File('capture.png'); | |
javax.imageio.ImageIO.write(image,'png',filehandle); | |
im = imread('capture.png'); | |
imshow(im); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Dual Simplex Method | |
% /DAA/dual_simplex.m | |
% [Description] Solve LP problem using Dual Simplex Method and Bland's Law. | |
% [Author] chaonan99(R) | |
% [Last Modify] 2016/04/03 | |
% [Contact Me] [email protected] | |
% [Note] The input should already have an initial basic solution for the | |
% original problem and a feasible solution for its dual problem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function []=OR_HW1() | |
x=[0,0]; | |
dfx_val = dfx(x); | |
normdfx = norm(dfx_val); | |
k = 0; | |
f_val = zeros(1000,1); | |
while normdfx>1e-6 | |
t = newton(x,-dfx_val); | |
x = x-t*dfx_val; | |
dfx_val = dfx(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function []=bs() | |
x=[0,0]; | |
dfx_val = dfx(x); | |
normdfx = norm(dfx_val); | |
k = 0; | |
f_val = zeros(1000,1); | |
dfx_val_pre = [1,1]; | |
p_pre = [0,0]; | |
while normdfx>1e-10 | |
if mod(k,2) == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# [Description] A script to extract exact number of frames from a sequence video | |
# [Author] chaonan99 | |
# [Date] 2016/07/17/ | |
# [Last Modified] 2016/09/01 | |
# [Email] [email protected] | |
import subprocess as sp | |
import re | |
import optparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import matplotlib | |
import pylab as plt | |
import numpy as np | |
s = open('default.log','r').read() | |
pattern = re.compile(r'iter (\d+): (\d+.\d+)') | |
grou = np.asarray(pattern.findall(s)).astype(np.float32) | |
plt.plot(grou[:,0],grou[:,1]) | |
plt.title('title') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nn' | |
require 'nngraph' | |
local LSTM = {} | |
function LSTM.lstm(input_size, output_size, rnn_size, n, frame_per_video, seq_per_video, dropout) | |
dropout = dropout or 0 | |
-- TODO: No idea how to choose attention size... | |
att_size = att_size or 512 | |
-- there will be 2*n+1 inputs |
OlderNewer