原创 C++逐字讀字符串裏面的字(中英文)

#include <iostream> #include <string> #include <assert.h> #include <vector> std::vector <std::string> read_utf8_oneb

原创 [leetcode]971. Flip Binary Tree To Match Preorder Traversal

Flip Binary Tree To Match Preorder Traversal 這是一個結合了先序遍歷和對邊界檢查的題。剛開始理不太清楚,我就簡單畫了一下幾種情況的圖。 所有情況如下: 當前結點被訪問過 當前結點是葉結

原创 [leetcode] 959. Regions Cut by Slashes

Regions Cut by Slashes 在上週的 leetcode 周競賽中,我用迭代的方法解決這個題,卻超時了。 賽後,我看了別人的方法,思路基本一樣。只不過別人用的遞歸。 開始我還以爲是兩種實現方式有什麼差異。後面分析一下才

原创 Python 的 class 對象可以添加私有屬性

我在使用結點的時候,給一個成員函數賦值。然而我拼寫錯了,程序也沒有報錯。 https://docs.python.org/2/tutorial/classes.html#odds-and-ends https://rosettacod

原创 [leetcode]159. Longest Substring with At Most Two Distinct Characters

159. Longest Substring with At Most Two Distinct Characters. 1 暴力法 Time Limit Exceeded class Solution(object):

原创 [leetcode]138. Copy List with Random Pointer

138. Copy List with Random Pointer 方法一 Complexity O(n), Space O(n) 做一箇舊結點和新結點的映射,再連接 random 指向的舊結點的映射結點 # Definition

原创 [Leetcode] 406. Queue Reconstruction by Height 直覺解釋

https://leetcode.com/problems/queue-reconstruction-by-height/ 首先,我們找到最小的 height (h, k),這個數據對的最終位置應該是在 k + 1 的位置上。因爲這個

原创 在 docker 中運行 jupyter,並在本機上打開網頁

在 docker 中運行 jupyter,並在本機上打開網頁 docker run docker run -it -p 7000:7000 --rm --name test docker_image_id docker 啓動

原创 caffe 中添加新的 layer 和相應測試的過程

添加新 layer 添加一個簡單的 layer 可以參考 https://github.com/BVLC/caffe/wiki/Simple-Example:-Sin-Layer 。 幾個主要的過程如下: 添加 include/ca

原创 Object detection[NMS] 潛在矩形篩選代碼 學習

import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import PatchCollection from matplotlib

原创 Bias and Variance

Questions biase 是在設置初始參數的時候造成的吧,如果初始參數設置的好,就不應該存在這個問題了。 過擬合的時候,有幾種方法 導致過擬合的原因有哪些 結構 討論 bias 與 variance 的時候,模型的複雜度

原创 polymorphism.md

C++ 多態(Polymorphsim) 多態性是允許你將父對象設置成爲和一個或更多的他的子對象相等的技術,賦值之後,父對象就可以根據當前賦值給它的子對象的特性以不同的方式運作。簡單的說:允許將子類類型的指針賦值給父類類型的指針(一個

原创 tep 3 of Backpropagation the size of z2 and Theta2'*delta3 are not equal.

https://www.coursera.org/learn/machine-learning/programming/AiHgN/neural-network-learning/discussions/threads/EObmU4L

原创 !! Submission failed: operator *: nonconformant arguments (op1 is 1x10, op2 is 4x1) Andrew 機器學習 第五週

!! Submission failed: operator *: nonconformant arguments (op1 is 1x10, op2 is 4x1) 這個是因爲我在寫矩陣大小的時候寫了一個固定的 size 導致:可以

原创 pyspark.sql.Row 使用 dictionary 初始化的方法 “TypeError: sequence item 0: expected string, dict found”

from pyspark.sql import Row row_dict = {'C0': -1.1990072635132698, 'C3': 0.12605772684660232,