class_docstr: Training instances for the sLCWA.
class_docstr_tok: ["Training","instances","for","the","sLCWA","."]
docstr: Initialize the sLCWA instances.
  
  :param mapped_triples: shape: (num_triples, 3)
      the ID-based triples, passed to the negative sampler
  :param num_entities: >0
      the number of entities, passed to the negative sampler
  :param num_relations: >0
      the number of relations, passed to the negative sampler
  :param negative_sampler:
      the negative sampler, or a hint thereof
  :param negative_sampler_kwargs:
      additional keyword-based arguments passed to the negative sampler
docstr_tok: ["Initialize","the","sLCWA","instances",".",":","param","mapped_triples",":","shape",":","(","num_triples",",","3",")","the","ID-based","triples",",","passed","to","the","negative","sampler",":","param","num_entities",":",">","0","the","number","of","entities",",","passed","to","the","negative","sampler",":","param","num_relations",":",">","0","the","number","of","relations",",","passed","to","the","negative","sampler",":","param","negative_sampler",":","the","negative","sampler",",","or","a","hint","thereof",":","param","negative_sampler_kwargs",":","additional","keyword-based","arguments","passed","to","the","negative","sampler"]
code: def __init__(
      self,
      *,
      mapped_triples: MappedTriples,
      num_entities: Optional[int] = None,
      num_relations: Optional[int] = None,
      negative_sampler: HintOrType[NegativeSampler] = None,
      negative_sampler_kwargs: OptionalKwargs = None,
  ):
      """Initialize the sLCWA instances.
  
      :param mapped_triples: shape: (num_triples, 3)
          the ID-based triples, passed to the negative sampler
      :param num_entities: >0
          the number of entities, passed to the negative sampler
      :param num_relations: >0
          the number of relations, passed to the negative sampler
      :param negative_sampler:
          the negative sampler, or a hint thereof
      :param negative_sampler_kwargs:
          additional keyword-based arguments passed to the negative sampler
      """
      self.mapped_triples = mapped_triples
      self.sampler = negative_sampler_resolver.make(
          negative_sampler,
          pos_kwargs=negative_sampler_kwargs,
          mapped_triples=mapped_triples,
          num_entities=num_entities,
          num_relations=num_relations,
      )
  
imports: import math
  from abc import ABC, abstractmethod
  from typing import Callable, Generic, Iterable, Iterator, List, NamedTuple, Optional, Tuple, TypeVar
  import numpy
  import scipy.sparse
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from torch.utils import data
  from .utils import compute_compressed_adjacency_list
  from ..sampling import NegativeSampler, negative_sampler_resolver
  from ..typing import MappedTriples
label_desc: Use image node_id 1 to create a new SLCWAInstances object from inherited base classes: Instances with example: obj = SLCWAInstances()