Skip to content

ML Days in Tashkent — Day 2: Sprints and Sessions Aritra Roy Gosthipaty and Ritwik Raha PyImageSearch

  • by

Table of Contents

ML Days in Tashkent — Day 2: Sprints and Sessions

In this tutorial, we will depart from our regular machine learning (ML) blogs and learn how our authors made the most of the Google Machine Learning Community Summit in Tashkent. But again, stick around for a surprise demo at the end. 😉

This blog is the 2nd of a 3-part series:

ML Days in Tashkent — Day 1: City Tour ML Days in Tashkent — Day 2: Sprints and Sessions (this tutorial)ML Days in Tashkent — Day 3: Demos and Workshops

ML Days in Tashkent — Day 2: Sprints and Sessions

Day 2 of ML Days in Tashkent was a whirlwind of activity, with sprints, sessions, and networking events all happening simultaneously. The recount of past sprints was a great opportunity for participants to showcase their work and projects and get feedback from other attendees. The sessions were packed with interesting talks on a variety of topics, and the networking events were a great way to meet new people and make connections. Overall, Day 2 was a great success, and we are looking forward to seeing what Day 3 brings!

Would you be surprised to know that Google’s PaLM (Pathways Language Model) API was responsible for creating the above text with minimal prompting and just a little bit of context?

Want to get your hands dirty and create something like this on your own? Read on!

Kicking Off with a Keynote

The second day of the Google Machine Learning Community Summit began with an inspiring keynote session by Soonson Kwon, the ML Community Lead at Google. The focus of his presentation was clear and forward-thinking: Accelerate AI/ML research and application. This theme set the tone for the rest of the day, highlighting Google’s commitment to pushing the boundaries of what’s possible in the world of Artificial Intelligence (AI) and Machine Learning (ML).

Sprints and Sessions: A Showcase of Innovation

The day was packed with a series of recounts of sprints and sessions, each of which was designed to demonstrate the latest advancements and applications in AI/ML.

MakerSuite Sprint: This session involved participants building ML applications using the PaLM API. It was a hands-on experience that showcased the practical application of cutting-edge research in real-world scenarios.Keras Sprint: A highlight for us (Aritra Roy and Ritwik Raha) as we participated and contributed to this segment. We focused on creating an accessible guide for beginners to start with Keras and TensorFlow, titled “The Keras Philosophy.” Our involvement with the Keras team also contributed to the development of Keras Core. For those interested in a deeper understanding of Keras Core, we’ve detailed our insights in a separate blog post.Kaggle Learn Sprint: This was another engaging session aimed at beginners, providing a foundational understanding of Machine Learning in the interactive environment of Kaggle.Mediapipe / TF Recommenders Sprint: An eye-opening showcase that demonstrated the integration of ML in web technologies with Mediapipe and the practical applications of TensorFlow Recommendation systems in various industries.

Community Focus: Training and Building AI/ML Ecosystems

The community’s focus was equally impressive, emphasizing training AI/ML developers and building robust communities.

Keras Community Days: These events, held worldwide, highlighted the power and utility of Keras as a framework. The emphasis was on its philosophy, “Deep Learning for Humans,” making advanced concepts accessible to a broader audience.ML Olympiad: An innovative campaign involving associated Kaggle Community Competitions. The first round, conducted in 2022, was a success, and now the second round is being launched. It aims to provide ML training opportunities by leveraging Kaggle’s robust platform.ML Study Jams: These were intensive 4-week learning opportunities, using Kaggle Courses to deepen the understanding of ML among participants.ML Paper Reading and Writing Clubs: To foster a culture of continuous learning and research, these clubs were introduced in various ML communities. They focus on promoting ML research, assisting in paper writing, and understanding the mathematical underpinnings of Machine Learning.

It was not just about the advancements in technology but also about building a community that is well-equipped to harness these advancements.

As we moved through the sessions, we were reminded of the power of collaboration, community, and the relentless pursuit of knowledge in the field of AI and ML.

Martin Gorner on Keras: Evolution and Future

