Comments (3)
@slaweks17 very sorry for the late reply!
Could you try again with the latest? There was a typo in the op_reduce_sum
.
from cntk-r.
@slaweks17 you can define the smape similarly to how you would in python:
smape_loss <- function(z, t) {
loss <- op_reduce_mean(op_abs(t - z)/(t + z))
loss
}
linear_layer <- function(input_var, output_dim) {
input_var <- nrow(input_var)
times_p <- op_parameter(shape = c(input_dim, output_dim))
bias_p <- op_parameter(shape = output_dim)
t <- op_times(input_var, times_p)
bias_p + t
}
r <- Recurrence(LSTM(hidden_layer_dim1,
use_peepholes = LSTM_PEEP,
enable_self_stabilization = STABILIZE))(input_var)
z <- linear_layer(r, output_dim)
loss <- smape_loss(z, label)
from cntk-r.
Hi,
I followed you advice, although I had to use op_minus and op_plus instead of - and + respectively, and there was no error when calling this function below.
sMAPELoss<-function (z, output_var){
loss <- op_reduce_mean(op_element_divide(op_abs(op_minus(z,output_var)),op_plus(output_var,z)))
loss
}
But strangely, if I change op_reduce_mean() to op_reduce_sum(), I am getting the same
AttributeError: 'Variable' object has no attribute 'is_static_axis'
Anyway, thank you, I can live with mean, even if sum is a bit better. I have not tested this comprehensively, as I do not work with NNs at the moment, but I will within next few weeks.
I guess the issue can be closed in the meantime.
Regards,
Slawek
from cntk-r.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cntk-r.