Train a model to order a set of points

조회 수: 3 (최근 30일)
Ahmed
Ahmed 2023년 10월 16일
답변: Shivansh 2023년 11월 10일
I am in need of guidance or any example online that can help.
I would like to learn how to train a model in MATLAB to order a set of points based on what it has learned given the solution to some problems.
I have the following data:
SCRAMBLED is a cell array the contains X number of problems to solve, each problem consists of an array of size Nx2, where the first column is the x coordinate and the second is the y coordinate. The rows of this array are not in order and are to be ordered correctly.
SORTED is a cell array that contains X number of solutions, and it corresponds exactly to the SCRAMBLED cell array, similarily each solution contains an array of size Nx2 however the rows are now ordered to the correct order.
I would like to train a model to take in each cell of the cell array and learn how to correctly order the rows based on the solution so that if given a new scrambled array it will be able to re order it based on what it has learned. Any online tutuorials of something similar or pages that can help are much appreciated
(attached is a sample of those two cell arrays that contain the data structure i currently have)
  댓글 수: 2
Matt J
Matt J 2023년 10월 16일
It doesn't appear that your data is sorted, e.g.,
load Sample SORTED
issorted(SORTED{1},'ascend')
ans = logical
0
issorted(SORTED{1},'descend')
ans = logical
0
Ahmed
Ahmed 2023년 10월 16일
편집: Ahmed 2023년 10월 16일
the data is sorted in a way to draw out a shape and i dont think in specific function will be able to confirm that since I manually check and confirm the accurate drawing of the shapes. These shapes never intersect themselves at any point and are spose to be enclosed if the last row is connected to the first.
What I am looking to do is to potentially train the model to understand how the points are ordered to generate those enclosed shapes automatically given the rows were scrambled

댓글을 달려면 로그인하십시오.

답변 (1개)

Shivansh
Shivansh 2023년 11월 10일
Hi Ahmed,
I understand that you want to train the current arrays on a model such that it predicts the output for the “SORTED” array, given a “SCRAMBLED” array.
You can use a deep learning approach like sequence-to-sequence (Seq2Seq) modelling to train the model in MATLAB. Seq2Seq models are commonly used in natural language processing tasks, but they can also be applied to other sequence-based problems like ordering points.
Refer to the following links for more information:
  1. For sequence data workflows: https://www.mathworks.com/help/deeplearning/sequence-and-numeric-feature-data-workflows.html?s_tid=CRUX_lftnav.
  2. Example for sequence to sequence translation: https://www.mathworks.com/help/deeplearning/ug/sequence-to-sequence-translation-using-attention.html.
Hope it helps!

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by