Python: Catch Multiple Exceptions in One Line

Introduction In this article we’re going to be taking a look at the try/except clause, and specifically how you can catch multiple exceptions in a single line, as well as how to use the suppress() method. Both of these techniques will help you in writing more accessible and versatile code that adheres to DRY (don’t repeat yourself) principles. Let’s start by looking at the problem: try: do_the_thing() except TypeError as e: do_the_other_thing() except KeyError as e: do_the_other_thing() except IndexError as […]

Read more

Streamlit Web API for NLP: Tweet Sentiment Analysis

This article was published as a part of the Data Science Blogathon. Introduction Developing Web Apps for data models has always been a hectic task for non-web developers. For developing Web API we need to make the front end as well as back end platform. That is not an easy task. But then python comes to the rescue with its very fascinating frameworks like Streamlit, Flassger, FastAPI. These frameworks help us to build web APIs very elegantly, without worrying about […]

Read more

Implementation of Attention Mechanism for Caption Generation on Transformers using TensorFlow

Overview Learning about the state of the art model that is Transformers. Understand how we can implement Transformers on the already seen image captioning problem using Tensorflow Comparing the results of Transformers vs attention models.   Introduction We have seen that Attention mechanisms (in the previous article) have become an integral part of compelling sequence modeling and transduction models in various tasks (such as image captioning), allowing modeling of dependencies without regard to their distance in the input or output […]

Read more

Three mysteries in deep learning: Ensemble, knowledge distillation, and self-distillation

Under now-standard techniques, such as over-parameterization, batch-normalization, and adding residual links, “modern age” neural network training—at least for image classification tasks and many others—is usually quite stable. Using standard neural network architectures and training algorithms (typically SGD with momentum), the learned models perform consistently well, not only in terms of training accuracy but even in test accuracy, regardless of which random initialization or random data order is used during the training. For instance, if one trains the same WideResNet-28-10 architecture […]

Read more

How to Develop Your First XGBoost Model in Python

Last Updated on January 19, 2021 XGBoost is an implementation of gradient boosted decision trees designed for speed and performance that is dominative competitive machine learning. In this post you will discover how you can install and create your first XGBoost model in Python. After reading this post you will know: How to install XGBoost on your system for use in Python. How to prepare data and train your first XGBoost model. How to make predictions using your XGBoost model. Kick-start […]

Read more

How to Choose an Activation Function for Deep Learning

Last Updated on January 19, 2021 Activation functions are a critical part of the design of a neural network. The choice of activation function in the hidden layer will control how well the network model learns the training dataset. The choice of activation function in the output layer will define the type of predictions the model can make. As such, a careful choice of activation function must be made for each deep learning neural network project. In this tutorial, you […]

Read more

Machine Translation Weekly 65: Sequence-to-sequence models and substitution ciphers

Today, I am going to talk about a recent pre-print on sequence-to-sequence models for deciphering substitution ciphers. Doing such a thing was somewhere at the bottom of my todo list for a few years, I suggested it as a thesis topic to several master students and no one wanted to do it, so I am glad that someone finally did the experiments. The title of the preprint is Can Sequence-to-Sequence Models Crack Substitution Ciphers? and the authors are from the […]

Read more

Visualization for Function Optimization in Python

Function optimization involves finding the input that results in the optimal value from an objective function. Optimization algorithms navigate the search space of input variables in order to locate the optima, and both the shape of the objective function and behavior of the algorithm in the search space are opaque on real-world problems. As such, it is common to study optimization algorithms using simple low-dimensional functions that can be easily visualized directly. Additionally, the samples in the input space of […]

Read more

ACL 2018 Highlights: Understanding Representations and Evaluation in More Challenging Settings

This post discusses highlights of the 56th Annual Meeting of the Association for Computational Linguistics (ACL 2018). This post originally appeared at the AYLIEN blog. I attended the 56th Annual Meeting of the Association for Computational Linguistics (ACL 2018) in Melbourne, Australia from July 15-20, 2018 and presented three papers . It is foolhardy to try to condense an entire conference into one topic; however, in retrospect, certain themes appear particularly pronounced. In 2015 and 2016, NLP conferences were dominated […]

Read more

How to Randomly Select Elements From a List in Python

Introduction Selecting a random element or value from a list is a common task – be it for randomized result from a list of recommendations or just a random prompt. In this article, we’ll take a look at how to randomly select elements from a list in Python. We’ll cover the retrieval of both singular random elements, as well as retrieving multiple elements – with and without repetition. Selecting a Random Element From Python List The most intuitive and natural […]

Read more
1 700 701 702 703 704 927