原创 leetcode Find K Pairs with Smallest Sums

不得不說,用慣了python之後 c++感到非常非常的陌生。打個最大堆居然都會遇到各種bug You are given two integer arrays nums1 and nums2 sorted in ascending

原创 vi/ vim 光標移動命令

移動光標 上:k nk:向上移動n行 9999k或gg可以移到第一行 G移到最後一行 下:j nj:向下移動n行 左:h nh:向左移動n列 右:l nl:向右移動n列 w:光標以單詞向前移動 nw:光標向前移動n個單詞 光標到單詞的第

原创 [LEETCODE] 372. super pow

【LEETCODE】372.super pow Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely l

原创 Leetcode 第 374 題(Guess Number Higher or Lower)

這道題考的是二分查找 要注意如果平均數的取法。如果begin 和 end 相差爲1 的話用avg = (begin + end)/ 2 會死循環。 // Forward declaration of guess API. //

原创 caffe學習系列:繪製網絡模型

Python/draw_net.py, 這個文件,就是用來繪製網絡模型的。也就是將網絡模型由prototxt變成一張圖片。 在繪製之前,需要先安裝兩個庫 1、安裝GraphViz # sudo apt-get install Graph

原创 Caffe學習系列:模型各層數據和參數可視化

先用caffe對cifar10進行訓練,將訓練的結果模型進行保存,得到一個caffemodel,然後從測試圖片中選出一張進行測試,並進行可視化。 In [1]: #加載必要的庫 import numpy as n

原创 Learning Deconvolution Network for Semantic Segmentation

原創文章,引用請註明出處:http://blog.csdn.net/tonyyang1995 謝謝! 最近在讀深度學習中深度學習的論文,老闆要寫總結所以順便發上來記錄一下。 Learning Deconvolution Netwo

原创 caffe學習系列:計算圖片數據的均值

圖片減去均值後,再進行訓練和測試,會提高速度和精度。因此,一般在各種模型中都會有這個操作。 那麼這個均值怎麼來的呢,實際上就是計算所有訓練樣本的平均值,計算出來後,保存爲一個均值文件,在以後的測試中,就可以直接使用這個均值來相減,而不需要

原创 Caffe學習系列:用訓練好的caffemodel來進行分類

caffe程序自帶有一張小貓圖片,存放路徑爲caffe根目錄下的 examples/images/cat.jpg, 如果我們想用一個訓練好的caffemodel來對這張圖片進行分類,那該怎麼辦呢? 如果不用這張小貓圖片,換一張別的圖片,又

原创 Caffe學習系列: 繪製loss和accuracy曲線

如同前幾篇的可視化,這裏採用的也是jupyter notebook來進行曲線繪製。   In [1]: #加載必要的庫 import numpy as np import matplotlib.pyplot as plt

原创 Caffe學習系列:caffemodel可視化

通過前面的學習,我們已經能夠正常訓練各種數據了。設置好solver.prototxt後,我們可以把訓練好的模型保存起來,如 lenet_iter_10000.caffemodel。 訓練多少次就自動保存一下,這個是通過snapshot進行

原创 【翻譯】Understanding LSTM Networks

Recurrent Neural Networks 人類並不是每時每刻都從一片空白的大腦開始他們的思考。在你閱讀這篇文章時候,你都是基於自己已經擁有的對先前所見詞的理解來推斷當前詞的真實含義。我們不會將所有的東西都全部丟棄,然後用空白的大

原创 [LeetCode] Counting Bits 計數位

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s i

原创 leetcode 347. Top K Frequent Elements

Given a non-empty array of integers, return the k most frequent elements. For example, Given [1,1,1,2,2,3] and k =

原创 LeetCode 371 Sum of Two Intergers

Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example: Given a =