原创 DBSCAN源碼分析

% % Copyright (c) 2015, Yarpiz (www.yarpiz.com) % All rights reserved. Please read the "license.txt" for license terms

原创 二叉樹重建(C++/Python)

問題: 輸入某二叉樹的前序遍歷和中序遍歷的結果,請重建出該二叉樹。假設輸入的前序遍歷和中序遍歷的結果中都不含重複的數字。例如輸入前序遍歷序列{1,2,4,7,3,5,6,8}和中序遍歷序列{4,7,2,1,5,3,8,6},則重建二叉樹並

原创 《一一》影評:年華一幀一幀地逝去

  有一幅很著名的畫:太陽在海平面之上,陽光灑下整片海,沙灘上有幾個人正朝着太陽的方向仰望,你認爲是日出還是日落?據說看到日出的人充滿朝氣,是樂觀主義者;看到日落的人暮氣沉沉,是悲觀主義者。某天有人問我,你看到的是日出還是日落?雖然我知道

原创 《死亡詩社》經典臺詞欣賞(轉)

一、及時行樂,讓你的生命超越凡俗  《船長,我的船長》Oh ,captain ,my captain!  《勸少年們珍惜時光》及時採擷你的花蕾/舊時光一去不回/今天尚在微笑的花朵/明天變得風中枯萎(丁尼生)Gather ye rosebu

原创 快速理解EM算法

原文鏈接: https://www.jianshu.com/p/1121509ac1dc 如果使用基於最大似然估計的模型,模型中存在隱變量,就要用EM算法做參數估計。個人認爲,理解EM算法背後的idea,遠比看懂它的數學推導重要。ide

原创 Adaboost原理及例子

Adaboost是一種迭代算法,其核心思想是針對同一個訓練集訓練不同的分類器(弱分類器),然後把這些弱分類器集合起來,構成一個更強的最終分類器(強分類器)。Adaboost是一種boosting提升方法,類似於將多個分類器串聯在一起,組合

原创 LeetCode題解226-Invert Binary Tree(C++)

題目:Invert a binary tree.Example:Input: 4 / \ 2 7 / \ / \ 1 3 6 9Output: 4 / \ 7 2

原创 LeetCode題解221— Maximal Square(C++)

題目:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.Ex

原创 吳恩達 DeepLearning《神經網絡與深度學習》之《神經網絡基礎》作業2

# -*- coding: utf-8 -*- """ Created on Thu Jul 5 10:17:56 2018 @author: Yuki """ import numpy as np import matplotli

原创 LeetCode題解287- Find the Duplicate Number(C++)

題目:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least

原创 LeetCode題解160-Intersection of Two Linked Lists(C++)

題目:Write a program to find the node at which the intersection of two singly linked lists begins.For example, the follow

原创 LeetCode題解-144. Binary Tree Preorder Traversal(二叉樹的非遞歸前序遍歷)

題目:Given a binary tree, return the preorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \

原创 python實現中文分詞和詞頻統計

python2.7中實現中文分詞,是引入了jieba中文分詞庫。再進行簡單的詞頻統計。 import sys reload(sys) sys.setdefaultencoding('utf-8') import

原创 BP神經網絡算法推導(包含輸出層和隱層)

你是否也有疑問,在神經網絡的訓練過程中,隨着多樣本的訓練,我們的參數是如何進行調節的呢?答案自然就是BP算法(Error Back Propagation)。反向傳播時,將輸出誤差(期望輸出與實際輸出之差)按原通路反傳計算,通過隱層反向,