Raxol. Adaptive. NxModel
(Raxol v2.6.0)
View Source
Axon MLP for layout recommendation inference and training.
Replaces the rule-based LayoutRecommender.apply_rules/2 with a
small neural network when Axon is available. The model processes
per-pane features and predicts the best layout action.
Features (per pane)
dwell_pct-- fraction of total dwell time spent on this paneis_most_used-- 1.0 if this pane has the highest dwell timeis_least_used-- 1.0 if this pane is in the least-used setalert_response_norm-- normalized average alert response time
Actions
:hide, :show, :expand, :shrink, :none
Summary
Functions
Encode an action atom as a one-hot tensor of shape {@num_actions}.
Returns the ordered list of action atoms.
Build the Axon model graph.
Returns the compiled {init_fn, predict_fn} pair, cached via persistent_term.
Extract per-pane feature tensors from a behavior aggregate.
Returns the number of input features per pane.
Initialize random model parameters.
Interpret model output into ranked pane action recommendations.
Returns the model version for parameter compatibility checking.
Run inference on feature tensor, returns action probabilities.
Train the model on accumulated feedback data.
Functions
@spec action_to_one_hot(atom()) :: Nx.Tensor.t()
Encode an action atom as a one-hot tensor of shape {@num_actions}.
@spec actions() :: [:hide | :show | :expand | :shrink | :none, ...]
Returns the ordered list of action atoms.
@spec build_model() :: Axon.t()
Build the Axon model graph.
Architecture: input(10) -> dense(32, relu) -> dense(16, relu) -> dense(5, softmax)
Returns the compiled {init_fn, predict_fn} pair, cached via persistent_term.
@spec extract_features(map(), [atom()]) :: {Nx.Tensor.t(), [atom()]}
Extract per-pane feature tensors from a behavior aggregate.
Returns {features_tensor, pane_ids} where features_tensor has
shape [n_panes, 10].
Features (per pane)
dwell_pct-- fraction of total dwell timeis_most_used-- 1.0 if highest dwellis_least_used-- 1.0 if in least-used setalert_response_norm-- normalized alert response timescroll_freq_norm-- normalized scroll frequencyscroll_vel_norm-- normalized scroll velocitycommand_conc_pct-- fraction of commands targeting this panetakeover_pct-- fraction of takeover time on this panepane_count_norm-- total panes / 10 (normalized)dwell_rank_norm-- rank position / pane_count (0.0 = most used, 1.0 = least)
@spec feature_size() :: 10
Returns the number of input features per pane.
@spec init_params() :: map()
Initialize random model parameters.
@spec interpret_predictions(Nx.Tensor.t(), [atom()]) :: [{atom(), atom(), float()}]
Interpret model output into ranked pane action recommendations.
Returns a list of {pane_id, action, confidence} tuples sorted
by confidence descending, excluding :none actions.
@spec model_version() :: 2
Returns the model version for parameter compatibility checking.
@spec predict(map(), Nx.Tensor.t()) :: Nx.Tensor.t()
Run inference on feature tensor, returns action probabilities.
@spec train( [{Nx.Tensor.t(), Nx.Tensor.t()}], keyword() ) :: map()
Train the model on accumulated feedback data.
training_data is a list of {features_tensor, label_tensor} tuples
where features is {1, 4} and label is {5} (one-hot).
Returns trained model parameters.