随笔分类 - tensorflow
摘要:训练模型import tensorflow as tfimport numpy as npimport matplotlib.pyplot as pltmoney=np.array([[109],[82],[99], [72], [87], [78], [8...
阅读全文
摘要:import numpy as npimport tensorflow as tfa=np.reshape(range(24),(4,2,3))sess=tf.InteractiveSession()b= tf.split(a,1,0)c=sess.run(...
阅读全文
摘要:import tensorflow as tf; import numpy as np; x = tf.constant([[1, 2, 3], [4, 5, 6]])cc=tf.transpose(x)init = tf.initialize_all_va...
阅读全文
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Thu Oct 25 15:29:59 2018@author: lg"""import tensorflow as tfimport nu...
阅读全文
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Thu Oct 25 13:41:35 2018@author: lg"""import numpy as npimport pandas ...
阅读全文
摘要:import numpy as np import tensorflow as tf import tensorflow.contrib.rnn as rnn import matplotlib.pyplot as plt import matplotlib...
阅读全文
摘要:网上看到很多tf.pad的文章,很多都语焉不详,需自己动手操作才能真正理解,pad,一言以蔽之,就是在矩阵的周围补0。 1. 对于二维矩阵,就是在 上 ,下,左,右补0#pad1 = np.array([[‘上’,‘下’], [‘左’,‘右’ ]])impo...
阅读全文
摘要:在登录远程服务器的时候使用命令:ssh -L 16006:127.0.0.1:6006 name@server_ipnohup python file_name.py >p1.log >tensorboard --logdir=./log在本机浏览器输入:h...
阅读全文
摘要:#!/usr/bin/env python3# -*- coding: utf-8 -*-"""Created on Mon Oct 22 13:04:34 2018@author: lg"""#!/usr/bin/env python3# -*- codi...
阅读全文
摘要:import tensorflow as tfimport numpy as np## prepare the original datawith tf.name_scope('data'): x_data = np.random.rand(100)...
阅读全文