同时掌握pytorch、tensorflow、keras,三者建模对比 - 知乎
https://zhuanlan.zhihu.com/p/7852555116.08.2019 · from keras.layers import Input,Embeding,Dense from keras.models import Model import keras.backend as K from keras.optimizers import Adam x1 = Input((维度,)) y1 = Embedding(output_dim,input_dim,)(x1) or XXmodel(模型参数)(x1) #y1通过x1推导 my_model = Model(x1,y1) #keras只需要输入和输出的Input就可以建模 loss = K.binary_crossentropy(y, y1) # …