계속 기다 리 고 있 습 니 다.RNN 시 리 즈 를 기다 리 고 있 습 니 다.-1
4277 단어 TensorFlowAPI필기 하 다.
클래스 Basic RNNCell 은 LayerRNNCell 에 계승 되 어 가장 기본 적 인 RNN 단원 입 니 다.
초기 화 매개 변수:
__init__(
num_units,
activation=None,
reuse=None,
name=None,
dtype=None,
**kwargs
)
num_units:RNN cell 의 개수,즉 은 층 의 크기 activation:비 선형 사용,기본 값 은 tanh reuse:boolean 형식 입 니 다.현재 scope 에서 dtype:층 형식 을 다시 사용 할 수 있 는 지,None 이면 초기 입력 과 일치 합 니 다.
속성:
activity_regularizer:Optional regularizer function for the output of this layer. input:Retrieves the input tensor(s) of a layer losses:Losses which are associated with this Layer. output:Retrieves the output tensor(s) of a layer. state_size:은막 의 크기 outputsize:후 자 는 출력 크기 weights:Returns the list of all layer variables/weights.
방법:
__call__(
inputs,
state,
scope=None,
*args,
**kwargs
)
주어진 상태 부터 입력 에 따라 RNN 셀 을 한 번 실행 합 니 다. input:2-D 장 량,[batchsize, input_size]. state: self.state_size 가 정수 일 때 2-D 장 량[batchsize, self.state_size].그렇지 않 으 면 self.statesize 정수 모듈,결 과 는 모듈[batchsize, s] for s in self.state_size. 반환 값:2 차원 장 량[batchsize, self.output_size]
get_initial_state(
inputs=None,
batch_size=None,
dtype=None
)
모든 입력 되 돌리 기
get_input_at(node_index)
지정 한 노드 인덱스,대응 하 는 입력 을 되 돌려 줍 니 다.
zero_state(
batch_size,
dtype
)
모두 0 으로 채 워 진 state tensor(s)를 되 돌려 줍 니 다.statesize 가 정수 또는 TensorShape 이면 결과[batchsize, state_size];하면,만약,만약...size 내장 list 또는 tuple,반환 값 은[batchsize, s] for each s in state_사이즈
tf.nn.rnn_cell.BasicLSTMCell
기본 LSTM 재 귀 신경 망 유닛 은 clipping,procjection layer,peep-hole 등 일부 lstm 의 고급 변종 을 실현 하지 않 고 기본 적 인 basicline 구조 로 만 존재 하 며,이러한 고급 variant 를 사용 하려 면 LSTM Cell 과 같은 종 류 를 사용 해 야 한다.그래서 이미 버 렸 습 니 다.tf.nn.rnn 을 사용 합 니 다.cell.LSTM Cell 교체
tf.nn.rnn_cell.LSTMCell
Long short-term memory unit (LSTM) recurrent network cell.
초기 화 매개 변수:
__init__(
num_units,
use_peepholes=False,
cell_clip=None,
initializer=None,
num_proj=None,
proj_clip=None,
num_unit_shards=None,
num_proj_shards=None,
forget_bias=1.0,
state_is_tuple=True,
activation=None,
reuse=None,
name=None,
dtype=None,
**kwargs
)
num_units:LSTM cell 의 개수,은 단원 의 개수 usepeepholes: bool, set True to enable diagonal/peephole connections. cell_clip: (optional) A float value, if provided the cell state is clipped by this value prior to the cell output activation. initializer: (optional) The initializer to use for the weight and projection matrices. num_proj: (optional) int, The output dimensionality for the projection matrices. If None, no projection is performed. proj_clip: (optional) A float value. If num_proj > 0 and proj_clip is provided, then the projected values are clipped elementwise to within [-proj_clip, proj_clip]. num_unit_shards: Deprecated, will be removed by Jan. 2017. Use a variable_scope partitioner instead. num_proj_shards: Deprecated, will be removed by Jan. 2017. Use a variable_scope partitioner instead. forget_bias: Biases of the forget gate are initialized by default to 1 in order to reduce the scale of forgetting at the beginning of the training. Must set it manually to 0.0 when restoring from CudnnLSTM trained checkpoints. state_is_tuple: If True, accepted and returned states are 2-tuples of the c_state and m_state. If False, they are concatenated along the column axis. This latter behavior will soon be deprecated. activation: Activation function of the inner states. Default: tanh. It could also be string that is within Keras activation function names. reuse: (optional) Python boolean describing whether to reuse variables in an existing scope. If not True, and the existing scope already has the given variables, an error is raised. name: String, the name of the layer. Layers with the same name will share weights, but to avoid mistakes we require reuse=True in such cases. dtype: Default dtype of the layer (default of None means use the type of the first input). Required when build is called before call.
속성 과 방법 및 tf.nn.rnncell.BasicRNNCell 은 거의 같 아 요.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
EMNIST에서 알파벳 필기 인식EMNIST-letters를 배웠습니다. CODE: DEMO: — mbotsu (@mb_otsu) 은 2017년에 NIST가 공개한 데이터세트입니다. EMNIST ByClass: 814,255 characters. ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.