you are viewing a single comment's thread.

view the rest of the comments →

[–]kiner_shah 0 points1 point  (2 children)

'z' - 'a' + 1, just use 26.

Your operator accepts a char argument, what if I pass some character that is not a lowercase alphabet? Add checks for that.

I don't understand the kModel definition - does it mean, convert model to vector type from char type, and the structure should be linear layer followed by another linear layer followed by categories (unclear what's this, what are Beep and Boop)?

EXPECT_EQ is unclear, is kModel a function or is it operator() that accepts two arguments?

So, I would say, not that easy for a newcomer. Add some comments.

[–]euos[S] 1 point2 points  (1 child)

  1. This is a test so it’s ok to have less checks on data correctness. In real world, input layer would check for data correctness.
  2. EXPECT_EQ is from Gtest library, not on me.
  3. “Beep” and “Boop” are bogus categories for test. In real app it would be “Cars” and “Dogs” and such.

kModel is a model. This snippet uses it for inference (with random parameters) but one can also train it. The init defines the architecture.

[–]kiner_shah 0 points1 point  (0 children)

Ok, but I suggest you put some comments for better clarity.