
Machine Learning
有时候我们只是缺少上马提枪去干他娘的勇气
Fuly1024
写博客的原因,只是为了自己需要的时候方便找
展开
-
kaggle下载output中的文件
kaggle的output没办法直接下载文件夹,倒是可以下载文件,当你的训练模型很多个文件的时候, 一个一个下载太慢了, 所以先将output压缩一下,然后下载就行了直接在cell中运行此代码即可import osimport zipfileimport datetimedef file2zip(packagePath, zipPath): ''' :param packagePath: 文件夹路径 :param zipPath: 压缩包路径 :return: '''原创 2022-02-17 14:46:35 · 16780 阅读 · 16 评论 -
numpy的一些常用方法
# -*- coding: utf-8 -*-import numpy as npdef demo_1(): ''' 维度 :return: ''' a_1 = np.array([1, 2, 3, 4, 5, 6, 7, 8]) print(a_1.shape) # 8 a_2 = np.array([[1], [2], [3], [4], [5], [6], [7], [8]]) print(a_2.shape) # 8, 1原创 2022-02-16 18:06:19 · 806 阅读 · 0 评论 -
使用Kaggle训练模型并下载自己训练的模型
kaggle地址: https://www.kaggle.com/上传数据集添加别人已经上传过的数据集查看数据路径import osfor dirname, _, filenames in os.walk('/kaggle/input'): for filename in filenames: print(os.path.join(dirname, filename))添加代码# -*- coding: utf-8 -*-import da原创 2022-02-15 13:47:35 · 12380 阅读 · 1 评论 -
colab配合谷歌云盘使用
首先你得有一个谷歌账号!!!参考: https://zhuanlan.zhihu.com/p/149233850https://blog.youkuaiyun.com/lumingha/article/details/1048257021 将数据传送至谷歌云盘(云盘地址:https://drive.google.com/drive/my-drive)创建文件夹 上传数据到stock_data2 跳转到colab(新建—>更多–> google Colaboratory)3 挂载网盘+ 切换原创 2022-02-14 17:31:35 · 6311 阅读 · 0 评论 -
RNN实现股票预测(别当真)
参考视频: https://www.bilibili.com/video/BV16A41157LW?p=52下图是使用rnn预测价的曲线,红线是真实价格 蓝色是预测价格。这张图说明了什么呢? 说明实际价格和预测价格相差10%吧(10%你懂的)我知道你想说,他们趋势差不多呀?最开始我也以为趋势一样的话我可以利用趋势赚钱呀!!!后来看了代码才发现,他是用1-60天的数据预测第61天的数据,2到61天真实数据 预测第62天的数据,然后排列起来的!预测曲线上的任何两个点没有参看视频而来的代码如下:原创 2022-02-11 18:28:33 · 2071 阅读 · 1 评论 -
循环神经网络RNN了解
参考: https://zhuanlan.zhihu.com/p/123211148https://www.cnblogs.com/GumpYan/p/13561407.html参考视频: https://www.bilibili.com/video/BV16A41157LW?p=41…https://www.bilibili.com/video/BV16A41157LW?p=51循环核: 循环核具有记忆力,通过不同时刻的参数共享,实现了对时间序列的信息提取。(下图是一个循环核)每个循环核有原创 2022-02-10 18:15:08 · 568 阅读 · 0 评论 -
经典卷积神经网络简介(使用tensflow实现)
原创 2022-02-09 13:46:20 · 1013 阅读 · 1 评论 -
简单的卷积神经网络搭建(cifar10案例)
参考视频: https://www.bilibili.com/video/BV16A41157LW?p=34获取cifar10数据(使用本地数据)from tensorflow.python.keras.datasets.cifar import load_batchdef get_load_cifar10(): # 获取数据 直接使用 tf.keras.datasets.cifar10.load_data() 会报错(160M数据,可能是因为网络不好) # cifar10数原创 2022-02-07 17:28:17 · 2637 阅读 · 0 评论 -
Tensorflow2.0实现断点续训
参考: https://www.bilibili.com/video/BV16A41157LW?p=17视频及课件来源 北京大学 曹建使用的识别图片获取训练数据集def get_mnist_data(): # 参考: https://www.codenong.com/53310656/ # 获取数据 return (x_train, y_train), (x_test, y_test) (x_train, y_train), (x_test, y_test) = tf.k原创 2022-02-04 18:48:17 · 1336 阅读 · 0 评论 -
TensorFlow2.0 搭建手写数字识别网络
参考: https://www.bilibili.com/video/BV16A41157LW?p=17视频及课件来源 北京大学 曹建1, 获取数据:import tensorflow as tfimport numpy as npdef get_mnist_data(): # 参考: https://www.codenong.com/53310656/ # 获取数据 return (x_train, y_train), (x_test, y_test) (x_trai原创 2022-01-25 15:23:36 · 1524 阅读 · 0 评论 -
Tensorflow2.0使用Sequential 搭建神经网络
参考: https://www.bilibili.com/video/BV16A41157LW?p=15视频及课件来源 北京大学 曹建原创 2022-01-13 20:06:31 · 2879 阅读 · 0 评论 -
python 使用matplotlib.pyplot画线
文章参考: https://blog.youkuaiyun.com/u014261408/article/details/90084025版本Python 3.7.5matplotlib 3.5.01 创建 3组数组line_a line_b 和 x line_a = [] line_b = [] x = range(50, 100) for a in x: line_a.append(a + random.randint(1, 10))原创 2021-12-30 20:02:51 · 13209 阅读 · 0 评论 -
MachineLearning入门---第7章---TensorFlow的中阶API(2)
指导教程: https://github.com/lyhue1991/eat_tensorflow2_in_30_days实际上就是抄的,我已经看不懂这些都是什么东西了, eat_tensorflow2_in_30_days这系列的教程,我准备先停下,等把吴恩达老师的机器学习入门课程啃完,再继续,现在相当于抄书,停一段时间再抄吧# -*- coding: utf-8 -*-import osimport tensorflow as tffrom tensorflow.keras import翻译 2021-12-15 19:41:00 · 176 阅读 · 0 评论 -
MachineLearning入门---第7章---TensorFlow的中阶API---数据管道
指导教程: https://github.com/lyhue1991/eat_tensorflow2_in_30_days这一张只是了解了一些知识,只是了解,有个印象而已, 以下代码,也只是书上的代码复现, 贴在这是为了以后方便# -*- coding: utf-8 -*-import datetimeimport timeimport tensorflow as tfimport pandas as pddef pandas_data_pipeline(): # excel =原创 2021-12-14 20:00:58 · 1086 阅读 · 0 评论 -
MachineLearning入门---第6章---TensorFlow的低阶API简介
TensorFlow的低阶API主要包括张量操作,计算图和⾃动微分。如果把模型⽐作⼀个房⼦,那么低阶API就是【模型之砖】。在低阶API层次上,可以把TensorFlow当做⼀个增强版的numpy来使⽤。TensorFlow提供的⽅法⽐numpy更全⾯,运算速度更快,如果需要的话,还可以使⽤GPU进⾏加速。张量的结构操作:张量的操作主要包括张量的结构操作 和 张量的数学运算张量结构操作诸如:张量创建,索引切⽚,维度变换,合并分割。张量数学运算主要有:标量运算,向量运算,矩阵运算。另外我们会介绍原创 2021-12-06 20:02:18 · 1366 阅读 · 0 评论 -
MachineLearning入门---第5章---TensorFlow的核心基础概念
指导教程: https://github.com/lyhue1991/eat_tensorflow2_in_30_days原创 2021-12-06 19:21:33 · 122 阅读 · 0 评论 -
MachineLearning入门---第4章---TensorFlow图⽚数据建模流程示例
指导教程: https://github.com/lyhue1991/eat_tensorflow2_in_30_dayspython版本 3.7.5 下载地址 https://www.python.org/ftp/python/3.7.5/python-3.7.5-amd64.exetensorflow 2.7.0 cpu版 : pip install tensorflow-cpu==2.7.0开发环境: Idea + python插件代码中所用到的数据:https://github.com/原创 2021-12-03 16:23:30 · 1546 阅读 · 0 评论 -
MachineLearning入门---第3章---TensorFlow的结构化数据建模流程
指导教程: https://github.com/lyhue1991/eat_tensorflow2_in_30_dayspython版本 3.7.5 下载地址 https://www.python.org/ftp/python/3.7.5/python-3.7.5-amd64.exetensorflow 2.7.0 cpu版 : pip install tensorflow-cpu==2.7.0开发环境: Idea + python插件结构化数据建模的流程准备数据定义模型训练模型评估原创 2021-12-02 19:59:15 · 673 阅读 · 0 评论 -
MachineLearning入门---第2章---神经网络的数学基础
指导教程: https://github.com/lyhue1991/eat_tensorflow2_in_30_days学习书籍: <python深度学习>神经网络的数学基础神经网络的核心组件是层(layer),它是一种数据处理模块,可以看作是数据过滤器,进去一些数据,出来的数据变得更加有用。大多数深度学习都是将简单的层链接起来,从而实现渐进式的数据蒸馏(data distillation)。训练中的两个重要指标: loss(损失) 和 acc(精度)神经网络的数据表示 – 张量(原创 2021-12-02 16:06:18 · 1883 阅读 · 0 评论 -
MachineLearning入门---第1章-基础了解
我目前是一个java程序,对机器学习一无所知,想按照当初学java的路子学机器学习 —了解大概就直接干, 然后回过来慢慢深究其中的理论!参考:https://easyai.tech/ai-definition/machine-learning/#whathttps://ww2.mathworks.cn/discovery/machine-learning.html什么是机器学习机器学习是一种数据分析技术,让计算机执行人和动物与生俱来的活动:从经验中学习。机器学习算法使用计算方法直接从数据中“学习原创 2021-11-12 17:54:33 · 1283 阅读 · 0 评论