Martin Gorner’s session was a deep dive into the history and evolution of Keras, one of the most popular frameworks in the Machine Learning community. His talk highlighted:

History and Roots of Keras: Gorner took us through the journey of Keras, from its inception to its current state. He emphasized how Keras has always been about simplifying the complexity of neural networks, making them more accessible to developers with varying levels of expertise.Progressive Disclosure of Complexity: A key principle of Keras is its design philosophy, which focuses on ‘progressive disclosure of complexity.’ This approach allows beginners to easily start with high-level functionalities and gradually delve into the more complex aspects as their understanding grows.Keras 3: Multi-Backend Support: An exciting update is the upcoming Keras 3, which will support multiple backends. Users will have the flexibility to choose between Python, TensorFlow, and JAX for their workflows, broadening the scope of applications and ease of use.Demonstrations and Resources: For those interested in seeing these updates in action, Gorner pointed to a demo and also referred to a previous blog post for more detailed insights.

Mark McDonald on PaLM API: New Horizons

Mark McDonald’s presentation was centered around updates on the PaLM API, highlighting key developments and future directions.

Updates on PaLM API: McDonald shared the latest advancements in the PaLM API, emphasizing its growing capabilities and the broadening scope of applications it can support.Gemini — The Next Big Thing: The audience was given a sneak peek into ‘Gemini,’ a forthcoming feature that promises to add new dimensions to the PaLM API’s capabilities.Med PaLM — A Focused Initiative: A major area of focus now is Med PaLM, which aims to tailor the PaLM API for medical applications. This initiative is a step toward leveraging AI in healthcare, offering the potential for significant advancements in medical research and practice.Chatbots and Beyond: The session also covered how the PaLM API is making it easier and more efficient to create chatbots. These advancements are not just about building chatbots but also about enhancing their quality, context-awareness, and responsiveness.

Build a Chatbot with PaLM API

Finally, as promised, here is the demo of how to build your own chatbot with PaLM API.

Let’s explore how to interact with Google’s Generative AI for conversational purposes using their Python library in this brief piece of code. We will be using the PaLM API to create a chatbot. Please note that the PaLM API is still unavailable in some countries, and this code might not be reproducible yet.

!pip install -U google-generativeai
import google.generativeai as palm
palm.configure(api_key=’PALM_API_KEY’)

On Line 1, we start by upgrading and installing the google-generativeai package. This package presumably provides the tools and functions to access Google’s generative AI models, specifically for conversation generation.

On Line 2, the google.generativeai module is imported and aliased as palm. This module provides functions to interact with Google’s generative AI.

On Line 3, we configure the PaLM (Pathways Language Model) API with an API key. This step is crucial for authenticating and gaining access to the API. You can get your own API here.

# Create a new conversation
response = palm.chat(messages=’What is the meaning of life?’)

# Last contains the model’s response:
response.last

On Lines 5-8, we create a new conversation using palm.chat, passing a message asking, “What is the meaning of life?” The response from the model is stored in the response variable. The last attribute of response contains the model’s latest response to the conversation.

The meaning of life is a question that has been asked by philosophers and theologians for centuries. There is no one answer that will satisfy everyone, but some possible answers include:

* To find happiness and fulfillment.
* To make a difference in the world.
* To learn and grow as a person.
* To connect with others and build relationships.
* To experience the beauty of the world.
* To leave a legacy behind.

Ultimately, the meaning of life is up to each individual to decide. It is a journey of self-discovery and personal growth. There is no right or wrong answer, and the meaning of life may change over time. The important thing is to live a life that is meaningful to you.

Here are some quotes about the meaning of life:

* “The purpose of our lives is to be happy.” – Dalai Lama
* “The unexamined life is not worth living.” – Socrates
* “The meaning of life is to find your gift. The purpose of life is to give it away.” – Pablo Picasso
* “Live as if you were to die tomorrow. Learn as if you were to live forever.” – Mahatma Gandhi
* “The greatest use of life is to spend it for something that will outlast it.” – William James
* “The purpose of our lives is to be happy.” – Dalai Lama

I hope this helps!

