Python model.get_embedder() Examples

The following are 12 code examples of model.get_embedder(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module model , or try the search function .
Example #1
Source File: mvtcn_estimator.py    From yolo_v2 with Apache License 2.0 6 votes vote down vote up
def forward(self, images_concat, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    loss_strategy = self._config.loss_strategy
    l2_normalize_embedding = self._config[loss_strategy].embedding_l2
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images_concat,
        is_training=is_training,
        l2_normalize_embedding=l2_normalize_embedding, reuse=reuse)
    embeddings_concat = embedder.construct_embedding()
    variables_to_train = embedder.get_trainable_variables()
    self.variables_to_train = variables_to_train
    self.pretrained_init_fn = embedder.init_fn
    return embeddings_concat 
Example #2
Source File: mvtcn_estimator.py    From Gun-Detector with Apache License 2.0 6 votes vote down vote up
def forward(self, images_concat, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    loss_strategy = self._config.loss_strategy
    l2_normalize_embedding = self._config[loss_strategy].embedding_l2
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images_concat,
        is_training=is_training,
        l2_normalize_embedding=l2_normalize_embedding, reuse=reuse)
    embeddings_concat = embedder.construct_embedding()
    variables_to_train = embedder.get_trainable_variables()
    self.variables_to_train = variables_to_train
    self.pretrained_init_fn = embedder.init_fn
    return embeddings_concat 
Example #3
Source File: mvtcn_estimator.py    From object_detection_with_tensorflow with MIT License 6 votes vote down vote up
def forward(self, images_concat, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    loss_strategy = self._config.loss_strategy
    l2_normalize_embedding = self._config[loss_strategy].embedding_l2
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images_concat,
        is_training=is_training,
        l2_normalize_embedding=l2_normalize_embedding, reuse=reuse)
    embeddings_concat = embedder.construct_embedding()
    variables_to_train = embedder.get_trainable_variables()
    self.variables_to_train = variables_to_train
    self.pretrained_init_fn = embedder.init_fn
    return embeddings_concat 
Example #4
Source File: mvtcn_estimator.py    From g-tensorflow-models with Apache License 2.0 6 votes vote down vote up
def forward(self, images_concat, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    loss_strategy = self._config.loss_strategy
    l2_normalize_embedding = self._config[loss_strategy].embedding_l2
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images_concat,
        is_training=is_training,
        l2_normalize_embedding=l2_normalize_embedding, reuse=reuse)
    embeddings_concat = embedder.construct_embedding()
    variables_to_train = embedder.get_trainable_variables()
    self.variables_to_train = variables_to_train
    self.pretrained_init_fn = embedder.init_fn
    return embeddings_concat 
Example #5
Source File: mvtcn_estimator.py    From models with Apache License 2.0 6 votes vote down vote up
def forward(self, images_concat, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    loss_strategy = self._config.loss_strategy
    l2_normalize_embedding = self._config[loss_strategy].embedding_l2
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images_concat,
        is_training=is_training,
        l2_normalize_embedding=l2_normalize_embedding, reuse=reuse)
    embeddings_concat = embedder.construct_embedding()
    variables_to_train = embedder.get_trainable_variables()
    self.variables_to_train = variables_to_train
    self.pretrained_init_fn = embedder.init_fn
    return embeddings_concat 
Example #6
Source File: mvtcn_estimator.py    From multilabel-image-classification-tensorflow with MIT License 6 votes vote down vote up
def forward(self, images_concat, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    loss_strategy = self._config.loss_strategy
    l2_normalize_embedding = self._config[loss_strategy].embedding_l2
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images_concat,
        is_training=is_training,
        l2_normalize_embedding=l2_normalize_embedding, reuse=reuse)
    embeddings_concat = embedder.construct_embedding()
    variables_to_train = embedder.get_trainable_variables()
    self.variables_to_train = variables_to_train
    self.pretrained_init_fn = embedder.init_fn
    return embeddings_concat 
Example #7
Source File: svtcn_estimator.py    From yolo_v2 with Apache License 2.0 5 votes vote down vote up
def forward(self, images, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images,
        is_training=is_training, reuse=reuse)
    embeddings = embedder.construct_embedding()

    if is_training:
      self.variables_to_train = embedder.get_trainable_variables()
      self.pretrained_init_fn = embedder.init_fn
    return embeddings 
Example #8
Source File: svtcn_estimator.py    From Gun-Detector with Apache License 2.0 5 votes vote down vote up
def forward(self, images, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images,
        is_training=is_training, reuse=reuse)
    embeddings = embedder.construct_embedding()

    if is_training:
      self.variables_to_train = embedder.get_trainable_variables()
      self.pretrained_init_fn = embedder.init_fn
    return embeddings 
Example #9
Source File: svtcn_estimator.py    From object_detection_with_tensorflow with MIT License 5 votes vote down vote up
def forward(self, images, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images,
        is_training=is_training, reuse=reuse)
    embeddings = embedder.construct_embedding()

    if is_training:
      self.variables_to_train = embedder.get_trainable_variables()
      self.pretrained_init_fn = embedder.init_fn
    return embeddings 
Example #10
Source File: svtcn_estimator.py    From g-tensorflow-models with Apache License 2.0 5 votes vote down vote up
def forward(self, images, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images,
        is_training=is_training, reuse=reuse)
    embeddings = embedder.construct_embedding()

    if is_training:
      self.variables_to_train = embedder.get_trainable_variables()
      self.pretrained_init_fn = embedder.init_fn
    return embeddings 
Example #11
Source File: svtcn_estimator.py    From models with Apache License 2.0 5 votes vote down vote up
def forward(self, images, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images,
        is_training=is_training, reuse=reuse)
    embeddings = embedder.construct_embedding()

    if is_training:
      self.variables_to_train = embedder.get_trainable_variables()
      self.pretrained_init_fn = embedder.init_fn
    return embeddings 
Example #12
Source File: svtcn_estimator.py    From multilabel-image-classification-tensorflow with MIT License 5 votes vote down vote up
def forward(self, images, is_training, reuse=False):
    """See base class."""
    embedder_strategy = self._config.embedder_strategy
    embedder = model_module.get_embedder(
        embedder_strategy,
        self._config,
        images,
        is_training=is_training, reuse=reuse)
    embeddings = embedder.construct_embedding()

    if is_training:
      self.variables_to_train = embedder.get_trainable_variables()
      self.pretrained_init_fn = embedder.init_fn
    return embeddings