![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
编程基础
XXin_YYYYYY
记录生活,记录自己
展开
-
ValueError: numpy.ufunc size changed, may indicate binary incompatibility
遇到错误:ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject解决办法:升级numpy的版本:pip install --upgrade numpy原创 2020-07-17 13:30:23 · 386 阅读 · 0 评论 -
Theano中遇到的问题
运行一个theano程序出现错误:Problem occurred during compilation with the command line below: "C:\ProgramData\Anaconda3\envs\theano\Library\mingw-w64\bin\g++.exe -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -march=ivybridg原创 2020-07-17 13:19:18 · 570 阅读 · 0 评论 -
ERROR: Could not find a version that satisfies the requirement yaml (from versions: none)
安装yaml出错:ERROR: Could not find a version that satisfies the requirement yaml (from versions: none)解决办法:pip install pyymal原创 2020-07-16 00:23:46 · 3090 阅读 · 3 评论 -
Anaconda通过清华镜像下载包
比如下载tensorflow:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow直接通过pypi下载即可原创 2020-02-28 22:50:30 · 2298 阅读 · 1 评论 -
Tensorboard可视化
主要用到tf.summary函数。比如对计算结果进行可视化。z = tf.multiply(X,W)+btf.summary.histogram('z',z)对loss进行可视化:cost = tf.reduce_mean(tf.square(Y - z))tf.summary.scalar('loss_function',cost)然后在session中写入日志:init =...原创 2020-02-12 19:54:27 · 97 阅读 · 0 评论 -
checkpoint
有时候模型特别大,训练时间特别长,如果没有设置断点,中间如果出现一些不可控因素时,那之前训练的结果就都没有了,就白白浪费了人力物力资源。所以,在模型训练一定时间后,应该为它保存断点,这个也为后面使用模型中的一些参数提供了方便。那我们以线性模型为例:import tensorflow as tfimport numpy as np# 1 生成模拟数据train_x = np.linspace...原创 2020-02-12 18:05:12 · 690 阅读 · 0 评论 -
Anaconda遇到ConnectionError
今天在家开始工作,啥都没干呢就遇到numpy包版本错误的问题,然后就开始漫长的修改之路。删除的时候很容易就删掉了,但是下载的时候可就麻烦了,下载了一下午什么都下载不下来,等半天最后提示ConnectionError,为此我还重新下载了Anaconda,其实都没有必要,直接把镜像改一下就好了。改成清华镜像的两句命令(在cmd中直接写入就可以了):conda config --add channel...原创 2020-02-02 16:52:05 · 693 阅读 · 1 评论 -
LSTM详解
LSTM详解LSTM(Long Short Term Memory),即一种特殊的RNN形式,主要用来解决长期依赖问题,结构图如下:可以看到它主要由三个门和一个细胞单元组成。这些门其实都是一种非线性变换,主要目的就是决定有多少信息能够通过。遗忘门决定上一时刻的单元状态Ct-1中有多少信息保留到当前时刻Ct公式:输入门决定当前输入有多少信息保存到单元状态Ct公式:在此处还...原创 2020-01-07 11:27:08 · 538 阅读 · 0 评论 -
使用RNN时,cell的设置
使用静态rnn处理时序数据import tensorflow as tffrom tensorflow.contrib import rnnx=tf.placeholder("float",[None,time_steps,length])y=tf.placeholder("float",[None,n_classes])input=tf.unstack(x ,time_steps,...转载 2020-01-03 09:25:00 · 285 阅读 · 0 评论 -
highway network
Highway Networkhighway network 主要解决了因网络深度的加深,梯度信息回流受阻,从而造成网络训练困难的问题。它其实就是一个门结构,用这个门来控制输入的信息中有多少信息被激活,有多少信息一成不变的输入到下一层。同时在反向传播的时候,能够让更多的信息直接回流到输入,而不需要竟敢一个非线性转化。公式:注:H、T均为一个非线性变换,T这个非线性变换表示一个概率,也就是...原创 2020-01-07 10:21:51 · 336 阅读 · 0 评论 -
将字符串文本切分成字
将字符串文本切分成字texts = 'start person_topic_a person_topic_b person_topic_a 出生 日期 ’ ’ - - person_topic_b 出生 日期 - - ’ 'person_topic_a 血型 a型 person_topic_a 标签 口碑 很好 person_topic_a 获奖 移动迷宫_提名 _ ’ '( ...原创 2019-04-25 16:21:05 · 173 阅读 · 0 评论 -
将字符串文本切分成词2
将字符串文本切分成词,并且提取出英文单词,同时将所有数字用token代替import refrom collections import Countertexts = 'ok i am fine 今天 天气 很好 123 563 45'NUM = "<num>"s = re.sub('\d+', NUM, s).lower()texts_str = s.split(' ...原创 2019-04-25 21:05:58 · 172 阅读 · 0 评论