classify signals using transformer

29 visualizaciones (últimos 30 días)
MAHMOUD EID
MAHMOUD EID el 8 de Feb. de 2024
Comentada: MAHMOUD EID el 27 de Feb. de 2024
How to classify signals using transformers instead of 1-D CNN?

Respuestas (1)

Yatharth
Yatharth el 26 de Feb. de 2024
I am not sure what do you mean by signals. As per my understanding CNN are used to classify images.
For image classification using Vision Transformer (ViT) networks, you can find detailed instructions and a pretrained ViT network on the MathWorks website here : https://www.mathworks.com/help/vision/ug/transfer-learning-using-pretrained-vit-network.html
Additionally, the MathWorks team has provided an implementation of several variants of the Vision Transformer model on MATLAB Central File Exchange. You can access it here. https://www.mathworks.com/matlabcentral/fileexchange/129739-computer-vision-toolbox-model-for-vision-transformer-network
I recommend exploring the discussion section of the File Exchange entry, where you'll find valuable insights and examples. In particular, there's a code snippet provided by a user named Muhammad that demonstrates how to modify the classification layers of a network.
lgraph = removeLayers(lgraph, {'head','softmax'});
numClass = 100;
newLayers = [
fullyConnectedLayer(numClass,'Name','fc','WeightLearnRateFactor',10,'BiasLearnRateFactor',10)
softmaxLayer('Name','softmax')
classificationLayer('Name','classoutput')];
lgraph = addLayers(lgraph,newLayers);
lgraph = connectLayers(lgraph,'cls_index' ,'fc');
These resources should help you get started with using transformers for classification tasks, whether they involve images or signals / matrix.
  1 comentario
MAHMOUD EID
MAHMOUD EID el 27 de Feb. de 2024
Hi, I mean classifying 1-d signals as a sequecence using transformer same as 1D-CNN or LSTM

Iniciar sesión para comentar.

Categorías

Más información sobre Recognition, Object Detection, and Semantic Segmentation en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by