自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 收藏
  • 关注

原创 正则表达式 re 中 \\s. \\d. 与 \\s \\d 的区别

re 正则化表达式

2022-08-25 15:54:12 352 1

原创 x[0],x[1],x[:,1],x[2,:] 区别

x =[[1,2,3], [2,4,5], [3,4,2]]#不使用numpy转化为标准数组,列表不能使用[:,2]等x=np.array(x)print(x[0])print(x[1])print(x[:,1])print(x[2,:])结果D:\ProgramFiles\anaconda3\python.exe D:/Python/DeepLearning/test1.py[1 2 3][2 4 5][2 4 4][3 4 2]Process f.

2022-02-19 11:00:29 1655

原创 关于tensorflow2.0的tf.Session() as sess的说明

import tensorflow.compat.v1 as tf#import tensorflow as tftf.disable_eager_execution()#2.0版本与1.0版本不兼容,使用2.0版本时应使用上面的程序完成从1.x到2.x的迁移a = tf.constant(4)b = tf.constant(7)c = a*bsess = tf.compat.v1.Session()#使用1.0的迁移print(sess.run(c))sess.close()#2.

2022-01-27 12:45:43 4039 1

原创 one_hot函数

import numpy as npimport tensorflow as tfindices = [0, 1, 1] # rank=1depth = 8a = tf.one_hot(indices, depth) # rank=2,输出为[3,3]indices=[0,2,-2,1] #rank=1depth=7b=tf.one_hot(indices,depth,on_value=5.0,off_value=1.0,axis=-1)print(a)print(b).

2022-01-26 23:28:36 1835

原创 dtype 和 shape

import tensorflow as tfimport numpy as npa =np.array([[[4,2],[3,4],[5,6]],[[2,1],[3,4],[4,5]]])print(a.dtype)print(a.shape)结果:2022-01-25 14:35:04.044154: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic libr.

2022-01-25 15:12:43 1420

原创 概率算法生日问题,25个人生日两两不同的概率 ,300次试验Python 代码

即计算(365!/340!365)

2021-12-23 16:24:19 487

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除