Module neuralops.experiment_utils.model
Module providing model implementations for NeuralOps.
Functions
def load_model(cfg: Any, num_labels: int, device: str = 'auto') ‑> Any-
Expand source code
def load_model(cfg: Any, num_labels: int, device: str = "auto") -> Any: """Load model using config and num_labels.""" config = AutoConfig.from_pretrained(cfg.model_name, num_labels=num_labels) model = AutoModelForSequenceClassification.from_pretrained(cfg.model_name, config=config) fix_layernorm_naming(model) if device == "auto": device = "cuda" if torch.cuda.is_available() else "cpu" model.to(device) return modelLoad model using config and num_labels.
Classes
class TrainingRun (id: Any = None,
name: str = '',
status: str = 'completed',
created_at: datetime.datetime = <factory>,
config: dict[str, typing.Any] = <factory>,
final_metrics: dict[str, typing.Any] = <factory>,
training_history: dict[str, typing.Any] = <factory>,
actual_duration: float = 0.0,
objects: Any = <neuralops.experiment_utils.model._MockObjectsManager object>)-
Expand source code
@dataclass class TrainingRun: """Dataclass representing a training run for comparison and logging.""" id: Any = None name: str = "" status: str = "completed" created_at: datetime = field(default_factory=datetime.now) config: dict[str, Any] = field(default_factory=dict) final_metrics: dict[str, Any] = field(default_factory=dict) training_history: dict[str, Any] = field(default_factory=dict) actual_duration: float = 0.0 objects: Any = _MockObjectsManager()Dataclass representing a training run for comparison and logging.
Instance variables
var actual_duration : float-
The type of the None singleton.
var config : dict[str, typing.Any]-
The type of the None singleton.
var created_at : datetime.datetime-
The type of the None singleton.
var final_metrics : dict[str, typing.Any]-
The type of the None singleton.
var id : Any-
The type of the None singleton.
var name : str-
The type of the None singleton.
var objects : Any-
The type of the None singleton.
var status : str-
The type of the None singleton.
var training_history : dict[str, typing.Any]-
The type of the None singleton.