andrewzm / deepide Goto Github PK
View Code? Open in Web Editor NEWDeep IDE Models for Spatio-Temporal Forecasting
Deep IDE Models for Spatio-Temporal Forecasting
Hello,
If I want to predict data with independent variables (influencing factors), how do I get the coefficients of the independent variables and and get the statistical significance?
Looking forward to your reply,Best wishes!
Lino
Excuse me, I met problem when downloading the data from the website you provided. If it is convenient for you, could you please send me the SST data to [email protected]. Thank you very much!
Hi, Andrewzm. When I "run validation...", the following code:
`## For each epoch
for(epoch in 1:nepochs) {
cat("Running validation... \n")
N_Val_Batches <- floor(length(idxVal)/32L) # about 237 , ้ช่ฏ
Val_Batch_idx <- rep(1:N_Val_Batches, each = 32L) # batch ID
if((partbatch <- length(idxVal) %% 32L) > 0) { # if not an exact multiple of 32
N_Val_Batches <- N_Val_Batches + 1 # then there is an extra batch
Val_Batch_idx <- c(Val_Batch_idx, rep(N_Val_Batches, partbatch))
}
val_batches <- data.frame(idx = idxVal,
batch = Val_Batch_idx)
ValCosts <- lapply(unique(val_batches$batch), function(i) {
idx_val <- filter(val_batches, batch == i)$idx
fd <- dict(data_in = d[idx_val,,,],
data_current = dfinal[idx_val,,,drop=F],
data_future = dpred[idx_val,,,drop=F])
run(Cost1, feed_dict = fd)
})
Epoch_val[epoch, ] <- c(mean(unlist(ValCosts)),
median(unlist(ValCosts)),
sd(unlist(ValCosts)),
mad(unlist(ValCosts)))
epoch_order <- idxTrain
count <- 0
Objective[[epoch]] <- Objective_val[[epoch]] <- rep(0, nsteps_per_epoch)
while(length(epoch_order) >= N_Batch) {
train_cov_pars <- (epoch >= (28L)) # Estimate cov. pars if epoch >= 28
count <- count + 1 # increment batch number in epoch
idx <- epoch_order[1:N_Batch] # Take first N_Batch
epoch_order <- epoch_order[-(1:N_Batch)] # Remove first batch from list
fd <- dict(data_in = d[idx,,,], # Creat dictionary
data_current = dfinal[idx,,,drop=F],
data_future = dpred[idx,,,drop=F])
if(train_cov_pars) {
TFrun <- run(list(trainnetcov, Cost1), feed_dict = fd)
} else {
TFrun <- run(list(trainnet, Cost1), feed_dict = fd) # Train network on its own
}
## Get Cost for this batch
Objective[[epoch]][count] <- TFrun[[2]]
## Every 10 samples do a random validation check
if((count %% 10) == 0) {
idx_val <- sample(idxVal, N_Batch, replace = FALSE)
fd <- dict(data_in = d[idx_val,,,],
data_current = dfinal[idx_val,,,drop=F],
data_future = dpred[idx_val,,,drop=F])
Objective_val[[epoch]][count/10] <- run(Cost1, feed_dict = fd)
cat(paste0("Epoch ", epoch, " ... Step ", count,
" ... Cost: ", Objective_val[[epoch]][count/10], "\n"))
}
Epoch_train[epoch, ] <- c(mean(Objective[[epoch]]),
median(Objective[[epoch]]),
sd(Objective[[epoch]]),
mad(Objective[[epoch]]))
}
}
`
There's an error:
Error in py_call_impl(callable, dots$args, dots$keywords) :
ValueError: Dimensions must be equal, but are 64 and 3 for 'Less_2' (op: 'Less') with input shapes: [?,64,64], [?,64,64,3].
Could you please help me? Thanks.
When I run the following code for file 2_1 fit_CNNIDE_stage1,:
`while(length(epoch_order) >= N_Batch) {
train_cov_pars <- (epoch >= (28L)) # Estimate cov. pars if epoch >= 28
count <- count + 1 # increment batch number in epoch
idx <- epoch_order[1:N_Batch] # Take first N_Batch
epoch_order <- epoch_order[-(1:N_Batch)] # Remove first batch from list
fd <- dict(data_in = d[idx,,,], # Creat dictionary
data_current = dfinal[idx,,,drop=F],
data_future = dpred[idx,,,drop=F])
if(train_cov_pars) {
TFrun <- run(list(trainnetcov, Cost1), feed_dict = fd)
} else {
TFrun <- run(list(trainnet, Cost1), feed_dict = fd) # Train network on its own
}
## Get Cost for this batch
Objective[[epoch]][count] <- TFrun[[2]]
## Every 10 samples do a random validation check
if((count %% 10) == 0) {
idx_val <- sample(idxVal, N_Batch, replace = FALSE)
fd <- dict(data_in = d[idx_val,,,],
data_current = dfinal[idx_val,,,drop=F],
data_future = dpred[idx_val,,,drop=F])
Objective_val[[epoch]][count/10] <- run(Cost1, feed_dict = fd)
cat(paste0("Epoch ", epoch, " ... Step ", count,
" ... Cost: ", Objective_val[[epoch]][count/10], "\n"))
}
Epoch_train[epoch, ] <- c(mean(Objective[[epoch]]),
median(Objective[[epoch]]),
sd(Objective[[epoch]]),
mad(Objective[[epoch]]))
}
}
`
##Error in d[idx_val, , , ] : The subscript out
How can I fix it? Thank you very much!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.