- 博客(5)
- 收藏
- 关注
原创 tf2.0keras一个简单的自定义层
自定义层init()首先是一些必要的参数的初始化build()主要声明需要更新的参数部分call()包含了主要层的实现class MyLayer(tf.keras.layers.Layer): def __init__(self,output_dim): #接收传的值 self.output_dim=output_dim super(MyLayer,self).__init__() def...
2020-06-03 14:56:44
660
原创 一个简单的keras的模型创建,编译与优化器
import tensorflow as tfimport tensorflow.keras.layers as layersimport tensorflow.keras.optimizer as optimizer#神经网络的模型构建model=tf.keras.Sequential()model.add(layers.Dense(256,activation="relu"))model.add(layers.Dense(128,activation="relu"))model.add(l
2020-06-02 12:03:57
318
原创 tensorflow低阶api基础编程
tf常量import tensorflow as tfimport numpy as np#tf常量的定义a=tf.constant(7)#tf常量的值print(a.numpy())#python中tf常量输出print(a)#结果7tf.Tensor(7, shape=(), dtype=int32)tf变量#声明一个tf变量a2=tf.Variable(7)#声明一个tf变量数组a3=tf.Variable([1,2,3])print(a2,a3)print(
2020-06-02 11:14:23
231
原创 为了效率!!!TensorFLow2.0静态图与eager模式(动态图)
总结自此博客为了效率!!!eager与静态图转换的那些坑eager模式:就是动态图调用方法:tensorflow2.0默认eager模式优点Python写法,方便调试缺点比自动图速度慢静 态 图 模 式 :调用方法:需要在函数上方加上@tf.function装饰优点tf写法,速度快缺点不如python写法直观转换方式在头上加@tf.function第一个大坑#调用静态图的例子@tf.funct
2020-06-01 15:42:51
2577
4
原创 H5Css float:left居中
如何居中float:left的元素pading,margin,border全设置为0,经过嵌套div可以实现如果想设置多float:left水平居中的效果,可以设置子div的宽度百分比,与margin百分比实现
2020-05-28 16:42:37
979
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人