# 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
# coding=utf-8
# Copyright 2022 The Meta-Dataset Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python2, python3
"""Baseline learners."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



# TODO(eringrant): Factor out all the different variants for episodic evaluation
# into different classes rather than relying on conditional statements.
@gin.configurable

# 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

# coding=utf-8
# Copyright 2022 The Meta-Dataset Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python2, python3
"""Baseline learners."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function



# TODO(eringrant): Factor out all the different variants for episodic evaluation
# into different classes rather than relying on conditional statements.
@gin.configurable

class BaselineLearner(learner_base.BatchLearner):