- 博客(7)
- 收藏
- 关注
原创 python--leetcode34. Search for a Range
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the targ
2018-03-26 21:21:51 300
原创 python--leetcode796. Rotate String
We are given two strings, A and B.A shift on A consists of taking string A and moving the leftmost character to the rightmost position. For example, if A = 'abcde', then it will be 'bcdea' aft
2018-03-19 20:23:30 486
原创 python--leetcode728. Self Dividing Numbers
A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.Also, a self-d
2018-03-19 17:33:15 784
原创 python--leetcode771. Jewels and Stones
You're given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have. You want to know how many of the
2018-03-19 17:07:40 412
原创 机器学习--PCA(主成分分析)原理及应用
众所周知PCA是有效的降维方法,当你的特征非常多维度非常大的时候,为了使机器学习的算法在计算或是训练的时候有更高的效率,通常会进行降维处理。将一个具有m个数据n维的数据降为k维的数据,方法如下:算出一个sigma矩阵,x(i)为n*1的矩阵,因此x(i)转置为1*n,因此sigma的形状为n*n。svd为奇异值分解函数,得到一个U矩阵,也为n*n矩阵。取U矩阵的前k列,与x相乘
2018-03-12 16:24:05 9000
原创 python--np.split()函数示例
我发现网上没有多少关于这个numpy.split函数的例子,我只好自己写一个。沿不同轴进行分割,我们直接看例子:import numpy as npA = np.arange(16).reshape(4,4)print('A:',A)print('沿1轴分割为2组:\n',np.split(A,2,axis = 1))print('沿0轴分割为2组:\n',np.split(A,2,ax...
2018-03-04 16:07:54 10037 2
原创 解决ValueError: Trying to share variable rnn/multi_rnn_cell/cell_0/basic_lstm_cell/kernel
在使用tensorflow lstm的时候出现报错:ValueError: Trying to share variable rnn/multi_rnn_cell/cell_0/basic_lstm_cell/kernel, but specified shape (512, 1024) and found shape (556, 1024).完整报错如下:Traceback (most rece...
2018-03-04 14:56:48 8821
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人