- 博客(21)
- 收藏
- 关注
原创 Resnet
1. 梯度消失 & 梯度爆炸 假设有: 表达式为: 对W1求梯度,由链式法则有: 若采用sigmod激活函数,其导数为:可以看出,导数不超过0.25,若W1,W...
2019-03-15 21:37:30
332
原创 CNN 基础知识
1. 神经元 VS feature map VS 卷积核 神经元:feature map 的大小 feature map:输入图像经过卷积核卷积后的各像素点的组合 卷积核: 属于共享参数 2. 权值共享 权值共享:同一个feature map中神经元使用同一个权值,可训练参数只与卷积核大小、个数、通道有关 3. 感受野 and 计算量 计算量...
2019-02-23 20:15:01
383
原创 Scikit-Learn
#Step 1from sklearn.datasets import make_classificationdatas = make_classification( n_samples = 1000, n_features=10 , )#Step 2from sklearn import cross_validationkf = cross_validation.KFold( len...
2018-07-06 00:13:10
258
原创 Pandas
For each of the four datasets...Compute the mean and variance of both x and yCompute the correlation coefficient between x and yCompute the linear regression line: (hint: use statsmodels and look at ...
2018-07-05 21:26:43
192
原创 Scipy
#10.1import numpy as npimport scipy.optimize as optm = 20n = 10A = np.random.normal(loc=10, scale=3 , size=(m,n))b = np.random.normal(size=m)ans = opt.lsq_linear(A, b)x = ans['x']residual ...
2018-07-05 20:39:55
553
原创 (补)Matplotlib
#11.1import numpy as np#11.2import matplotlibmatplotlib.use("TKAgg")import matplotlib.pyplot as pltimport numpy as npX = []for i in range(10): x = 10*np.random.random() X.append(np.ran...
2018-07-04 11:26:30
179
原创 (补)Numpy
import numpy as npfrom scipy.linalg import toeplitzfrom scipy.linalg import svdvalsimport timen , m = 200, 500A = np.random.normal(size=[n,m])B = toeplitz(range(m))#9.1AA = A+AAAT = np.dot(...
2018-07-04 10:59:11
171
原创 LeetCode
6. Z字形变换【中】将字符串 "PAYPALISHIRING" 以Z字形排列成给定的行数:示例:P A H NA P L S I I GY I R之后从左往右,逐行读取字符:"PAHNAPLSIIGYIR"代码:(找规律) def convert(self, s, numRows): """ :type s: str ...
2018-06-17 23:58:05
147
原创 LeetCode
15. 三数之和给定一个包含 n 个整数的数组 nums,判断 nums 中是否存在三个元素 a,b,c ,使得 a + b + c = 0 ?找出所有满足条件且不重复的三元组。注意:答案中不可以包含重复的三元组Note: The solution set must not contain duplicate triplets.For example, given array S = [-1, 0...
2018-04-30 17:39:00
324
原创 Python编程 从入门到实践 第十一章习题
11-1 城市和国家import unittestfrom city_funtions import get_city_countryclass NameTestCase(unittest.TestCase): def test_city_country(self): formatted_name = get_city_country('santiago','chi...
2018-04-15 16:39:22
383
1
原创 Python编程 从入门到实践 第十章习题
10-1 Python学习笔记filename = 'learning_python.txt'print("读取整个文件:")with open(filename) as file_object: contents = file_object.read() print(contents)print("\n遍历文件对象:")with open(filename) as fi...
2018-04-08 23:02:49
300
原创 Python编程 从入门到实践 第九章习题
9-1 餐馆class Restaurant(): def __init__(self, restaurant_name, cuisine_type): self.name = restaurant_name self.type = cuisine_type def describe_restaurant(self): print...
2018-04-08 13:56:58
208
原创 Python编程 从入门到实践 第八章习题
8-2 喜欢的图书:def favorite_book(title): """"喜欢的图书""" print("One of my favorite book is " + title.title() + ".")favorite_book("Harry Potter")输出:One of my favorite book is Harry Potter.8-
2018-03-31 21:56:12
538
原创 Python编程 从入门到实践 第七章习题
7-2 餐馆订位:number = input("How many of you are there for dinner?")number = int(number)if number > 8: print("There is no empty table。")else: print("The table is available.")输出:How many of ...
2018-03-27 11:07:43
235
原创 Python编程 从入门到实践 第六章习题
6-2 喜欢的数字:favorite_number = { 'alex' : 29, 'leo' : 23, 'mike' : 45, 'John' : 100, 'Phil' : 34,}输出:Alex's favorite number is 29.Leo's favorite number is 23.Mike's favorite numb...
2018-03-23 14:43:47
305
原创 Python编程 从入门到实践 第五章习题
5-4 外星人的颜色#2:alien_color = 'green' #version 1, 执行if语句#alien_color = 'yellow' #version 2, 执行else语句if alien_color == 'green': print("You have win 5 scores!")else: print("You have win 10 ...
2018-03-19 13:19:39
403
原创 Python编程 从入门到实践 第四章习题
4-1: 比萨pizzas = ['seafood' , 'beef', 'cheese']for pizza in pizzas: print('I like ' + pizza + ' pizza.')print('I really like pizza!')输出:I like seafood pizza.I like beef pizza.I like cheese piz...
2018-03-18 15:35:26
323
原创 Python编程 从入门到实践 第三章习题
3-1 姓名>>> name = ['Alex', 'Leo', 'Mike']>>> print(name[0])Alex>>> print(name[1])Leo>>> print(name[2])Mike3-2 问候语>>> message = 'Hello, '+name[0] +
2018-03-12 22:06:47
284
原创 Python编程 从入门到实践 第一章习题
1.浏览Python主页,写下发现和收获。 打开Python主页,页面简洁,可供进入的页面有关于、下载、文件、社区、成功案例、新闻、活动。 当我听说Python这一词时,很多时候都是与爬虫联系在一起。当我打开Python网页时,我才发现爬虫不过是Python初露头角的入门练习,在艺术,商业,教育,工程,政府,科学,软件开发这些几乎涵盖了现代生活方方面面的领域,都展现了作为编程语言无与伦...
2018-03-08 14:50:31
721
原创 Python编程 从入门到实践 第二章习题
2-1 简单消息:>>> message = 'simple_message'>>> print(message)simple_message2-2 多条简单消息:>>> message = 'simple_message'>>> print(message)simple_message>>>
2018-03-08 00:18:37
256
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人