How can developers use machine learning in cloud technology?

53ee41aeca8293e2f23918cf4d3f4306.gif

Recently, major changes and innovations have emerged in the field of AI, including the advent of large-scale models and the rapid iterative development of AIGC technology. New technologies and algorithms are emerging every day, and larger models are emerging in an endless stream. AI technology has penetrated into all walks of life and has had a profound impact on developers, designers, writers and other professions. It has become an industry consensus that AI is changing the way we produce work. Therefore, it is crucial for developers to understand and master important technological changes and trends in AI.

In order to allow more developers to understand and truly participate in the development and application of technology, we have launched an activity called [Cloud Exploration Lab] , hoping to explore the boundaries of technology from practice with developers. The theme of this issue of the lab revolves around [Exploring the Boundary of Machine Learning from Practice - Amazon SageMaker Product Experience Activity] .

Exploring the boundaries of machine learning from practice - Amazon SageMaker product experience activities:

https://dev.amazoncloud.cn/experience

903977281c7a11c5638e93147d68758f.png

c2339e5285a1bb5a1374f87c1e35996e.png

9f87b1f773d7021501f5a5aaef469f6a.jpeg

The event received enthusiastic responses from many professional developers and technology enthusiasts, who actively participated in submitting product experience reports and shared practical video demos. In the activity community, participants actively exchanged and discussed, helped each other solve problems, created and shared, inspired each other, and played with cloud technology together. The atmosphere is very active.

Exposure of popular creative works,

Developers share their experience and avoid pitfalls

Now that the activity has entered the mid-term stage, many developers have submitted their own experience works, and shared some experience and experience of avoiding pitfalls. In order to allow more developers to join, we have selected some representative experience reports and practical documents to share with you, hoping to bring you some development inspiration.

1

Experiencer "White Water":

In just 20 minutes, you can build your own AIGC application

Experiencer "Bai Shui" "20 Minutes, Use Amazon SageMaker to Quickly Build Your Own AIGC Application" explains step by step the overall process of building an AIGC application based on Amazon SageMaker with pictures and text:

  1.  Create Notebook;

  2.  Clone models with Hugging Face;

  3.  Understand the hyperparameters of the model;

  4.  Configure and fine-tune the Stable Diffusion model;

  5.  Deploy and use the trained model;

  6.  Clean up resources.

"20 minutes, use Amazon SageMaker to quickly build your own AIGC application":

https://al4x5zumz6.feishu.cn/docx/I7kJdl1W9o6CQ7xd9XgcOkGfn9f

b734a457d861df20213937210a58502e.png

AIGC application built based on the Stable Diffusion model using Amazon SageMaker

In addition to explaining how to build AIGC applications, the author also designed two experiments to evaluate model performance: "CPU and GPU pair generation speed" and "hyperparameter pair model performance" to explore the efficiency difference of the Stable Diffusion model in different situations, and then more detailed Demonstrate the interpretation of the Stable Diffusion model.

"There are already many machine learning platforms on the market, and Amazon SageMaker is relatively comprehensive and application-oriented." The experiencer "Bai Shui" said that Amazon SageMaker includes various processes of machine learning, and the development habits in Python in the past Fully applicable in Amazon SageMaker. Not only that, Amazon SageMaker supports Sklearn, PyTorch, TensorFlow, Hugging Face, etc., and has corresponding packages for these mainstream modules and frameworks. To facilitate model training, Amazon SageMaker also provides Amazon AutoPilot, which can automatically search various models and sets of hyperparameters to train the optimal model.

2

Experiencer "Molixue AI":

Explanation video + experience report, good news for novice developers

Compared with the experience reports submitted by other small partners, "How to Deploy the Stable Diffusion Model Online Service in Amazon SageMaker" by the experiencer "Molixue AI" brought us the practice of online deployment and inference call of the AI ​​model on the web.

"How to Deploy the Stable Diffusion Model Online Service in Amazon SageMaker":

https://positive.blog.csdn.net/article/details/130019373

The article starts with how to build an environment in Amazon SageMaker, create a notebook programming example (this process takes about 5 minutes) - download the code and upload it to Jupyter - choose the appropriate Conda environment.

The second step is to run all the codes with one click. During the code execution process, the code definitions and inference tests of the relevant classes and functions of the Stable Diffusion model will be completed in sequence, and the codes and models will be packaged, and then the model will be deployed to the Amazon Sagemaker inference terminal node.

8263058be696ac318f9d68f56f9e1c18.png

After the model was created, the author created a front-end and back-end web application through Amazon Cloud9. On the basis of the successful creation of the cloud service environment, run the service code in the figure below.

07754403e2a345d869cac257dacd8ec0.png

After the author completed the test experience, he said that even if the prompt word input is the same each time, the output generated by the model is not fixed. Therefore, he suggested that if the input prompt words are more accurate, the generated image effect may be better.

