资源简介
A keras implementation of "Show, Attend and Tell: Neural Image Caption Generation with Visual Attention"
代码片段和文件信息
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
import numpy as np
import copy
import types as python_types
import warnings
from keras import backend as K
from keras import activations
from keras import initializers
from keras import regularizers
from keras import constraints
from keras.engine import InputSpec
from keras.engine import layer
from keras.utils.generic_utils import func_dump
from keras.utils.generic_utils import func_load
from keras.utils.generic_utils import deserialize_keras_object
from keras.utils.generic_utils import has_arg
from keras.legacy import interfaces
from keras.layers.merge import _Merge
class WeightSum(_Merge):
“““layer that adds a list of inputs.
It takes as input a list of tensors
all of the same shape and returns
a single tensor (also of the same shape).
“““
def _merge_function(self inputs):
output = inputs[0]
for i in range(1 len(inputs)):
output += inputs[i]
return output
def weightsum(inputs **kwargs):
“““Functional interface to the ‘Add‘ layer.
# Arguments
inputs: A list of input tensors (at least 2).
**kwargs: Standard layer keyword arguments.
# Returns
A tensor the sum of the inputs.
“““
return WeightSum(**kwargs)(inputs)
class Attendlayer(layer):
“““Just your regular densely-connected NN layer.
‘Dense‘ implements the operation:
‘output = activation(dot(input kernel) + bias)‘
where ‘activation‘ is the element-wise activation function
passed as the ‘activation‘ argument ‘kernel‘ is a weights matrix
created by the layer and ‘bias‘ is a bias vector created by the layer
(only applicable if ‘use_bias‘ is ‘True‘).
Note: if the input to the layer has a rank greater than 2 then
it is flattened prior to the initial dot product with ‘kernel‘.
# Example
‘‘‘python
# as first layer in a sequential model:
model = Sequential()
model.add(Dense(32 input_shape=(16)))
# now the model will take as input arrays of shape (* 16)
# and output arrays of shape (* 32)
# after the first layer you don‘t need to specify
# the size of the input anymore:
model.add(Dense(32))
‘‘‘
# Arguments
units: Positive integer dimensionality of the output space.
activation: Activation function to use
(see [activations](../activations.md)).
If you don‘t specify anything no activation is applied
(ie. “linear“ activation: ‘a(x) = x‘).
use_bias: Boolean whether the layer uses a bias vector.
kernel_initializer: Initializer for the ‘kernel‘ weights matrix
(see [initializers](../initializers.md)).
bias_initializer: Initializer for the bias vector
(see [initializers](../initializers.md)).
kernel_regularizer: Regularizer function applied to
the ‘ker
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-28 12:33 show_attend_and_tell.keras-master\
目录 0 2018-03-28 12:33 show_attend_and_tell.keras-master\.idea\
文件 238 2018-03-28 12:33 show_attend_and_tell.keras-master\.idea\misc.xm
文件 272 2018-03-28 12:33 show_attend_and_tell.keras-master\.idea\modules.xm
文件 545 2018-03-28 12:33 show_attend_and_tell.keras-master\.idea\mrnn_rsicd.iml
文件 36047 2018-03-28 12:33 show_attend_and_tell.keras-master\.idea\workspace.xm
目录 0 2018-03-28 12:33 show_attend_and_tell.keras-master\.ipynb_checkpoints\
文件 5209321 2018-03-28 12:33 show_attend_and_tell.keras-master\.ipynb_checkpoints\visualization-checkpoint.ipynb
文件 265 2018-03-28 12:33 show_attend_and_tell.keras-master\README.md
文件 0 2018-03-28 12:33 show_attend_and_tell.keras-master\__init__.py
目录 0 2018-03-28 12:33 show_attend_and_tell.keras-master\__pycache__\
文件 10249 2018-03-28 12:33 show_attend_and_tell.keras-master\__pycache__\attendla
文件 12353 2018-03-28 12:33 show_attend_and_tell.keras-master\__pycache__\data_manager.cpython-34.pyc
文件 4232 2018-03-28 12:33 show_attend_and_tell.keras-master\__pycache__\evaluator.cpython-34.pyc
文件 6868 2018-03-28 12:33 show_attend_and_tell.keras-master\__pycache__\generator.cpython-34.pyc
文件 3044 2018-03-28 12:33 show_attend_and_tell.keras-master\__pycache__\models.cpython-34.pyc
文件 12260 2018-03-28 12:33 show_attend_and_tell.keras-master\attendla
文件 15534 2018-03-28 12:33 show_attend_and_tell.keras-master\data_manager.py
文件 13341 2018-03-28 12:33 show_attend_and_tell.keras-master\data_manager.pyc
文件 15502 2018-03-28 12:33 show_attend_and_tell.keras-master\data_manager.py~
文件 5368 2018-03-28 12:33 show_attend_and_tell.keras-master\evaluator.py
文件 4657 2018-03-28 12:33 show_attend_and_tell.keras-master\evaluator.pyc
文件 8044 2018-03-28 12:33 show_attend_and_tell.keras-master\evaluator_several.py
文件 8978 2018-03-28 12:33 show_attend_and_tell.keras-master\generator.py
文件 7152 2018-03-28 12:33 show_attend_and_tell.keras-master\generator.pyc
文件 14991 2018-03-28 12:33 show_attend_and_tell.keras-master\models.py
文件 2290 2018-03-28 12:33 show_attend_and_tell.keras-master\models.pyc
文件 3182 2018-03-28 12:33 show_attend_and_tell.keras-master\train.py
- 上一篇:电机控制PWM
- 下一篇:北大青鸟 考试 毕业考试 机试 学士后
相关资源
- Digital+Image+processing+Gonzalez+-+Solution+M
- 图像分割 高斯混合模型 马尔科夫 i
- Single Image Haze Removal Using Dark Channel P
- ImagePrinter_2.1虚拟打印机及安装包源码
- imagesegmentation.zip
- cximage 源代码及demo程序
- Keras2.2.4中文官方离线文档.pdf
- 基于Keras的LSTM股价预测代码
- Attention is all you need实战tensorflow及ke
- ImageEditDemo.zip
- USGS Image lBDA最新工具
- 非常好用的批量修改图片大小
- 模仿qq音乐播放旋转ImageView动画
- SDL_image-1.2.8.tar.tar
- Digital Image Processing - Third Edition 课后答
- Attention-guided CNN for image denoising.pptx
- FreeImage图形库说明文档(中文版).
-
Measuring size of ob
jects in an image with - stegdetect-0.6
- Keras Deep Learning Cookbook
- Distinctive Image Features from Scale-Invarian
- CxImage 6.00 完整版
- Qt用Tcp 和Udp 传图片的,对于没做过这
- 2-D and 3-D Image registration 图像配准
-
An Image Inpainting Technique ba
sed on the - Keras中文文档 PDF版
- 医疗图像 可用于图像融合
- 一篇图像分割的外文论文,可供大家
- ImageJ安装包
- 冈萨雷斯《数字图像处理》Digital Im
评论
共有 条评论