class_docstr: ## Configurations
  
  These are default configurations which can later be adjusted by passing a `dict`.
class_docstr_tok: ["#","#","Configurations","These","are","default","configurations","which","can","later","be","adjusted","by","passing","a","`","dict","`","."]
code: def init(self):
      # Initialize encoder & decoder
      self.encoder = EncoderRNN(self.d_z, self.enc_hidden_size).to(
          self.device
      )
      self.decoder = DecoderRNN(
          self.d_z, self.dec_hidden_size, self.n_distributions
      ).to(self.device)
  
      # Set optimizer. Things like type of optimizer and learning rate are configurable
      optimizer = OptimizerConfigs()
      optimizer.parameters = list(self.encoder.parameters()) + list(
          self.decoder.parameters()
      )
      self.optimizer = optimizer
  
      # Create sampler
      self.sampler = Sampler(self.encoder, self.decoder)
  
      # `npz` file path is `data/sketch/[DATASET NAME].npz`
      path = lab.get_data_path() / "sketch" / f"{self.dataset_name}.npz"
      # Load the numpy file
      dataset = np.load(str(path), encoding="latin1", allow_pickle=True)
  
      # Create training dataset
      self.train_dataset = StrokesDataset(
          dataset["train"], self.max_seq_length
      )
      # Create validation dataset
      self.valid_dataset = StrokesDataset(
          dataset["valid"],
          self.max_seq_length,
          self.train_dataset.scale,
      )
  
      # Create training data loader
      self.train_loader = DataLoader(
          self.train_dataset, self.batch_size, shuffle=True
      )
      # Create validation data loader
      self.valid_loader = DataLoader(
          self.valid_dataset, self.batch_size
      )
  
      # Add hooks to monitor layer outputs on Tensorboard
      hook_model_outputs(self.mode, self.encoder, "encoder")
      hook_model_outputs(self.mode, self.decoder, "decoder")
  
      # Configure the tracker to print the total train/validation loss
      tracker.set_scalar("loss.total.*", True)
  
      self.state_modules = []
  
imports: import math
  from typing import Optional, Tuple, Any
  import numpy
  import torch
  import torch.nn
  from matplotlib import pyplot
  from torch import optim
  from torch.utils.data import Dataset, DataLoader
  import einops
  from labml import lab, experiment, tracker, monit
  from labml_helpers.device import DeviceConfigs
  from labml_helpers.module import Module
  from labml_helpers.optimizer import OptimizerConfigs
  from labml_helpers.train_valid import TrainValidConfigs, hook_model_outputs, BatchIndex
label_desc: Use image node_id 1 for calling the Configs obj's underlying member method code with example usage: obj.init() without return types