Top Level Namespace

Defined Under Namespace

Modules: Secryst

Instance Method Summary collapse

Instance Method Details

#_get_activation_fn(activation) ⇒ Object

Raises:

  • (RuntimeError)


374
375
376
377
378
379
380
381
382
# File 'lib/secryst/transformer.rb', line 374

def _get_activation_fn(activation)
  if activation == "relu"
    return Torch::NN::F.method(:relu)
  elsif activation == "gelu"
    return Torch::NN::F.method(:gelu)
  end

  raise RuntimeError, "activation should be relu/gelu, not %s" % activation
end