src.tastenet package
Submodules
src.tastenet.data_utils module
src.tastenet.models module
- class src.tastenet.models.TasteNet(args, num_alt_features, num_sd_chars, num_classes, num_latent_vals=None, utility_structure=None)[source]
Bases:
ModuleTasteNet-MNL model for Swissmetro
- forward(x, z=None)[source]
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- lpmc_monotonic_constraints(b)[source]
Put transformation for the sake of constraints on the value of times This is only for the LPMC dataset and needs to be adapted for other datasets. b: taste parameters (N, 1): Individual taste parameters.
- class src.tastenet.models.TasteParams(layer_sizes, args, num_alt_features, num_classes, num_sd_chars, func_intercept=True, func_params=True)[source]
Bases:
ModuleNetwork for tastes