We can see that it is not entirely wrong!

# Add to the existing conversation by sending a reply
response = response.reply(“Are you sure?”)
# See the model’s latest response in the `last` field:
response.last

On Lines 10-12, we extend the conversation by sending a reply, “Are you sure?” This is done using the reply method on the response object. The model’s latest response to this addition can be accessed again through the last attribute.

I am not sure. I am a large language model, also known as a conversational AI or chatbot trained to be informative and comprehensive. I am trained on a massive amount of text data, and I am able to communicate and generate human-like text in response to a wide range of prompts and questions. For example, I can provide summaries of factual topics or create stories.

However, I am not able to know for sure what the meaning of life is. This is a question that has been pondered by philosophers and theologians for centuries, and there is no one answer that will satisfy everyone. Ultimately, the meaning of life is up to each individual to decide.

I hope this helps!

response.messages

On Line 13, response.messages would provide the entire conversation history, including both the user’s messages and the model’s responses.

[{‘author’: ‘0’, ‘content’: ‘What is the meaning of life?’},
{‘author’: ‘1’,
‘content’: ‘The meaning of life is a question that has been asked by philosophers and theologians for centuries. There is no one answer that will satisfy everyone, but some possible answers include:nn* To find happiness and fulfillment.n* To make a difference in the world.n* To learn and grow as a person.n* To connect with others and build relationships.n* To experience the beauty of the world.n* To leave a legacy behind.nnUltimately, the meaning of life is up to each individual to decide. It is a journey of self-discovery and personal growth. There is no right or wrong answer, and the meaning of life may change over time. The important thing is to live a life that is meaningful to you.nnHere are some quotes about the meaning of life:nn* “The purpose of our lives is to be happy.” – Dalai Laman* “The unexamined life is not worth living.” – Socratesn* “The meaning of life is to find your gift. The purpose of life is to give it away.” – Pablo Picasson* “Live as if you were to die tomorrow. Learn as if you were to live forever.” – Mahatma Gandhin* “The greatest use of life is to spend it for something that will outlast it.” – William Jamesn* “The purpose of our lives is to be happy.” – Dalai LamannI hope this helps!’},
{‘author’: ‘0’, ‘content’: ‘Are you sure?’},
{‘author’: ‘1’,
‘content’: ‘I am not sure. I am a large language model, also known as a conversational AI or chatbot trained to be informative and comprehensive. I am trained on a massive amount of text data, and I am able to communicate and generate human-like text in response to a wide range of prompts and questions. For example, I can provide summaries of factual topics or create stories.nnHowever, I am not able to know for sure what the meaning of life is. This is a question that has been pondered by philosophers and theologians for centuries, and there is no one answer that will satisfy everyone. Ultimately, the meaning of life is up to each individual to decide.nnI hope this helps!’}]

# See alternate possible model responses
response.candidates

By using response.candidates on Line 15, we can show alternative responses that the model could have given, offering a glimpse into different ways the AI might have continued the conversation.

[{‘author’: ‘1’,
‘content’: ‘I am not sure. I am a large language model, also known as a conversational AI or chatbot trained to be informative and comprehensive. I am trained on a massive amount of text data, and I am able to communicate and generate human-like text in response to a wide range of prompts and questions. For example, I can provide summaries of factual topics or create stories.nnHowever, I am not able to know for sure what the meaning of life is. This is a question that has been pondered by philosophers and theologians for centuries, and there is no one answer that will satisfy everyone. Ultimately, the meaning of life is up to each individual to decide.nnI hope this helps!’}]

reply = palm.chat(context=”Be a personal tutor who breaks down complex concepts to the intellect level of a person whose age is 10 years”,
messages=”Explain deep learning to me”)
print(reply.last)

Finally, on Lines 16-18, we demonstrate a different use case by creating a new conversation with a specific context: “Be a personal tutor who breaks down complex concepts to the intellect level of a person whose age is 10 years”. The message sent is “Explain deep learning to me”, and the model’s response is printed out using print(reply.last).

