资源简介
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
- 下一篇:北大青鸟 考试 毕业考试 机试 学士后
相关资源
- 基于MFC扩展CListCtrl子项显示图片并叠
- img写盘工具(roadkil‘s diskimage) v1.
- cximage的linux版本源码
- Cocos2d-x 3.x 头像选择器功能扩展Image
- PCNN TOOLBOX
- 双立方插值实现
- 图像处理 分析与机器视觉 源码
- 脉冲耦合神经网络工具箱PCNN-toolbox
- Image2Lcd+汉字取模,TFT助手
- PNG图片转Delphi中Image.Picture.data代码-工
- CImage 强大的图像处理类库
- 微软内部镜像封装工具:CDIMAGE 2.54 (版
- Modeling of rapeseed at maturity stage using 3
- 卷积神经网络的人脸识别样本采集+
- ImageWatch2019.vsix
- Image Resizer
- swift-PSImageEditors一个简而至美的图片编
- ImageConverter(万能图片转换器)2009免
- ZedBoard REV_D的BOOT.BIN、devicetree.dtb、l
- Image Super-Resolution Via Sparse Representati
- Qt Openglwidget 显示图片纹理贴图
- 2-d and 3-d Image Registration: for Medical Re
- Universalimageloader
- stb_image库
- Keras 中文文档 PDF
- Markov random fields for vision and image proc
- 《图像分析中的马尔可夫随机场模型
- NeatImagePS MAC
- 实验三 ImageView和Switch的使用
- HDR_Code_Image.rar for opencv
评论
共有 条评论