Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct evaluable placeholder(int dims, int *shape);
- struct evaluable variable(int dims, int *shape);
- struct evaluable constant(int dims, int *shape);
- struct evaluable add(struct evaluable *a, struct evaluable *b);
- struct evaluable mul(struct evaluable *a, struct evaluable *b);
- struct evaluable dot(struct evaluable *a, struct evaluable *b, int dims_num, int *a_dims, int *b_dims);
- struct evaluable sum(struct evaluable *a, int dims_num = 0, int *dims = 0);
- struct evaluable sigmoid(struct evaluable *a);
- struct evaluable tanh(struct evaluable *a);
- enum eval_type {
- CONSTANT,
- PLACEHOLDER,
- VARIABLE,
- OPERATOR
- };
- struct evaluable {
- int dims;
- int *shape;
- eval_type type;
- double *value;
- void *object;
- };
- enum op_type {
- ELEMENT_WISE,
- UNARY,
- VARIABLE,
- OPERATOR
- };
- struct operator {
- struct evaluable *args;
- op_type type;
- }
- /*
- operator
- identity
- add
- subtract
- mul(evaluable *left, evaluable *right)
- dot(evaluable *left, evaluable *right, int left_dims_size, int *left_dims, int left_dims_size, int *left_dims)
- mul()
- value -> double
- mapped
- map
- gradient
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement