![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python学习
文章平均质量分 52
水木的编程那些事儿
这个作者很懒,什么都没留下…
展开
-
两个shell实用函数:icd和mgrep
shell实用函数原创 2022-07-20 21:02:29 · 494 阅读 · 0 评论 -
Python:根据艾宾浩斯遗忘曲线计算复习日期
前言:最近开始复习考研英语了,每天做阅读记笔记,同时每天需要复习前几天的笔记,考虑到艾宾浩斯遗忘曲线这个东西,便写了一个小脚本来计算每一天记录的笔记需要复习的日期。函数说明:函数review_time的输入是记笔记的日期,输出就是需要复习这一天笔记的那些天的日期。函数定义如下:import datetimedef review_time(today): delta_list = [1,1,2,2,3,4,5,5] # 每两天复习的间隔 review_day = [] new_原创 2020-08-29 15:55:44 · 1952 阅读 · 0 评论 -
matplotlib.pyplot绘图笔记
绘图基础建议使用ax来绘图,生成一张图的示例代码:# 方式1:f, ax = plt.subplots()# 方式2:f = plt.figure()ax = f.add_subplot()生成两幅子图的示例代码,排列方式为一行两列:# 方式1fig, axes=plt.subplots(nrows=1, ncols=2) # 有两幅子图,排列方式为一行两列axes是一个ndarrayax1, ax2 = axes# 方式2fig = plt.figure()ax1 = f原创 2021-04-25 19:14:40 · 3165 阅读 · 0 评论 -
Codewars笔记
这里写自定义目录标题寻找分解质因数(5kyu)问题描述:我的解决代码寻找分解质因数(5kyu)问题描述:Given a positive number n > 1 find the prime factor decomposition of n. The result will be a string with the following form ;“(p1**n1)(p2**n2)…(pk**nk)”Example: n = 86240 should return “(2**5)(5)(原创 2021-04-25 16:00:52 · 112 阅读 · 0 评论 -
np.apply_along_axis函数用法
这个函数的各个参数的含义请大家自行查阅了解,这里只记录一下参数axis的作用。首先定义一个函数来打印数组的shape与内容,然后生成一个4x3的数组array:def print_a(array): print("shape: %s, array is \n%s"%(array.shape, array))array=np.array([[2,3,4],[3,4,5],[6,7,8],[7,8,9]])对这个数组调用np.apply_along_axis函数,看该函数会对数组产生什么作用原创 2021-03-11 15:03:38 · 7286 阅读 · 2 评论 -
Python绘制神经网络中常见激活函数的图形
前言需要绘制的激活函数有sigmoid,tanh,ReLU,softplus,swish共5个函数。各个函数的公式sigmoid:tanh:ReLU:softplus:swish:其中 ????(⋅) 为 Logistic 函数, β为可学习的参数或一个固定超参数上面5个激活函数对应的代码公式如下:def sigmoid(x): return 1 / (1 + np.exp(-x))def tanh(x): return (np.exp(x) - np.ex原创 2020-12-08 08:56:51 · 3131 阅读 · 0 评论 -
Python:将列表随机切分成若干部分
哎哎原创 2020-10-02 14:22:05 · 12457 阅读 · 2 评论