MCPcopy Create free account
hub / github.com/apache/singa / __init__

Method __init__

python/singa/layer.py:471–481  ·  view source on GitHub ↗

init the Embedding operator Args: input_dim (int): the number of different words in the dictionary output_dim (int): the dimendion of a word after the embedding initializer (str, optional): weight initializer, can be [uniform, gaussian]. Defaults to "unifo

(self, input_dim, output_dim, initializer="gaussian")

Source from the content-addressed store, hash-verified

469 """
470
471 def __init__(self, input_dim, output_dim, initializer="gaussian"):
472 """init the Embedding operator
473 Args:
474 input_dim (int): the number of different words in the dictionary
475 output_dim (int): the dimendion of a word after the embedding
476 initializer (str, optional): weight initializer, can be [uniform, gaussian]. Defaults to "uniform".
477 """
478 super(Embedding, self).__init__()
479 self.input_dim = input_dim
480 self.output_dim = output_dim
481 self.initializer = initializer
482
483 def initialize(self, x):
484 w_shape = (self.input_dim, self.output_dim)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected