Markov.ModelActions (markov v4.1.3)

Performs training, generation and probability shifting. Supposed to only ever be used by Markov.ModelServers.

Link to this section Summary

Link to this section Functions

Link to this function

adjust_batch_probs(params)

Adjust the probabilities of a batch of connections

Link to this function

adjust_one_prob(param_tensor)

Adjusts the probability of one connection

Link to this function

generate(state, tag_query)

@spec generate(Markov.ModelServer.State.t(), Markov.tag_query()) ::
  {{:ok, [term()]} | {:error, term()}, Markov.ModelServer.State.t()}
Link to this function

next_state(state, current, tag_query)

Link to this function

process_scores(rows, tag_scores)

@spec process_scores([{term(), non_neg_integer(), term()}], Markov.tag_query()) :: %{
  required(term()) => non_neg_integer()
}

processes tag scores

Link to this function

train(state, tokens, tags)

@spec train(
  state :: Markov.ModelServer.State.t(),
  tokens :: [term()],
  tags :: [term()]
) :: :ok
Link to this function

walk_chain(state, acc, queue, limit, tag_query)

@spec walk_chain(
  Markov.ModelServer.State.t(),
  [term()],
  [term()],
  non_neg_integer(),
  Markov.tag_query()
) :: {{:ok, [term()]} | {:error, term()}, Markov.ModelServer.State.t()}