Chuan Lu (@orcuslc)

无欲则刚

Follow me on GitHub

Backpropagation of Batch Normalization

|

LeetCode Weekly Contest Results

|

Code: GitHub

52: 2017-09-30: Rank 681/2615, 8 points;

  1. (686. Repeated String Match ): 0:54:04, 2 error;
  2. (687. Longest Univalue Path ): 1:19:55, 3 error;

Solutions to UVA with C++

|

Code for each problem: GitHub

  • 1225 Digit Counting:
    • Tried to count by each positions, WA for 4 times;
    • By checking tables, AC, RT: 0.000;
    • By counting each positions, AC, RT: 0.000
    • WA4, AC2
  • 1586 Molar mass:
    • AC, RT: 0.000
    • CE, AC
  • 1585 Score:
    • AC, RT: 0.000
    • RE, TLE, WA, AC
  • 455 Periodic Strings:
    • AC, RT: 0.000
    • WA4, PE2, AC

Optimization in Numerical Algorithms, A Simulated Annealing example

|

I was asked to help accelerate a classmate’s code of Simulated Annealing. In his code, the likelihood function is at first as follows:

def intensity(miu, alpha, beta, t, N):
	return sum(alpha*np.exp(-beta*(range(t-1, 0, -1)))*N[0:t-1])+miu

def likelihood(miu, alpha, beta, T, N, n):
	N = np.array(N)
	n = np.array(N)
	L1 = np.array([intensity(miu, alpha, beta, i+1, N) for i in range(T)])
	L = sum(np.log(L1)*n[0:T])-sum(L1)

Solutions to LeetCode with C++

|

Code for each problem: GitHub

  • (1) Two sum: Quicksort+Binary Search, Beat 100% cpp submissions;
  • (542) 01 Matrix: BFS using queue; Beat 60.72% cpp submissions;
  • (2) Add two numbers: save the result in the long linked list; Beat 78.48% cpp submissions;
  • (413) Arithmetic Slices: Dynamic Programming; Beat 15.54% cpp submissions;
  • (445) Use stacks to simulate the reversing of linked lists; Beat 20.60% cpp submissions;(测试了vector的表现, Beat 17.08% cpp submissions).