# Path: meta_dataset/learners/base.py
# class Learner(object):
# class EpisodicLearner(Learner):
# class BatchLearner(Learner):
#   def __init__(
#       self,
#       is_training,
#       logit_dim,
#       transductive_batch_norm,
#       backprop_through_moments,
#       embedding_fn,
#       input_shape,
#   ):
#   def build(self):
#   def compute_regularizer(self):
#   def compute_loss(self, onehot_labels, predictions):
#   def compute_accuracy(self, onehot_labels, predictions):
#   def forward_pass(self, data):
# 
# Path: meta_dataset/models/functional_classifiers.py
# def linear_classifier_forward_pass(embeddings, w_fc, b_fc, cosine_classifier,
#                                    cosine_logits_multiplier, use_weight_norm):
# def linear_classifier(embeddings, num_classes, cosine_classifier,
#                       cosine_logits_multiplier, use_weight_norm, weight_decay):
#     def _do_data_dependent_init():
# def separate_head_linear_classifier(embeddings, num_classes, dataset_idx,
#                                     start_idx, cosine_classifier,
#                                     cosine_logits_multiplier, learnable_scale,
#                                     weight_decay):


import functools
import gin.tf
import numpy as np
import tensorflow.compat.v1 as tf
from meta_dataset.learners import base as learner_base
from meta_dataset.models import functional_classifiers
      query_embeddings = self.embedding_fn(
          data.query_images,
          self.is_training,
          moments=support_set_moments,
          backprop_through_moments=self.backprop_through_moments)
      query_embeddings = query_embeddings['embeddings']

      # TODO(eringrant): The `BaselineFinetuneLearner` subclass is not yet
      # refactored to obey the interface of `Learner.compute_logits`.
      if self.obeys_compute_logits_interface:
        query_logits = self.compute_logits(support_embeddings, query_embeddings,
                                           data.onehot_support_labels)
      else:
        query_logits = self.compute_logits(data)  # pylint: disable=no-value-for-parameter

      return query_logits

  def forward_pass_fc(self, embeddings):
    """Passes the provided embeddings through the fc layer to get the logits.

    Args:
      embeddings: A Tensor of the penultimate layer activations as computed by
        BaselineLearner.forward_pass.

    Returns:
      The fc layer activations.
    """
    with tf.variable_scope('fc', reuse=tf.AUTO_REUSE):
      # Always maps to a space whose dimensionality is the number of classes
      # at meta-training time.

# Path: meta_dataset/learners/base.py
# class Learner(object):
# class EpisodicLearner(Learner):
# class BatchLearner(Learner):
#   def __init__(
#       self,
#       is_training,
#       logit_dim,
#       transductive_batch_norm,
#       backprop_through_moments,
#       embedding_fn,
#       input_shape,
#   ):
#   def build(self):
#   def compute_regularizer(self):
#   def compute_loss(self, onehot_labels, predictions):
#   def compute_accuracy(self, onehot_labels, predictions):
#   def forward_pass(self, data):
# 
# Path: meta_dataset/models/functional_classifiers.py
# def linear_classifier_forward_pass(embeddings, w_fc, b_fc, cosine_classifier,
#                                    cosine_logits_multiplier, use_weight_norm):
# def linear_classifier(embeddings, num_classes, cosine_classifier,
#                       cosine_logits_multiplier, use_weight_norm, weight_decay):
#     def _do_data_dependent_init():
# def separate_head_linear_classifier(embeddings, num_classes, dataset_idx,
#                                     start_idx, cosine_classifier,
#                                     cosine_logits_multiplier, learnable_scale,
#                                     weight_decay):


# Path: meta_dataset/learners/baseline_learners.py
import functools
import gin.tf
import numpy as np
import tensorflow.compat.v1 as tf
from meta_dataset.learners import base as learner_base
from meta_dataset.models import functional_classifiers

      query_embeddings = self.embedding_fn(
          data.query_images,
          self.is_training,
          moments=support_set_moments,
          backprop_through_moments=self.backprop_through_moments)
      query_embeddings = query_embeddings['embeddings']

      # TODO(eringrant): The `BaselineFinetuneLearner` subclass is not yet
      # refactored to obey the interface of `Learner.compute_logits`.
      if self.obeys_compute_logits_interface:
        query_logits = self.compute_logits(support_embeddings, query_embeddings,
                                           data.onehot_support_labels)
      else:
        query_logits = self.compute_logits(data)  # pylint: disable=no-value-for-parameter

      return query_logits

  def forward_pass_fc(self, embeddings):
    """Passes the provided embeddings through the fc layer to get the logits.

    Args:
      embeddings: A Tensor of the penultimate layer activations as computed by
        BaselineLearner.forward_pass.

    Returns:
      The fc layer activations.
    """
    with tf.variable_scope('fc', reuse=tf.AUTO_REUSE):
      # Always maps to a space whose dimensionality is the number of classes
      # at meta-training time.

      logits = functional_classifiers.linear_classifier(