Code Monkey home page Code Monkey logo

deepide's People

Contributors

andrewzm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

deepide's Issues

SST data

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!

Error in py_call_impl(callable, dots$args, dots$keywords) :

Hi, Andrewzm. When I "run validation...", the following code:
`## For each epoch
for(epoch in 1:nepochs) {

Do all validation cases

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))
}

Create an idx--batch map

val_batches <- data.frame(idx = idxVal,
batch = Val_Batch_idx)

For each batch compute the NLL

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)
})

Compute summary statistics at this epoch

Epoch_val[epoch, ] <- c(mean(unlist(ValCosts)),
median(unlist(ValCosts)),
sd(unlist(ValCosts)),
mad(unlist(ValCosts)))

Initialise

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.

Error in d[idx_val, , , ] : The subscript out

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.