lgarithm / crystalnet

crystalnet -- a mini core AI library (being refactored, see https://github.com/lgarithm/stdnn-ops)
MIT License
16 stars 3 forks source link

Symbol #9

Closed lgarithm closed 6 years ago

lgarithm commented 6 years ago

It means exactly the same in TF, e.g. [m,n] -> [m*n]


From: Luo Mai notifications@github.com Sent: Sunday, March 4, 2018 5:14:15 PM To: lgarithm/crystalnet Cc: LG; Author Subject: Re: [lgarithm/crystalnet] Symbol (#9)

@luomai commented on this pull request.


In examples/c/mnist_slp_symbol.chttps://github.com/lgarithm/crystalnet/pull/9#discussion_r172041941:

@@ -0,0 +1,49 @@ +#include + +#include + +// y = softmax(flatten(x) w + b) +s_model_t slp(shape_t *image_shape, uint8_t arity) +{

  • shape_t *lable_shape = make_shape(1, arity);
  • shape_t *weight_shape = make_shape(2, shape_dim(image_shape), arity);
  • shape_t *x_wrap_shape = make_shape(1, shape_dim(image_shape));
  • s_model_ctx_t *ctx = new_s_model_ctx();
  • symbol x = var(ctx, image_shape);
  • symbol x_ = reshape(ctx, x_wrap_shape, x);

what does reshape mean?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/lgarithm/crystalnet/pull/9#pullrequestreview-100999544, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AB8ydHMbUULgmOFuWjBUuZ_B6OEzt6hxks5ta7BngaJpZM4SbPOr.

lgarithm commented 6 years ago

new_shape is definitely required in C, free_shape could be removed by using GC.


From: Luo Mai notifications@github.com Sent: Sunday, March 4, 2018 5:16:04 PM To: lgarithm/crystalnet Cc: LG; Author Subject: Re: [lgarithm/crystalnet] Symbol (#9)

@luomai commented on this pull request.


In examples/c/mnist_slp_symbol.chttps://github.com/lgarithm/crystalnet/pull/9#discussion_r172042007:

@@ -0,0 +1,49 @@ +#include + +#include + +// y = softmax(flatten(x) w + b) +s_model_t slp(shape_t *image_shape, uint8_t arity) +{

  • shape_t *lable_shape = make_shape(1, arity);

Is it really necessary to ask users to new/free shape here?

In case of creating a complex neural network, this would largely complicate the code.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/lgarithm/crystalnet/pull/9#pullrequestreview-100999602, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AB8ydHyTJLbsobZd1fRyOyKAnDxjSZUsks5ta7DUgaJpZM4SbPOr.