自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

共勉,我的学习日记

何当共攀折,歌笑此堂垂。

  • 博客(18)
  • 收藏
  • 关注

转载 从入门到放弃:k-means聚类与Python

原理伪代码代码与EM算法关系k-means算法是聚类算法。k-means目的是将相似的对象归到一类,并且没有预先的类别信息,所以是无监督学习。原理使得分类误差最小argminS∑i=1k∑x∈Si||x−μi||2(1)\mathop{\arg \min}_{S} \sum^{k}_{i = 1}\sum_{x \in S_i}||x - \mu_i||^2\tag{1}伪代码1. ra

2017-12-27 15:33:58 772

转载 【深度学习】奇异值分解与Moore-Penrose伪逆

奇异值分解Moore-Penrose伪逆PCApython实现PCA参考资料奇异值分解A=UDVT A = U D V^T 其中AA是一个m×nm \times n的矩阵,UU是一个m×mm \times m矩阵,DD是一个m×nm \times n的矩阵,VV是一个n×nn \times n矩阵。UU和VV是正交矩阵,DD是对角矩阵。D的对角线元素就是奇异值。UU和VV的列向量称为左右奇

2017-12-21 21:37:41 3906

原创 论文阅读 Learning Affinity via Spatial Propagation Networks

abstract通过一个空间传播网络来学习affinity matrix来用于vision tasks实验证明构造一个线性传播模型空间上变换的affinity matrix可以用来建模图像密集和全局相似性本文创建了一个three-way 连接的线性传播模型该模型构造了一个所有元素均来自于DCNN的稀疏传播矩阵同时创造了一个能用来建模任意特定任务的密集近邻矩阵本文用data-driven manne

2017-12-14 23:43:47 6876 3

原创 专业词汇

*Sspatial regularization、空间规整

2017-09-06 00:01:40 418

原创 python学习日记(9)

定制类__str____iter____getattr____call__定制类__str__()用以返回class的信息,还有__repr__()__iter__()用于循环__getattr__()设定未出现的属性__call__直接对实例进行调用class foo(): def __init__(self): self.a = 0 self.b

2017-06-18 20:54:20 401

原创 python学习日记(8)

slotsproperty与propertyslots如果有class Student: pass又有def set_age(self, age): self.age = agefrom types import MethodTypes = Student()s.set_age = types(set_age, s)如果需要限制绑定的属性则需要def Student:

2017-06-15 23:18:44 379

原创 python学习日记(7)

类的私有变量定义继承私有变量鸭子类型判断数据类型typeisinstancedirgetattrsetattr以及hasattr类的私有变量定义#class的定义class example: def __init__(self, name): example.name = name#或者class example(object): def __i

2017-06-12 19:22:41 282

原创 python学习日记(6)

装饰器带参数的装饰器修改属性functoolspartial装饰器简而言之,就是用来在不修改原有的函数的情况下添加一些新的功能。 原函数def test(): print("test")修饰器def decorator(func): def wrapper(*args, **kw): print("call {}".format(func.__name__))

2017-06-11 16:38:24 313

原创 python学习日记(5)

format格式代码1代码2代码3格式限定填充格式顺序可作为闭包使用内嵌使用format格式代码1print('{0}, {1}'.format('python', '学习日记'))print('{}, {}'.format('python', '学习日记'))print('{1}, {0}, {1}'.format('python', '学习日记'))print('{lang

2017-06-07 21:56:11 516

原创 python学习日记(4)

filter例子sorted闭包closurefilterdef is_odd(n): return n % 2 == 1list(filter(is_odd, [ 1, 2, 3, 4, 5, 6, 7, 8]))#return[1,3,5,7]例子筛选非回文数def is_palindrome(n): return s

2017-06-04 23:30:19 833

原创 python学习日记(3)

[toc] ggg

2017-06-02 20:29:52 303

转载 【备份】国外博客平台

Stack Overflow  Stack Overflow 是全球最受程序员欢迎的开发社区,而且也是内容最丰富的社区之一。  官方网站:http://stackoverflow.com/  Reddit  reddit 也是一个非常富有个性的社区,你可以在 reddit 上提交一些感兴趣的话题,也可以和其他程序员讨论一些编程开发的问题和当前的 IT 热点资讯,reddit 是一个用户粘性比较强的开

2017-05-31 23:23:30 613

原创 python学习日记-实战(2)

问题1问题2问题3问题1定义一个函数,接收3个参数,返回一元二次方程:ax2+bx+c=0ax^2 + bx + c = 0的两个解。def solve_quadratic(a, b, c): if b * b - 4 * a * c < 0: raise ValueError a, b = (-b + sqrt(b * b - 4 * a * c)) / (2

2017-05-31 12:54:26 301

原创 python学习日记(2)

切片迭代判断是否可迭代下标循环列表生成生成器自己写生成器切片list[begin, end, step]#end是不包括的迭代循环dictionaryfor key in dictionary: print(key)for value in dictionary.values(): print(value)for key, value in dictionary.

2017-05-31 08:51:37 301

原创 边刷leetcode边学编程-477. Total Hamming Distance

问题概述算法详解问题概述The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Now your job is to find the total Hamming distance between all pairs of t

2017-05-30 20:58:40 289

原创 python学习日记(1)

函数参数位置参数可变参数传入list或者tuple可变参数关键字参数限制输入的key函数参数位置参数默认参数def power(x): return x*x或者def power(x, n = 2): ans = 1 for i in range(n): ans *= x return ans注意 默认参数必须指向不变对象def add

2017-05-30 16:39:15 700

原创 边刷leetcode边学编程-382 Linked List Random Node

问题简述蓄水池抽样算法问题简述Given a singly linked list, return a random node’s value from the linked list. Each node must have the same probability of being chosen.Follow up: What if the linked list

2017-05-29 16:46:02 323

原创 边刷leetcode边学编程-547Friend Circles

547. Friend CirclesFriend Circles题目描述图的遍历深度优先广度优先leetcode457 Friend Circles结果题目描述There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in n

2017-05-28 16:37:46 516

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除