16,017,922 members

I'm a coding beginner and I would like to know how to use the transformer algorithm to predict a temperature field. Can you provide me with a step-by-step guide or code example on how to do this? The detailed requirements of my question are as follows：

Using KL decomposition, the data is processed to obtain spatial basis functions and time coefficients. Then, the transformer algorithm is used to predict the time coefficients and obtain the complete time coefficient data. Finally, the time coefficients are combined with the spatial basis functions to obtain the temperature field data.

On the cross-section of the aluminum profile, 32 sampling points are uniformly selected to obtain temperature data for points 1 to 9, 11 to 21, and 23 to 32 during the extrusion cycle. The temperature data for the 10th and 22nd sampling points are used to validate the effectiveness of the prediction model at unsampled points. The temperature data is sampled at intervals, with a total of 903 data points collected. The first 500 data points of 30 points are used to train the model, and the remaining 403 experimental data points are used to validate the accuracy of the model in the time direction.

**What I have tried:**

I tried searching on Google and some blog websites to find similar code.

Using KL decomposition, the data is processed to obtain spatial basis functions and time coefficients. Then, the transformer algorithm is used to predict the time coefficients and obtain the complete time coefficient data. Finally, the time coefficients are combined with the spatial basis functions to obtain the temperature field data.

On the cross-section of the aluminum profile, 32 sampling points are uniformly selected to obtain temperature data for points 1 to 9, 11 to 21, and 23 to 32 during the extrusion cycle. The temperature data for the 10th and 22nd sampling points are used to validate the effectiveness of the prediction model at unsampled points. The temperature data is sampled at intervals, with a total of 903 data points collected. The first 500 data points of 30 points are used to train the model, and the remaining 403 experimental data points are used to validate the accuracy of the model in the time direction.

I tried searching on Google and some blog websites to find similar code.

Comments

Richard MacCutchan
5-Sep-23 3:26am

This is more a mathematics question. Until you can work out how to apply this algorithm (for which I cannot find any references) then there is no point in being concerned with writing code.

This is not a task for a "beginner programmer": you are out of your depth by a large margin. I would strongly suggest that you need to work out what language and framework you will be working in - C++ and Python aren't compatible or indeed even similar - then learn that language from the basics before even trying to start on a project of this complexity.

Permalink

Share this answer

When you are a beginner than I recommend that your read my How to Start the Homework or a Developer Career? in which I have condensed my experience not only how to code but also how to deal with some challenges around it.

Your task isnt for beginners, but work with classes or structs to get some clarity in your code.

Your task isnt for beginners, but work with classes or structs to get some clarity in your code.

Permalink

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8
+1 (416) 849-8900