"By using the Amazon SageMaker service platform, we only need a browser to write, run and debug various codes, without complex machine adaptation and environment construction, and can quickly complete the reasoning, testing, verification and deployment of AI models .” The experiencer “Molixue AI” said. Using the Amazon SageMaker platform for AI model service deployment can simplify the difficulty for ordinary developers to deploy AI model services. For small and medium-sized enterprises and individual developers, the rapid implementation of AI services is no longer a difficult task .

3

Experiencer "ZackSock":

Amazon SageMaker uses autoencoders for face generation

Different from other experiencers, the experiencer "ZackSock" "Amazon SageMaker uses autoencoder to complete face generation" is an experience practice around Amazon SageMaker and autoencoder. By training the self-encoder, we can create and realize the "face-changing needs", such as making face A gradually become face B, making a person grow old from childhood, generating human faces and other interesting small experiments.

"Amazon SageMaker uses autoencoders to complete face generation":

https://blog.csdn.net/ZackSock/article/details/129745320

The author first uses Amazon SageMaker for environment creation, then data processing, and finally trains an autoencoder. The data used by the author this time is 100,000 corrected face pictures, so the practice is to train an autoencoder of a face. The author explained in detail the principle of face gradation, assuming that face A is encoded as z1, and face B is encoded as z2, and now I want to make the face change from A to B gradually. Now we can turn this problem into a gradient between vectors z1 and z2. The vector gradient can directly use the interpolation algorithm. We insert n vectors into the two vectors, and then input these vectors into the decoder. The obtained face image is Faces between A and B. Now the face gradient becomes interpolation. The specific operation is as follows:

First implement the interpolation algorithm, the implementation of interpolation is very simple, the specific code is as follows:

f7b65be87fac907e9a09307156faa437.png

The above function inputs two vectors of the same length and outputs num vectors. These num vectors will be used as the input of Decoder. Next use the Decoder part for inference:

65ad6b612cecef4efc8798f033e8af35.png

The following is the effect achieved:

6736b09c45da868ef2becee36452c484.png

Autoencoders can not only achieve face gradient, but also generate faces. The author shared: "When training the autoencoder, the face is encoded into a vector with a length of 1024 dimensions. Now we assume that the face obeys a Gaussian distribution. If we can find the mean and variance, we can know the specifics of this Gaussian distribution. Appearance. After knowing the specific expression of the Gaussian distribution, you can sample the face vector from it, and pass this vector to the decoder to generate a face."

199855a87626273b15c71143c91c0d2c.png

sample graph

In addition to the content shared by these developers and friends above, there are also many small partners who have submitted their own experience reports, so I won’t show them one by one here, let’s just show you what fun and creative works they have made.

e5dabf6324038585baff2d770cc4206f.png

任务:“A bird is flying in space” 和 “Photos of horseback riding under the sea”

7df09dd289d9f216e3ebea5728eb111d.png

任务:“A cute panda is sitting on the sofa”

f29b55aa8c09846b81fbb1dd94f572fd.png

Mission: "An Astronaut Rides a Horse"

AI generated images and paintings, very intuitive and fun. In fact, you can also start from scratch to realize the above creative and interesting works. Come and participate in the [Exploration Lab on the Cloud] to explore the boundaries of machine learning from practice——Amazon SageMaker product experience activity!

c9585b6ff490414d385d185bdca1be40.png

In addition to sharing their own works, the experiencers also selflessly shared their understanding and accumulation of technology and products.

For example, "Pan Xiaohui" summed up the convenience that Amazon SageMaker brings to developers:

Provides complete machine learning tools to help users quickly optimize models and parameters through automated functions;

Provides interactive notebooks for quick exploration and manipulation of data;

Provide a variety of different model deployment and management methods to meet the needs of different scenarios during use;

Provide comprehensive monitoring and debugging tools to ensure the stability and reliability of the model.

In addition, the experiencer Baishui also spontaneously summarized product documents that are helpful in the development process:

Getting started with Amazon SageMaker:

https://aws.amazon.com/cn/sagemaker/getting-started/

Amazon SageMaker product introduction:

https://aws.amazon.com/cn/sagemaker/

Amazon SageMaker Product Documentation:

https://docs.aws.amazon.com/zh_cn/sagemaker/index.html

Stable Diffusion Model Documentation (HuggingFace):

https://huggingface.co/spaces/stabilityai/stable-diffusion

Stable Diffusion Model Documentation (StabilityAI):

https://stability.ai/blog/stable-diffusion-public-release    

The above is just a small part of the technology and content shared by the experiencers in this event. As the early experiencers of this event, they learned and practiced cloud technology in the event and the community, and shared the results without reservation. At the same time, they explored the experience and overcome the difficulties encountered in the development, helping other developers in the experience Avoid pitfalls in learning, this is exactly what this event advocates "creating and sharing together, helping and inspiring each other, and playing with technology on the cloud"!

7377908c8815c957a42fb7affb1605e4.png

579c4712bf01a5f3f91e5b8819eb62f7.gif

d3a35d69e3ca43256370bd82e3456b82.gif

I heard, click the 4 buttons below

You won't run into bugs anymore!

c74eaf9b5df3be4d2d9678dd3911e513.gif

Guess you like

Origin blog.csdn.net/u012365585/article/details/130143974