docstr: Initializes the network, optimizer and scheduler
docstr_tok: ["Initializes","the","network",",","optimizer","and","scheduler"]
code: def __init__(self, dataset, lr):
      """
      Initializes the network, optimizer and scheduler
      """
      super().__init__()
      self.dataset = dataset
      self.lr = lr
      self.PRE_TRAINED_MODEL_NAME = "bert-base-uncased"
      self.bert_model = BertModel.from_pretrained(
          self.PRE_TRAINED_MODEL_NAME
      )
      for param in self.bert_model.parameters():
          param.requires_grad = False
      self.drop = nn.Dropout(p=0.2)
      # assigning labels
      self.class_names = (
          [
              "alt.atheism",
              "talk.religion.misc",
              "comp.graphics",
              "sci.space",
          ]
          if self.dataset == "20newsgroups"
          else ["world", "Sports", "Business", "Sci/Tech"]
      )
      n_classes = len(self.class_names)
  
      self.fc1 = nn.Linear(self.bert_model.config.hidden_size, 512)
      self.out = nn.Linear(512, n_classes)
  
      self.scheduler = None
      self.optimizer = None
      self.val_outputs = []
      self.test_outputs = []
  
imports: import math
  import os
  import lightning
  import pandas
  import torch
  import torch.nn.functional
  import torchtext.datasets
  from lightning.pytorch.callbacks import EarlyStopping, LearningRateMonitor, ModelCheckpoint
  from lightning.pytorch.cli import LightningCLI
  from sklearn.datasets import fetch_20newsgroups
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import train_test_split
  from torch import nn
  from torch.utils.data import DataLoader
  from torch.utils.data.dataset import random_split
  from torchdata.datapipes.iter import IterDataPipe
  from torchtext.data.functional import to_map_style_dataset
  from torchtext.datasets import AG_NEWS
  from transformers import BertModel, BertTokenizer
  import mlflow.pytorch
label_desc: Use image node_id 1 to create a new BertNewsClassifier object from inherited base class: L with example: obj = BertNewsClassifier(dataset, lr)