wouellette / ee-dynamic-time-warping Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Hey,
I'm trying to implement this library for dtw and am encountering memory issues within GEE.
Are there any hard limits in terms of the amount of images in the time-series, or number of sample points, number of labels, or overall region size that you are aware of?
Just as a test I'm trying to export dtw_class and the task does run for a long while
Everything before this step is fine, however the output from this function can't be printed or exported.
`var dtw_min_dist = function(key, val){
key = ee.Number.parse(key);
// Function to format the signatures to a DTW-ready EE array
var training_data_list = DTW.prepareSignatures(reference_signatures,
CLASS_NAME,
key,
BAND_NO,
PATTERNS_LEN,
band_names);
// Compute the class-wise DTW distance
return ee.ImageCollection(DTW.DTWDist(training_data_list,
s2_input_asset.select("d_0_NDVI"),
{patterns_no: val,
band_no: BAND_NO,
timeseries_len: TIMESERIES_LEN,
patterns_len: PATTERNS_LEN,
constraint_type: 'time-weighted',
distance_type: 'angular',
beta: BETA,
alpha: ALPHA
})
).min()
.rename('dtw')
// Add class band corresponding to the land cover/crop class computed.
// This is useful/necessary to generate the hard classification map from the dissimilarity values
.addBands(ee.Image(key).toByte().rename('band'));
};`
For the variables:
// Input data parameters var CLASS_NAME = 'labelno'; var AGG_INTERVAL = 5; var TIMESERIES_LEN = 37; var PATTERNS_LEN = 37; var CLASS_NO = 6; var S2_BAND_LIST = ["d_0_NDVI"]; var BAND_NO = S2_BAND_LIST.length; var DOY_BAND = 'doy';
Where the number of number of signatures is 331
AOI size is ~3700 km2
Dear William Ouellette,
I am trying to adapt the code for my dataset and I am getting the following error:
DTW classification: Layer error: Array.reshape: Shape incompatible with array's existing dimensions: [-1, 8, 6] vs. [268, 40].
DTW dissimilarity score: Layer error: Array.reshape: Shape incompatible with array's existing dimensions: [-1, 8, 6] vs. [268, 40].
I am a beginner in google earth engine, could you help me find where I am going wrong?
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.