91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3.77MB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2023-09-12
  • 語言: 其他
  • 標簽: image??caption??keras??

資源簡介

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.xml
?????文件?????????272??2018-03-28?12:33??show_attend_and_tell.keras-master\.idea\modules.xml
?????文件?????????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.xml
?????目錄???????????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__\attendlayer.cpython-34.pyc
?????文件???????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\attendlayer.py
?????文件???????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

評論

共有 條評論