MCPcopy
hub / github.com/hanzhanggit/StackGAN / build_encoder

Function build_encoder

misc/skipthoughts.py:286–300  ·  view source on GitHub ↗

build an encoder, given pre-computed word embeddings

(tparams, options)

Source from the content-addressed store, hash-verified

284
285
286def build_encoder(tparams, options):
287 """
288 build an encoder, given pre-computed word embeddings
289 """
290 # word embedding (source)
291 embedding = tensor.tensor3('embedding', dtype='float32')
292 x_mask = tensor.matrix('x_mask', dtype='float32')
293
294 # encoder
295 proj = get_layer(options['encoder'])[1](tparams, embedding, options,
296 prefix='encoder',
297 mask=x_mask)
298 ctx = proj[0][-1]
299
300 return embedding, x_mask, ctx
301
302
303def build_encoder_bi(tparams, options):

Callers 1

load_modelFunction · 0.85

Calls 1

get_layerFunction · 0.85

Tested by

no test coverage detected