params_cnt.sh 340 B

123456789101112
  1. NLAYERS=32
  2. NHIDDEN=2048
  3. NHEADS=32
  4. SEQ_LEN=64
  5. VOCAB_SIZE=32000
  6. MODEL_SIZE=$((($NLAYERS * (12*$NHIDDEN**2 + 13*$NHIDDEN) + ($VOCAB_SIZE * $NHIDDEN) + ($SEQ_LEN * $NHIDDEN) ) / 10**9))
  7. EXACT_MODEL_SIZE=$(($NLAYERS * (12*$NHIDDEN**2 + 13*$NHIDDEN) + ($VOCAB_SIZE * $NHIDDEN) + ($SEQ_LEN * $NHIDDEN) ))
  8. echo $MODEL_SIZE
  9. echo $EXACT_MODEL_SIZE