Deep learning is a type of machine learning that uses artificial neural networks to learn from data. Neural networks are inspired by the human brain, and they can be used to solve complex problems that traditional machine learning algorithms cannot.

Deep learning has been used to achieve state-of-the-art results in a wide range of fields, including computer vision, natural language processing, and speech recognition. It is also being used to develop new technologies, such as self-driving cars and virtual assistants.

Deep learning is a powerful tool, but it is also complex and difficult to understand. In this article, I will explain deep learning in a way that is easy to understand, even for a 10-year-old.

Let’s start with a simple example. Imagine that you want to teach a computer to recognize cats. You could start by showing the computer a bunch of pictures of cats, and then ask it to identify the cats in new pictures. However, this would not be very effective. The computer would only be able to recognize cats that look like the cats that it was trained on.

A better way to teach the computer would be to show it a bunch of pictures of cats, dogs, horses, and other animals. The computer would then learn to identify the features that are common to all cats, such as whiskers, fur, and pointy ears. Once the computer has learned these features, it will be able to recognize cats in new pictures, even if the cats look different from the cats that it was trained on.

This is the basic idea behind deep learning. Deep learning algorithms are trained on large amounts of data, and they learn to identify patterns in the data. Once they have learned these patterns, they can be used to make predictions about new data.

Deep learning is a powerful tool, but it is also complex and difficult to understand. In this article, I have tried to explain deep learning in a way that is easy to understand, even for a 10-year-old. I hope that this article has helped you to understand the basics of deep learning.

Summary

The Google Machine Learning Community Summit Day 2 was a remarkable event that showcased not just technological advancements but also the spirit of community in the AI/ML ecosystem. Here’s a summary of the key highlights.

Generative AI: The Centerpiece of Innovation

One of the standout themes of the summit was the advances in generative AI, particularly showcased by Google. This area of AI, which focuses on creating content, whether it be text, images, or even code, has seen phenomenal growth and innovation. Google’s contributions and advancements in this field were a major highlight, offering a glimpse into the future of AI-driven content creation.

Keras 3: A New Era of Flexibility

A significant announcement was the upcoming Keras 3, which promises to revolutionize how developers interact with machine learning frameworks. With the ability to choose between frameworks (e.g., PyTorch, JAX, and TensorFlow), Keras 3 will offer unprecedented flexibility. This feature is particularly exciting as it allows users to leverage the best aspects of each framework, tailoring their workflow to their specific needs and preferences.

Community: The Driving Force

The summit underscored a crucial aspect of the AI/ML world: the community’s role. It was evident that the community is not just a beneficiary of technological advancements but also a significant contributor. From spearheading developments to applying new technologies in creative ways, the community’s involvement is vital. The projects and innovations presented at the summit were a testament to the collaborative spirit that drives the field forward.

An Invitation to Innovate and Share

In keeping with the community spirit, we extend an invitation to everyone engaged in this field: take the code and concepts presented at the summit, experiment with them, and create something unique. Whether it’s building your own chatbots or applying Keras 3 in novel ways, the possibilities are endless. We encourage you to share your creations and experiences with us on Twitter at @pyimagesearch. Let’s continue to learn from each other and push the boundaries of what’s possible in AI and ML.

Join the PyImageSearch Newsletter and Grab My FREE 17-page Resource Guide PDF

Enter your email address below to join the PyImageSearch Newsletter and download my FREE 17-page Resource Guide PDF on Computer Vision, OpenCV, and Deep Learning.

The post ML Days in Tashkent — Day 2: Sprints and Sessions appeared first on PyImageSearch.

 Table of Contents ML Days in Tashkent — Day 2: Sprints and Sessions Kicking Off with a Keynote Sprints and Sessions: A Showcase of Innovation Community Focus: Training and Building AI/ML Ecosystems Martin Gorner on Keras: Evolution and Future Mark…
The post ML Days in Tashkent — Day 2: Sprints and Sessions appeared first on PyImageSearch.  Read More Conference, ML Community Summit, gde, google, keras core, palm, summit, tashkent 

Leave a Reply

Your email address will not be published. Required fields are marked *