Conclusion In this post, I experimented with an Indonesian recipe generator using pre-trained models. IndoBART outperforms other models based on the BLEU score. We can also conclude that fine-tuning a pre-trained model is generally better than the non-pre-trained one. It is interesting to see that it really works! Actually, there are many things to be explored here. For example, it is interesting to see the effect of pre-trained vs the non-pre-trained one of BART, T5, and GPT. I also need to do some rigorous analysis of the trained model. Sadly, because of my limited resources, I cannot do it for now. In the future, I plan to write about the current progress of the seq2seq model. There are many new interesting published papers in Machine Learning conferences in 2022. I will study and write about it in my blog.


Sets & Parameters in Tableau: A Road to Tableau Desktop Specialist Certification

Table of Content Sets Dynamic Sets Static Sets Adding/Removing data points from Sets Combining Sets Using Sets in viz Groups vs Sets Filters vs Sets Set ActionsParameters Using Parameters in Filters Using Parameters in Calculations Showing Parameters control in Viz Parameters vs FiltersSample Certification Questions from this Topic


Sets Sets could be used to compare the subsets of the data. In simple words, these are useful in highlighting a subset of data specifying certain criteria. Sets are also known as pre-computed filters as they subset the data. Sets could only be created on dimensions. A set is itself a dimension. A set is defined by a 'Venn-diagram' type of icon: Sets can be created in two ways:


Dynamic Sets The dynamic sets as the name suggests, are dynamic i.e. change when the underlying data is modified. These can be only based on a singular dimension. To create a dynamic set: Step1 -> Right-click on a dimension, and choose "Set" Step2 -> A dynamic set will give you three options to choose from General, Condition, Top. General - Choose required data points manually. Condition - You can add/create conditions based on fields on manual formulas. Top - Using this option, we can define the range for which we can get values based on different fields/formulas. The new set will be added to our data pane as a dimension.


Static Sets The static sets, as the name suggests, are static i.e. don't change even if the underlying data changes. These could be created either on singular or multiple dimensions. To create a fixed set: Step1 -> Choose one or more marks in viz and choose the 'Create Set' option. Step2 -> Give a name to the set. We can also use the "Exclude" option if we want to exclude all the selected data points. A set will be added to the Data pane under the Dimension pane.


Adding/Removing data points from Sets We can add/remove data points from sets in two ways: From the Data Pane. Simply right-click on the set and choose "Edit Set". We can then add/remove data points in the dialog box. 2. From the view. Simply choose the desired points from the view. Click on "Add to Set" or "Remove from Set" as per desired results.


Combining Sets We can combine two sets in Tableau. To combine two sets, they must be based on the same dimension. When we combine various sets, a new set is created that contains a combination of all the members or the members that exist in both or members that exist only in one set. To combine various sets: Step1 -> Right-click on any set and choose "Create Combined Set". Step2 -> Choose the set to combine and how to combine both sets.


Using sets in Viz Sets are separate dimensions and could be dragged and dropped like any other field in Tableau. When we drag a set to a row/column shelf, by default Tableau will show IN/OUT notation. IN means the members present in the set. OUT refers to the member excluded from the set. We can rename IN/OUT by either using aliases or calculated fields(if-else blocks) We can either choose "Show Members in Set" or "Show In/Out of Set". If we choose "Show Members in Set", we'll only get output for the members present in the set.


Groups vs Sets So basically, whatever Sets does we can also make it happen using Groups. But, then why do we use Sets? Groups are only made on Static data and can't be changed automatically based on changes in underlying data. But Sets can be used as both static or dynamic. We can create unlimited Groups but for Sets, there could be only IN/OUT. Either the member would be in Set or not. Sets can be used in calculated fields but we can't use groups there.


Filters vs Sets Sets are used to compare, whereas Filters are used to filter the data. Sets can also be used as Filters, just drag them to the Filters shelf. Filters and Sets are the same to an extent, but Sets are more of permanent filters as they could be re-used for the entire workbook whereas Filters can only be used for a single worksheet(by default). Sets become metadata and hence could be used if a worksheet is using .tds files. Filters change the view, but Sets add a dimension to the view.


Sets Actions We know that when we use dynamic sets, the view change when underlying data is changed. But if users want to change the data, we can use Set actions to generate results as required by users. Set actions update the value in the set. To create a set action, choose Worksheet>Actions. We can choose the action either for "The workbook" or "The worksheet". Choose "Change Set Values" to update the sets based on user preferences. Give a meaningful name to your action and choose the Source sheet and Target Set. The action could be provoked in three ways: Hover -> This will change the set, once the user hovers over any mark in the view.Select -> This will trigger the action when the user will click on any mark in the view.Menu -> This will trigger the action when the user will right-click on the mark and select an option on the context menu. Choose how to run the action and what would happen when the view is cleared.


Parameters Parameters are interactive tools to control the value of a variable. e.g. for a viz we might require the top 10 data points for a view but later might require the top 20, the users won't be going to change it manually, so we can simply put a parameter and users can tweak them to get desired values.


Creating a Parameter Step1 -> In the drop-down arrow in Data Pane, choose "Create Parameter". Step2 -> Choose the name, data type and by default value for our parameter. All - The parameter control would simply allow a text field. List - The control would let you choose an option from the list. Range - The control would let you choose an option within the specified range. Step3 - Find the parameter in the Data pane.


Using Parameters in Filter Parameters can help change the values for the top N filter. Users rather than changing the values manually can use Parameters. To use a Parameter in Filter: Step1 - Open the Filter dialog box and in the "Top" option choose your parameter. Step2 - Change the view by entering the number of titles you want. Note: To show a parameter control in view. Right-click on Parameter and choose "Show Parameter".


Using Parameters in Calculation Parameters can be used in calculations to modify the values and thus change the calculation dynamically. To add parameters in calculations, simply drag and drop parameter in calculation dialog box.


Parameters Card We can format our Parameters card, simply click on drop-down in parameter card in view. Edit Parameter - It let you edit your parameter. Show Title - It let you show the title of the Parameter. Edit Title - It let you edit the title of your Parameter. Format Parameters - It let you change the font, and color for your Parameters. Type In - It let you change the way you enter the parameters, it could be a text box, slider, drop-down, etc. It depends on the data type of parameter. Hide Card - It let you hide the parameters card.


Parameter Actions We can add a parameter action to allow users to directly change the view by either hovering, clicking, or selecting the menu. Step1 - To create a Parameter Action, go to Worksheet<Actions. Step2 - Chose "Change Parameter". Step3 - Choose Source Sheets, Target Parameter and how to trigger a Parameter. The action could be provoked in three ways: Hover -> This will change the set, once the user hovers over any mark in the view.Select -> This will trigger the action when the user will click on any mark in the view.Menu -> This will trigger the action when the user will right-click on the mark and select an option on the context menu. Choose how to run the action and what would happen when the view is cleared.


Parameters vs Filters Parameters aren't as same as Filters, but they can be used to customize the filters.


Sample Exam Questions from this Topic Sets can also be used as filters? a. Trueb. False Solution: True


References: [1] Tableau Help  Tableau Software [2] Personal Notes [3]Tableau Desktop Specialist Exam (New Pattern - 2021) - Apisero


Thanks for Reading! Feel free to give claps so I know how helpful this post was for you, and share it on your social networks, this would be very helpful for me. If you like this article and want to learn more about Machine Learning, Data Science, Python, BI. Please consider subscribing to my newsletter: Find me on Web: www.dakshtrehan.com Connect with me at LinkedIn: www.linkedin.com/in/dakshtrehan Read my Tech blogs: www.dakshtrehan.medium.com Connect with me at Instagram: www.instagram.com/_daksh_trehan_


Want to learn more? How is YouTube using AI to recommend videos?Detecting COVID-19 Using Deep LearningThe Inescapable AI Algorithm: TikTokGPT-3 Explained to a 5-year-old.Tinder+AI: A perfect Matchmaking?An insider's guide to Cartoonization using Machine LearningHow Google made "Hum to Search?"One-line Magical code to perform EDA!Give me 5-minutes, I'll give you a DeepFake!


Deploy HuggingFace NLP Models in Java With Deep Java Library

Setup To get started with DJL, add the following code snippet defining the necessary dependencies to your build.gradle file. Also note that, when running this code, the default engine may also need to be specified with the VM option: -Dai.djl.default_engine=PyTorchwhich is compatible with the model and the tokenizer.


Bring your own question answering model to DJL The inference workflow is combined with input preprocessing, model forward, and output post-processing. DJL encapsulates input and output processing into the translator and uses Predictor to do the model forward. To run a question answering task with the HuggingFace API, taking BERT as an example, you create a BertTokenizer to transform your text inputs into machine-understandable tensors, which is part of data preprocessing. Post-processing mainly includes the conversion of the result index. DJL introduces the Translator structure to encapsulate this workflow of preprocessing and post-processing the data. This example Translator is implemented by BertTranslator. Then you can load a specific model, e.g. BertForQuestionAnswering , to run the inference. Then applying the argmax() on top of the logits to get the result index.


Overview of Translator Translator is designed to organize preprocessing and post-processing. You define the input and output objects. It contains the following two override classes: public NDList processInput(TranslatorContext ctx, I)public String processOutput(TranslatorContext ctx, O) Every translator takes in input and returns output in the form of generic objects. In this case, the translator takes the input in the form of QAInput (I) and returns the output as a String (O). QAInput is just an object that holds questions and answers. We have prepared the Input class for you. The output String is the answer that you would expect from the model. Before implementing our first translator, you need sample input.


Create a sample input The following code sample creates a sample input for the question-answer task using QAInput:


Tokenize your inputs DJL provides a built-in BertTokenizer to split your string into tokens. This tokenizer is implemented as follows: Then the output will be: The tokenizer can also be used to encode the question and the resource document together, which adds the special token used to train the BERT model under the hood. You get all the metadata required for BERT model input. The following code sample demonstrates the three types of inputs that are used for the BERT model: encoded tokens, tokenTypes, and attentionMask. Then the output will be: When you use the HuggingFace BertTokenizer, it downloads the vocabulary. You can easily find the file by specifying cache_dir in the from_pretrained method. Call PtBertVocabulary.parse(InputStream) to get BertVocabulary. Then, convert the token to the index with getIndex(token) and the other way around with getToken(index) as shown in the following. In this example, the file vocab.txt can be downloaded from our public image here or HuggingFace repo here.


Post-process the output After the model forward call, you get a series of NDArrays as output. We pack those into one object: NDList. You can extract the NDArray from NDList using get(index). To get the index with the highest probability, you apply argMax followed by getLong, which turns the scalar NDArray into a Java primitive type as follows:


Implement the BertTranslator Now, you can combine the above preprocess and post-process together to create your own translator BertTranslator. Next, it will be used in constructing the Criteria and the predictor.


Load your own model from the local file system At this step, we will construct the Criteria API, which is used as search criteria to look for a ZooModel. In this application, the directory of the local TorchScript model will be specified, so that the ZooModel will be loaded accordingly, with .optModelPath(). The following code snippet loads the model with the file path: /YOUR PATH/trace_cased_bertqa.pt . This TorchScript model file is available in our public image here. You can also download it from HuggingFace and then follow the djl tutorial or official tutorial to save the model with TorchScript format. Criteria API was introduced before in the Implement Object Detection with PyTorch in Java in 5 minutes blog post , where it was used to load the model from a pre-uploaded model zoo. For question-answer model, we uploaded the BERT model to our model zoo, which is fine-tuned with SQuAD from HuggingFace. For more information on the model, see the BERT QA Example.


Put everything together Now, putting everything together, you are ready to use the model bundled with the translator created above to run inference. Here is the demo input and output: If you are a Java programmer, congratulations! Now you have easy access to HuggingFace QA models. Click here to see the full source code. You can also easily integrate inference code snippets with Apache Spark, Apache Flink, and Quarkus.


Conclusion In this blog post, we have demonstrated how to implement your own Hugging Face translator using the Deep Java Library, along with examples of how to run inferences against more complex models. Equipped with this knowledge, you should be able to deploy your own transformer-based model from HuggingFace on Java applications, including SpringBoot and Apache Spark. If you are a Python user, AWS SageMaker recently announced a collaboration with HuggingFace introducing a new Hugging Face Deep Learning Containers (DLCs). It offers a powerful Python SDK to reduce the gap from science to production for state-of-the-art HuggingFace models with in terms of API usability and performance. You can find more details on The Partnership: Amazon SageMaker and Hugging Face and Use Hugging Face with Amazon SageMaker - Amazon SageMaker. Disclaimer - This article only represents the authors' personal opinions. It s not the organization's official document.


Filtering Data in Tableau: A Road to Tableau Desktop Specialist Certification

Table of Content Ways to Filter Keep/Exclude Data Selecting Headers Dragging & Dropping to Filters ShelfTypes of Filters Extract Filters  Data Source Filters Context Filters  Dimension Filters Measure Filters  Date Filters Table Calculation FiltersUnderstanding Filter CardSample Question from this Topic


Keep/Exclude Data We can simply filter the data by selecting required data points from the view. By clicking on "Keep Only", it will remove every other data point. By choosing "Exclude", it will exclude that data point.


Selecting Headers To filter headers from the view, simply click on them. By clicking on "Keep Only", it will remove every other data point. By choosing "Exclude", it will exclude that data point.


Dragging and Dropping to Filter Shelf To add filters to our view, simply drag and drop the dimension/measure to the filter shelf. Depending on the type of data, a dialog box would appear.


Types of Filters Tableau currently supports 6 types of Filters:


Extract Filters These are the first kind of filters that users can access and use. Extracts are snapshots of live data that are used to boost performance. While creating extracts, we can filter irrelevant data and hide all unused columns to decrease the data load. We can add desired dimension/measure as our filter and put further dimension/measure filters upon them(discussed in the latter part of this chapter). Using this filter, Tableau will create an extract of filtered data that could be further used for visualizations. Extract Filters are only available for the Single Table option.


Data Source Filters These filters are used to filter out data at the data source level. These work very similar to Extract Filters and can be accessed through the Data pane. We can choose any dimension/measure to filter and would be given further dimension/measure filters to choose from(discussed later in this chapter). Extract Filters work only on Extract Connections. Data Source Filters works on both types of connections.


Context Filters Every other filter in Tableau is applied to all the rows by default irrespective of any other filter. In simple words, every filter works independently in our worksheets, but sometimes we want a co-dependent filter i.e. we want to put our second filter on the result of the first filter that's where context filters are used. Context filters create an order of operation for filters i.e. give a priority to a filter. The data which was earlier getting filtered independently now will be filtered on the data filtered by context filter. One or more categorical filter that separates the dataset into major parts can be used as a context filter. All other filters used in the worksheet works based on the data filtered by the context filter. Advantages of Context Filters: Improves performance -> Use of context filters on large datasets can boost the performance as it reduces the data load on the Tableau engine.Dependent Filter Condition -> It helps to create a dependent filter condition and thus provides solutions to certain scenarios. To create a context filter, simply right-click on the filter and choose "Add to Context". A context filter will always be shown in gray color. A context filter would always be applied first and the rest of the filters will be applied to data filtered by context filter. A context filter can only be a dimensional filter. However, we can set 1 or more categorical filters as context filters. To speed up context filters: do the data modeling before filtering, use bins for continuous dates.


Dimension Filters These are the filters that can be used on non-aggregated pills i.e. blue pills. These filters can be applied to dimensions, sets, bins, and groups. To apply these filters, simply drag a blue pill to the Filter shelf, it will give you four options: General, Wildcard, Condition, and Top. In the General tab, we can simply include/exclude items manually by simply ticking them on/off. In the wildcard option, we can filter data based on some pattern. In the condition tab, we can put certain conditions or put custom formulas. In the Top tab, we can specify top data based on either other columns or custom formulas.


Measure Filters These filters are used only on aggregated data i.e. green pills. To apply this filter, simply drag any green pill to the Filters shelf and Tableau will ask you about the aggregation on which you want your filters to be applied. After choosing aggregation, it will provide you with four options: Range of Values, At least, At most, Special. Range of Values, At least, At most will let you choose the specified range for your measure. If you choose Special, it will let you filter null/not-null values. If you have a large data source, filtering measures can lead to a significant degradation in performance.


Date Filters When we try to put the Date data type on the Filter shelf, we get exactly the same options as we get for dimension and measure filters for dimension date and measure date. We can choose if we want to filter our data according to Relative dates or Range of dates, we then get five options: Relative dates, Range of Dates, Starting date, Ending date, and Special. Date Parts vs Date Values Filters


Table Calculation Filter To create a table calculation filter, simply create a table calculation(to be covered in a later chapter) and drag it to the filter shelf. Table calculation filters have the least priority, these filters are applied to the views and not to your dataset.


Understanding Filter Card Tableau lets users change the way users interact with Filters cards. Edit Filter -> It lets you edit the filter by adding/removing more values. Remove Filter -> It lets you clear the filter from the filter shelf. Apply to Worksheet -> Allows you to span the filter to other worksheets. Format Filters and Set Controls -> Allows you to format font and color for filter cards. Customize -> It lets you control how the filter card would be visible in worksheet/dashboards. Title -> It would allow adding/removing title for filter card. Edit Title -> It would allow editing the title for the filter card. Filter Card Modes -> This option allows users to format their filter card i.e. the way they interact with filters. Single Value(list): Displays the list of filters as a radio button with the option to only select one at a time.Single Value(dropdown): Display the list of filters as a drop-down list with the option to only select one at a time.Single Value(Slider): Display the filters as a slider with the option to only select one at a time.Multiple Values(list): Display the filters as a list with the option to select multiple at one time.Multiple Values(dropdown): Display the filters as a dropdown with the option to select multiple at one time.Multiple Values(custom list): Display the text box where we can add multiple filters together.Wildcard Match: Displays the text box where we can add patterns like *,& filter the data. Pattern match is not case-sensitive. Only Relevant Values -> It allows users to only show certain values. It is highly useful while using Context filters. All Values in Database -> It allows users to add every value in the Database to filter regardless of other filters. Include Values -> It allows users to include all the selected values in the view. Exclude Values -> It allows users to exclude all the selected values in the view. Hide Card -> It hides the filter card, but don't remove the filters from the view.


Sample Exam Questions from this Topic ___ and ___ are the simplest filter options available in the view. a. Includeb. Excludec. Keep Onlyd. Filter Solution: Keep Only, Exclude


References: [1] Tableau Help  Tableau Software [2] Personal Notes [3]Tableau Desktop Specialist Exam (New Pattern - 2021) - Apisero


Thanks for Reading! Feel free to give claps so I know how helpful this post was for you, and share it on your social networks, this would be very helpful for me. If you like this article and want to learn more about Machine Learning, Data Science, Python, BI. Please consider subscribing to my newsletter: Find me on the Web: www.dakshtrehan.com Connect with me at LinkedIn: www.linkedin.com/in/dakshtrehan Read my Tech blogs: www.dakshtrehan.medium.com Connect with me at Instagram: www.instagram.com/_daksh_trehan_


Want to learn more? How is YouTube using AI to recommend videos?Detecting COVID-19 Using Deep LearningThe Inescapable AI Algorithm: TikTokGPT-3 Explained to a 5-year old.Tinder+AI: A perfect Matchmaking?An insider's guide to Cartoonization using Machine LearningHow Google made "Hum to Search?"One-line Magical code to perform EDA!Give me 5-minutes, I'll give you a DeepFake!


ICLR 2022 - A Selection of 10 Papers You Shouldn't Miss

1. Autoregressive Diffusion Models   Code By Emiel Hoogeboom, Alexey A. Gritsenko, Jasmijn Bastings, Ben Poole, Rianne van den Berg, Tim Salimans.  Why -> Diffusion Models have been growing in popularity for the past year and they're gradually being assimilated into the Deep Learning toolbox. This paper proposes a significant conceptual innovation for these models.  Key insights -> In handwavy terms, Diffusion Models generate images by iteratively adding "differentiable noise" on a pixel grid that eventually becomes a real-looking image. Inference starts by sampling some kind of "white noise" image. This work proposes to do a similar process but instead of applying the diffusion step to iteratively decode all pixels at the same time, they decode a few pixels at a time autoregressively which then remain fixed for the rest of the process (see figure below). Moreover, in contrast to other autoregressive methods for image generation like DALL·E⁴, this method doesn't require a particular ordering when decoding the image. Even more, the number of pixels that are decoded at each diffusion step can be dynamically adjusted by the model given a fixed budget of steps for decoding the whole image! For training, a BERT-like denoising autoencoder self-supervised objective suffices: given an image, masking a portion of the pixels and predicting the value of a few of them. While the results are not earth-shattering, this is conceptually a simple and effective evolution of Diffusion Models that allows them to decode an output autoregressive and be applied to not left-to-right text generation. If you want to dive deeper into this paper, Yannic Kilcher has an excellent explainer video which I highly recommend.


2. Poisoning and Backdooring Contrastive Learning By Nicholas Carlini, Andreas Terzis.  Why -> Large-scale self-supervised pre-training with data scraped from the web is one of the basic ingredients for training large Neural Networks. For the well-known CLIP² from OpenAI, noisy uncurated image-text pairs from the web are used for training. What could go wrong? Well, this.  Key insights -> This paper explores how an adversary might poison a small subset of the training data for a model like CLIP - trained using contrastive learning on image-text pairs from the web - such that the model will misclassify test images. They try 2 methods to do so: Targeted poisoning: the training dataset is modified by adding poisoned samples with the goal of having the end model misclassify a particular image with a wrong specific label. According to the results, this can be consistently achieved by just poisoning a 0.0001% of the training dataset, e.g. adding 3 image pairs to a dataset of 3 million instances.Backdoor attack: instead of having a particular target image, this approach aims to overlay a small patch of pixels on any image such that this will be misclassified with a desired wrong label. This more ambitious attack can be pulled off consistently by poisoning 0.01% of the training dataset, e.g. poisoning 300 images out of a 3 million instances dataset. Public internet data can be manipulated by anyone, which makes these attacks feasible. This is yet a new weakness of using uncurated data for training models that should be considered when developing and deploying models.


3. Bootstrapped Meta-Learning By Sebastian Flennerhag, Yannick Schroecker, Tom Zahavy, Hado van Hasselt, David Silver, Satinder Singh.  Why -> Many Reinforcement Learning algorithms are notoriously sensitive to hyperparameter choices. Meta-learning is a promising learning paradigm for refining the learning rules of a learner (which include hyperparameters) to make learning faster and more robust.  Key insights -> In meta-learning, the learner is equipped with an outer loop of optimization that optimizes the "learning rule" of the inner optimization, which directly optimizes a learning objective (e.g. via gradient descent). In terribly oversimplified terms, existing meta-learning algorithms often rely on the performance of the learner to evaluate a learning rule: run the learner for k steps, if the learning improves do more of that, if the learning gets worse, do less of that. The problem with directly using the learner's objective is that the meta-learning optimization will (1) be constrained to the same geometry of the learning objective function and (2) the optimization will be myopic, given that it will only optimize for a horizon of k steps, whereas the dynamics of learning beyond that might be much more complex. Frankly, the theoretical details of this process go over my head, but the gist of it is that the meta-learner is first asked to predict the performance of the learner beyond the evaluated k-steps, and then it optimizes following that very prediction; in other words, the meta-learner generates its own target to optimize. This enables the meta-learner to optimize for a longer time horizon without the need to actually evaluate such long time horizons which is computationally expensive. The authors prove some nice theoretical properties of this approach and the empirical results achieve new state-of-the-art (SOTA) on the ATARI ALE benchmark¹ and efficiency improvements in multitask learning.


4. Equivariant Subgraph Aggregation Networks By Beatrice Bevilacqua, Fabrizio Frasca, Derek Lim, Balasubramaniam Srinivasan, Chen Cai, Gopinath Balamurugan, Michael M. Bronstein, Haggai Maron.  Why -> The limited expressiveness of Message Passing Neural Networks (MPNNs) on graphs - which fall under the umbrella of Graph Neural Networks (GNNs) - is one of those fundamental problems that prevent GNN researchers from sleeping well at night.  Key insights -> How do you know if two graphs are the same? You might think just looking at them is enough, but you'd be wrong. The same graph can be represented in different ways by reorganizing or permitting the order of nodes such that given two graphs it can be hard to identify whether they are the same, namely isomorphic. The Weisfeiler-Leman (WL) test is an algorithm that recursively classifies the nodes of a graph based on its immediate neighborhood. If after all these processes the nodes of the two graphs have "different classifications" this means the test failed, implying the two graphs are different (non-isomorphic). On the other hand, if the two graphs are "still the same" after the WL test, they are probably isomorphic, but it's not guaranteed! There are certain graph structures the WL test will fail to differentiate. MPNNs GNNs can be understood as a differentiable analog of the WL test, which is why MPNNs inherit the expressiveness limitation of the WL test: they cannot differentiate between certain graph substructures. Even further, depending on how MPNNs aggregate information from their neighbors, they might even have less expressive power than the WL test! This work establishes all these connections and presents a method for maximizing the expressiveness of MPNNs which consists in decomposing a graph into a bag of subgraphs and applying MPNNs on these bags of subgraphs. The paper is fairly dense, but if you want to get the gist of the paper or are interested in starting to learn about GNNs, I strongly recommend the ML Street Talk episode with Zak Jost where they cover the paper starting on minute 47. Other GNN works at ICLR: Graph Neural Networks with Learnable Structural and Positional Representations


5. Perceiver IO: A General Architecture for Structured Inputs & Outputs By Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, Olivier Henaff, Matthew M. Botvinick, Andrew Zisserman, Oriol Vinyals, Joāo Carreira.  Why -> Modeling data by making the fewest possible assumptions about it is interesting because it has the potential to transfer well to different modalities.  Key insights -> This work follows a similar line as the original Perceiver³ by augmenting it with a flexible querying mechanism which lets the model have an output of arbitrary size instead of requiring a task-specific architecture at the end of the model. that enables outputs of various sizes and semantics, doing away with the need for task-specific architecture engineering. The overview of the model can be understood by looking at the figure below: the input can be an arbitrarily long sequence of embeddings that are mapped into a latent array encoding. This process allows for modeling very long input sequences, given that the latent array size is fixed, there's no quadratic complexity exploding when the input becomes very long. After this "encoding step" the model applies the common L transformer blocks consisting of a combination of self-attention and feedforward layers. Finally, a decoding step takes in an output query array and combines it with the latent representation of the input to produce an output array of the desired dimension. Many of the existing learning techniques such as Masked Language Modeling or contrastive learning can be also applied to this architecture. Following common existing recipes for training on each modality, this model produces strong results in NLP and visual understanding, multi-task and multi-modal reasoning, and Optical Flow. Hell, they even plug it into AlphaStar (replacing the existing Transformer module) achieving strong results in the challenging StarCraft II game! If you're interested in this research you should check out the more recent version of the Perceiver, the Hierarchical Perceiver⁷.


6. Exploring the Limits of Large Scale Pre-training By Samira Abnar, Mostafa Dehghani, Behnam Neyshabur, Hanie Sedghi.  Why -> Scale has been a persistent topic of discussion within ML circles. We have been highlighting papers often because it is definitely one of the important questions the field has to grapple with: where will adding parameters and data stop being... useful? Keep reading.  Key insights -> Sort of pretty much "As we increase the upstream accuracy, the performance of downstream tasks saturates". They study how pre-training performance on Upstream (US) tasks (e.g. large-scale ImageNet labels) transfers to Downstream (DS) performance (e.g. whale detection). Then do this experiment for a lot - by a lot mean a lot - of architectures and sizes: So the interesting plots represent how Upstream performance (US, pretraining) and Downstream performance (DS, end task) correlate. Pretty much across the board, it saturates eventually. Still, it's super interesting to see the differences across architectures for computer vision! The authors claim that their observations overall seem robust to choices such as the size of the upstream data or number of training shots, and architecture choices. They also explore the influence of hyper-parameter choices: are some hyper-parameters very good for the US but don't translate well to DS? Yes! They dive deep into this phenomenon in section 4 and find that for instance, weight decay is a particularly salient hyperparameter that influences US and DS performance differently. In a context where nobody really trains models from scratch but chooses pre-trained models to bootstrap their application, this research is key. There's much more to the paper than what can be summarized in a few paragraphs, it's definitely worth a read if you want to dive deeper!


7. Language modeling via stochastic processes By Rose E Wang, Esin Durmus, Noah Goodman, Tatsunori Hashimoto.  Why -> Modern large generative Language Models are wickedly good at writing short texts, but when they generate a long text, global coherence is often lost and things stop making sense. This paper proposes a method to mitigate this.  Key insights -> Typical Language Models (LM) generate text solely at the token level of granularity, which heavily biases models to learn about short-range interactions more heavily than long-range ones, which is precisely the skill required for achieving a coherent global narrative. This work proposes to model language at the coarser level of sentences as a stochastic process that guides the LM generation to be globally coherent. The proposed model is called Time Control and it models sentence representations as Brownian motion in the latent space. For training, given two start and end anchor sentences, a contrastive loss is set up by having a positive sentence that's within the anchor sentences to fall within the "Brownian bridge" of the anchor sentence representations in the latent space, and then having negative samples be pushed out (Figure 1). I also didn't know what a Brownian bridge was before: a Brownian (jiggly) trajectory where the start and end positions are fixed. For inference, a sentence-level plan is generated by sampling from the Brownian process in the latent space, and then language at the token level is generated conditioned by this high-level plan (Figure 2). The results are very interesting, particularly in Discourse coherence accuracy, where Time Control shines. This work presents a promising direction to get LMs to overcome classical limitations without the need of going to the Trillion parameter scale regime. Other relevant works on Language models at ICLR are (FLAN) Fine-tuned Language Models are Zero-Shot Learners, Multitask Prompted Training Enables Zero-Shot Task Generalization, Charformer: Fast Character Transformers via Gradient-based Subword Tokenization, GreaseLM: Graph REASoning Enhanced Language Models, HTLM: Hyper-Text Pre-Training and Prompting of Language Models or Fine-Tuning Distorts Pretrained Features and Underperforms Out-of-Distribution.


8. Coordination Among Neural Modules Through a Shared Global Workspace By Anirudh Goyal, Aniket Didolkar, Alex Lamb, Kartikeya Badola, Nan Rosemary Ke, Nasim Rahaman, Jonathan Binas, Charles Blundell, Michael Mozer, Yoshua Bengio.  Why -> Brain-inspired modular neural architectures are on the rise; despite their lack of success on popular Computer Vision or Natural Language Processing benchmarks, they're showing promising results in robustness, out-of-domain generalization, and even learning causal mechanisms⁶.  Key insights -> The Global Workspace Theory (GWT) is a proposed cognitive architecture to account for how conscious and unconscious thought processes manifest in humans. One of its core assumptions is the existence of a shared workspace that all specialist modules have access to, enabling coherence between otherwise isolated modules. This paper conceptualizes a neural network architecture where a set of inputs are processed by expert neural networks, which are then written into a shared workspace - a set of vectors - which are then broadcasted to the experts again. This might sound fancier than it actually is. For instance, imagine a Transformer that processes an input sequence, you can conceptualize position-wise operations as the experts. The shared workspace imposes a condition on how many of the updated hidden states are allowed to be updated in the shared global workspace, imposing a degree of sparsity, which has been shown to improve robustness and out-of-domain generalization. As usual with these kinds of works, they perform well on tasks and evaluation modes that are not that popular but won't outperform monolithic networks on in-domain evaluation, so they won't make it into many headlines. Still, this is a very interesting line of work worth paying attention to. Other ICLR work on new architectures for OOD generalization: Compositional Attention: Disentangling Search and Retrieval, Adaptive Control Flow in Transformers Improves Systematic Generalization, Asymmetry Learning for Counterfactually-invariant Classification in OOD Tasks, Sparse Communication via Mixed Distributions.


9. Learning Fast, Learning Slow: A General Continual Learning Method based on Complementary Learning System By Elahe Arani, Fahad Sarfraz & Bahram Zonooz.  Why -> The dichotomy in human modes of thinking - fast and slow - popularized by Daniel Kahneman is at the core of how humans appear to think. This paper takes inspiration from this idea to build an architecture that leverages fast and slow learning to improve Continual Learning.  Key insights -> Continual Learning is a method for having a model gradually extend its knowledge by exposing it to new data or interacting with a dynamic environment. As an example, think about a model that initially only learns to classify images with digits from 0 to 7, and is taught to recognize digits 8 and 9, without forgetting about the previous digits. The goal is to be able to leverage existing knowledge to learn more efficiently about new things, just like humans do. To do so, this paper proposes a memory experience replay system aimed at 2 timescales: long and short. One of the main innovations is the use of semantic memory: two neural networks which represent the plastic and stable model. To enable fast and short learning, the stable model consists of an exponential moving average of the fast model: this makes the two models have coherent weights but the evolution of the stable model is slower and smoother than the plastic one, which is more sensitive to the latest data. This technique has been used in other settings such as contrastive learning like BYOL⁵. The reservoir acts as an episodic memory that retains samples of the data stream which mitigates catastrophic forgetting. The experiments show strong performance on 3 tasks: Class Incremental Learning: gradually adding new classes in a classification setting.Domain Incremental Learning: introducing a distribution shift of the data without adding new classes.General Incremental Learning: exposing the model to both new class instances and swift distribution shits of the data like rotating digits in an MNIST classification task.


10. Autonomous Reinforcement Learning: Formalism and Benchmarking By Archit Sharma, Kelvin Xu, Nikhil Sardana, Abhishek Gupta, Karol Hausman, Sergey Levine, Chelsea Finn.  Why -> Most RL benchmarks are episodic: agents learn by performing a task in an environment that fully restarts every time the agent fails. Humans rarely learn in this setting: the environment doesn't restart when we re-try to do something! If robots are meant to be in the real world, why do we still evaluate most RL algorithms in episodic benchmarks?  Key insights -> This work proposes a benchmark that focuses on non-episodic RL which the authors call Environments for Autonomous Reinforcement Learning (EARL) with the hope that it resembles the real world. Technically, EARL is a subset of the good old RL in which the environment continuously evolves as the agent interacts with it instead of resetting at the end of each episode. However, this is rarely done in practice so this work sets the foundation by establishing the formalisms (e.g. definitions and mathematical formulations of concepts like learning agent, environment, reward, policy evaluations, interventions, etc.). You can find an overview of this work on their project page and already start using the benchmark to evaluate your algorithms by cloning the benchmark repository from GitHub. Another popular RL paper at ICLR you might like is Maximum Entropy RL (Provably) Solves Some Robust RL Problems.


Blue vs Green, Dimensions vs Measures, Discrete vs Continuous: A Road to Tableau Desktop Specialist Certification

Table of Content Dimension vs Measures [WHAT] Default Properties: Dimension vs Measures Colors: Dimension vs MeasuresDiscrete(Blue) vs Continuous(Green) [HOW] Filters: Discrete vs ContinuousPutting it all together! Converting Dimension to Measure and Vice-Versa Converting Discrete to Continuous and Vice-Versa Dimension in the View Measure in the ViewMeasure Values & Measure NamesSample Exam Questions from this Topic


Dimension vs Measure Dimension in Tableau stands for any data field that contains qualitative values i.e. values that are descriptive. Measures in Tableau stand for any data field that contains quantitative values i.e. values that conveys information in the form of numerals. In simpler words, anything on which we can perform aggregations(sum, count, avg, etc.) Whenever we take Measures to our Row/Column shelf, it is automatically aggregated(by default: sum). Tableau automatically divides the data into Dimension and Measure, it also provides the flexibility to toggle the data between two roles. Dimension & Measures helps to understand more about the data i.e. what it represents/means. A Dimension always affects the Level of Detail i.e. more dimensions lead to more granular data. In simpler words, the more dimensions you add, the more marks will be created in our view. The dimensions that define how to group the calculation (the scope of data it is performed on) are called partitioning fields. The remaining dimensions, upon which the table calculation is performed, are called addressing fields, and determine the direction of the calculation.


Default Properties: Dimension vs Measure If we right-click on Dimension/Measure and look for "Default Properties", both Dimension and Measure share Color & Comment.


Colors: Dimension vs Measure When we choose Color>>Default Properties for Dimension, it gives an option for a distinct color palette. But if we do the same for Measure, it will provide a sequential color palette.


Discrete vs Continuous Discrete in Tableau stands for any data that is individual. It is represented by blue pills. These are used to create headers in our charts. Continuous in Tableau stands for any data that is in chain format i.e. forming an unbroken whole, without interruption. This type of data is represented by green pills. These assist in creating an axis. Discrete and Continuous helps to understand how we want to display our data?


Filters: Discrete vs Continuous When we try to use Discrete fields as filters. We get four options: General, Wildcard, Condition, Top But, if we use Continuous fields as filters, it shows different options.


Putting it all together! Now, since we understood the core meaning of Dimension, Measure, Discrete, Continuous. It's time to combine them and put them in a real project. That means a Dimension is capable of producing either an axis or a header. Similarly, a Measure is also capable of producing either an axis or a header.


Converting a Dimension to Measure and Vice-Versa To use a data field as Dimension or Measure, simply drag and drop it before or after the separating line.


Converting from Discrete to Continuous and Vice-Versa Discrete Field can be converted to Continuous and vice-versa, by just right-clicking and choosing the desired option.


Dimensions in the View The usual case -> When we try to put discrete dimensions in the view, it creates a header. The unusual case -> But, if we try to put a continuous dimension in the view, Tableau will try to aggregate that dimension and will create a continuous axis.


Measures in the View The usual case -> When we try to put continuous Measures in the view, it creates an axis. The unusual case -> But, if we convert the continuous measure to discrete measure, it will give us a header. This case can be useful when we want to create just headers or labels.


Measure Values & Measure Names Whenever you'll load the data in Tableau, you'll always notice Measure Names & Measure Values in the data pane. These values are automatically generated by Tableau and can't be deleted. Measured values are continuous measure, that contains all the measures in the data. Measure name is a discrete dimension, that contains the name of all the measures. We can add Measure Names & Measure Values together when we want to create text tables that show multiple measures. In this example, if for the country "Australia" we want to know everything in form of text tables, rather than dragging and dropping each measure, we could use measure values. Text-tables can create max 50 rows & 16 columns.


Sample Exam Questions from this Topic Tableau automatically generates __ dimensions and __ measures.a. 2,4b. 1,4c. 4,1 d. 4,2 Solution: 1,4


References: [1] Tableau Help  Tableau Software [2] Personal Notes [3]Tableau Desktop Specialist Exam (New Pattern - 2021) - Apisero [4] sqlbelle


Thanks for Reading! Feel free to give claps so I know how helpful this post was for you, and share it on your social networks, this would be very helpful for me. If you like this article and want to learn more about Machine Learning, Data Science, Python, BI. Please consider subscribing to my newsletter: Find me on the Web: www.dakshtrehan.com Connect with me at LinkedIn: www.linkedin.com/in/dakshtrehan Read my Tech blogs: www.dakshtrehan.medium.com Connect with me at Instagram: www.instagram.com/_daksh_trehan_


Want to learn more? Tableau from Scratch (List of Tableau Articles) Machine Learning from Scratch (List of ML Articles) How is YouTube using AI to recommend videos?Detecting COVID-19 Using Deep LearningThe Inescapable AI Algorithm: TikTokGPT-3 Explained to a 5-year old.Tinder+AI: A perfect Matchmaking?An insider's guide to Cartoonization using Machine LearningHow Google made "Hum to Search?"One-line Magical code to perform EDA!Give me 5-minutes, I'll give you a DeepFake!


Sound and Acoustic patterns to diagnose COVID [Part 3]

Bayesian optimization and Hyperopt: Hyperopt is a tool that finds the best model and hyperparameters based on Bayesian optimization and SMBO (sequential Model-based global optimization). Essentially, with Bayesian optimization, it finds P(scoreconfiguration) - the probability of score given a certain configuration, for different configurations and then determines the best one. This configuration can be a model with different values for hyperparameters or different models with different hyperparameters. Using Bayesian optimization, the algorithm is able to narrow down the search space to find these configurations and provide the result faster. I have used this tool to find the best model and parameters for our data set and then implemented it. According to the above, the best model is KNN, with Euclidean distance and K=1. It is also suggested to use L1 normalization as a preprocessing step.


K-Nearest Neighbors: In KNN, neighbors of the query point are found in the dataset, and the class label of the majority of the neighbors is given as the class label for the query point. below is the result. The model produced a train log loss of 0.11 and a test log loss of 0.14. The training accuracy is 100 percent, while test accuracy is 98 percent. It is noteworthy that the difference in loss between train and test loss is less, suggesting the model has not to overfit. From the below confusion matrix plot, it can be observed that all positive points are correctly classified, while one negative point is incorrectly classified in the test data. From the above precision plot, it can be concluded that 85 percent of the predicted positives were actual positives, and 100 percent of the predicted negatives were actual negatives. From the above recall plot, it can be concluded that the positive class has 100 percent recall, while the negative class has 97 percent recall. This concludes the classical machine learning implementations for our problem. In conclusion, KNN performed the best. There is more scope for hyperparameter tuning and getting better results, however, it is clear that classical techniques can classify our data in a very limited capacity and there is a good chance of overfitting to training data. Now, since the problem is that of medical diagnosis, the important metrics for us are the True positive rate and the false-negative rate. It is important to reduce the FNs and increase the TPs. Below is the plot for TP and FN for all the above models.


Deep learning-based models Next, we will implement some deep learning models and analyze their performance.


Convolution neural network A kernel is used to convolve over the image pixel by pixel and the dot product is stored in another matrix, which is the result of this convolution. Many such layers of convolution are used to learn from the input image. In our case, the image is a sound spectrogram that was discussed in detail earlier. All our dataset is converted into spectrograms. CNN is used over these spectrograms, followed by a binary classification layer, to make predictions on whether the spectrogram belongs to a covid positive or covid negative sound. VGGNet: This is convolution-based architecture. Only 3x3 kernels are used for the entire architecture, and 2x2 max pooling is used with stride 2. This immensely simplifies this architecture. VGG 16 has 16 layers. This is being used for transfer learning for our task. In Keras, there is a pre-built VGG 16 model trained on imagenet dataset. Transfer learning refers to re-using a pre-trained model for the current job instead of building the model from scratch. If we remove the top layers, which are flattened and fully connected dense layers, the output received is the bottleneck features. The weights of the initial layers are frozen, so gradients do not pass through them, and the weights are not updated. Fine-tuning means using a lower learning rate, so weights are not updated drastically. In our task, both bottleneck and fine-tuning will be applied to see the results. CNN Model 1: The image data generator and the flow from the data frame method are used to prepare our images for training. After doing the test train split, we get 30 percent images in the validation set and 70 percent in the train set. For the first task of using bottleneck features, the target size of the images used is that of the original spectrograms, which is 288x432. With shuffle as true, the class mode used is binary as our task is of binary classification. In the final model, there is an input layer, then the VGG 16 model with the top removed. The weights are frozen here. Weights are initialized with the imagenet data set. We have a convolution layer, a pooling layer followed by flattened and dense layers. In the end, we have a single sigmoid neuron for binary classification. Model is compiled with Adam optimizer with a learning rate of 0.01, binary cross-entropy loss, and a set of metrics. The metrics include binary accuracy, TP, FP, TN, FN. The model was trained for 50 epochs. The model produced an accuracy of 100 percent for the training set. A 0.94 accuracy for the validation set with 3 false negatives in total. CNN Model 2: For the second task of fine-tuning the VGG 16 model for transfer learning, the images are resized to 224x224, which is the standard input size of the VGG-16 model. With shuffle as true, the class mode used is binary as our task is of binary classification. In this model, the base model is VGG 16. We have frozen the initial layers of this model but did not freeze the later layers. 6 layers are not frozen. The final model contains the input layer, VGG 16 described above followed by 2 convolution layers. Here convolution layers are used instead for fully connected layers. This speeds up the training. Then there is a flatten layer, followed by the output layer of sigmoid activation. There are approximately 130 million trainable parameters in this network. While compiling this model, we have used the concept of reducing the learning rate. We used the Adam optimizer with a lower learning rate of 0.0001. We also used the same metrics described previously. Using reducing learning rate with a minimum of 0.000001. As seen above, we trained the model for 50 epochs. An accuracy of 100 percent on the train set and an accuracy of 96 percent on the validation set are obtained. However, the false-negative is only 1, and the false-positive is 1. This is much better than the CNN model 1 as we care most about reducing FN and increasing TP, which was achieved in this model.


Multilayered Perceptron A multilayered perceptron was built with 4 dense layers, an input layer, and an output layer. The output consists of 1 sigmoid unit as our task is that of binary classification. As metrics, binary accuracy and confusion matrix components are used. Binary cross-entropy is used as a loss function. Adam optimizer is used as an optimizer with 0.01 as the learning rate. Here we have used the tabular features that were used for classical machine learning models. Below is the model summary. Our model has around 186,000 trainable parameters. As observed above, the model was trained for 100 epochs and the loss at the end is very low. A 100 percent train and validation accuracy was achieved with this model. Rerunning the MLP based model, using several train test splits, to understand average performance In this experiment, multiple train test splits were created and an MLP model was run on them. The performance metrics were captured and recorded. As observed above, this is the first run of 5 runs, wherein in the train data set we have 14 positive points while in the test dataset, we have 5 positive points. After running the model for 100 epochs, the test loss was 0.014, accuracy was 100 percent. A similar process was repeated 5 times on different train test splits. Below is the final result. As observed, the accuracy is above 90, and close to 100 in many runs. More importantly, we have low false negatives and high true positives. Thus, we will move ahead with this model as the final model and productionize it.


Deployment and Productionisation The final model used is a deep learning MLP model. The two key files needed for deployment and product ionization are the saved model file and the pickle file for data standardization. An API is created around the model that takes in the audio file as an input and returns the label as output. The output is in JSON format. The UI is simple. The file is uploaded and the classify button is clicked. This will post the file to the server and a class label will be returned back to the client. This is achieved using the flask API module. We will use the AWS cloud for deploying this application. We will use an elastic cloud compute service. First, an EC2 instance will be launched and required libraries are installed. Then using a secure copy, we will transfer the required files from the local to the EC2 box. Then run the app.py file on the EC2 server.


Conclusion In this case study, we attempted to create a working model that could classify cough sounds. Even with a small dataset, the results were good and promising. Both classical machine learning methods and deep learning methods were employed. In classical methods, KNN gave the best results. To find the best model, we also utilized Bayesian optimization. In deep learning methods, multi-layer perceptron and convolution neural networks were implemented. For classical methods and MLP, we used tabular data. The data was engineered from the time series of the audio signal. For CNN, we used spectrograms. As a final model, we chose MLP as it gave good results and is faster to train. It has a comparatively low prediction time and low prediction cost when compared to CNN. The model was deployed on the AWS EC2 service. Around the model, an API was developed using Flask. Hope you enjoyed reading it!!


Trends in AI - April 2022

Research We've analyzed the most recent research literature and created this editorial selection of 10 papers you shouldn't miss on topics such as hyperparameter tuning, Reinforcement Learning, Language Modeling for reasoning, High-performance parallel computing, and much more.


Trends in AI - April 2022

1. Tensor Programs V: Tuning Large Neural Networks via Zero-Shot Hyperparameter Transfer By Greg Yang, Edward J. Hu et al.  Why -> Hyperparameter tuning is a make-it-or-break-it ingredient in the recipe for creating SOTA models. Unfortunately, for large models, this often requires an outrageous amount of computing resources, which further pushes away smaller players with limited resources. This work shows how hyperparameter tuning can be done more efficiently, which could be huge if true.  Key insights -> In order to successfully train a neural network, one must choose suitable hyperparameters. Not that long ago, hyperparameters were only a handful (e.g. fixed learning rate, convolution kernel sizes, strides, etc.) but nowadays the hyperparameter space has grown to be much more complex: warm-up, scheduling of learning rate, optimizers, variable masking ratios, number of attention heads, hidden dimensionalities... and the list goes on and on. You can shrink a NN in such a way that optimal hyperparameters will be invariant when you grow the network - or these will change predictably. This method enables finding optimal hyper-parameters in a small model and then growing the model to run the final resource-intensive training run. This method - called μTransfer-is rooted in theoretical analysis and provably works under certain conditions, but the authors also show empirically that this method can be applied in looser by growing using the technique on modern Transformers. This method still has many limitations as the authors recognize themselves, but it sets an interesting direction to facilitate training of large models, even further optimization of existing models, or even enabling HP tuning of next-generation huger models in the multi trillion-parameter scale.


Trends in AI - April 2022

2. Visual Prompt Tuning By Menglin Jia, Luming Tang, et al.  Why -> ML is clearly moving to a place where people won't build models from scratch, but instead use pre-trained models to bootstrap your implementation. In this environment, techniques that squeeze the most out of large pre-trained models in downstream tasks while being computationally cheap will be key. Prompting is one such technique.  Key insights -> The authors explore how various "partial tuning" techniques compare in terms of the percentage of tuned parameters/performance ratio. Until recently, large pre-trained models were finetuned by using labeled data and propagating the gradient across the whole architecture. However, in the past year, prompt tuning has emerged as a viable alternative: keep the pre-trained model weights frozen and prepend a set of embeddings into the input that can be learned through gradient descent and some labeled data. This technique had proven to be effective on NLP tasks and is now being used for image classification, where it shows very competitive performance not only in terms of efficiency but also in absolute accuracy. Perhaps more importantly, prompt tuning shines the most in the few-shot regime, where full finetuning often struggles. An added benefit of prompt tuning is that it lets you conceptualize the pre-trained models as input/output black boxes, potentially enabling training a model that's only accessible via API (either with gradient-free optimization⁷, or gradient descent whenever gradients are available), which is a direction the industry is moving towards. Related: Delta Tuning: A Comprehensive Study of Parameter Efficient Methods for Pre-trained Language Models


Trends in AI - April 2022

3. Pathways: Asynchronous Distributed Dataflow for ML and PaLM: Scaling Language Modeling with Pathways By Paul Barham et al.  Why -> If -big if- scale is truly all you need, the tooling for scaling things up massively will be an indispensable part of the future of AI, and this is Google's version of it, along with its latest huge 540 billion parameter Transformer.  Key insights -> This paper is Google's blueprint for Pathways, "a large scale orchestration layer for hardware accelerators which enables heterogeneous parallel computations on thousands of accelerators while coordinating data transfers over their dedicated interconnects." Existing accelerator frameworks are good at running the same computation across different parts of the data in parallel which are later synchronized (aka Single Program Multiple Data, SPMD). Instead, Pathways is designed to be able to compute more heterogeneous computations in parallel (aka Multiple Programs Multiple Data, MPMD). This enables training and hosting models like the just-released 540 Billion-parameter (dense) PaLM: Scaling Language Modeling with Pathways⁶, which is trained on 6144 TPU v4 chips across multiple pods. This dense model is the latest flagship by the company which achieves state-of-the-art in many zero, one, and few-shot NLP tasks, beating a lot of human baselines in the process.


Trends in AI - April 2022

4. STaR: Selt-Taught Reasoner. Bootstrapping Reasoning With Reasoning By Eric Zelikman, Yuhuai Wu, and Noah D. Goodman.  Why -> Logical reasoning is often mentioned as a weakness of large Language Models (LMs): while they might sometimes get it right, they often fail at basic common sense reasoning. This paper hints at a promising direction that could unleash the potential of plain language modeling for more advanced human-like reasoning.  Key insights -> A rationale is an explicit logical explanation of why a belief is held or action is taken. While previous works had shown how explicit rationales can improve LMs performance in several scenarios⁵, this work shows how reasoning ability can be bootstrapped without relying on large-scale human-labeled annotations. In this work, the authors only use a problem-solution corpus (without human rationales) but make the LM generate rationales for its answer, whenever the answer is correct those rationales are considered valid and trained accordingly. According to the authors, this is a synergistic process in which improvements in rationale generation improve the training data, and improvements in training data improve the rationale generation of the model. To prevent this process from saturating when the model fails to solve any new problems in the training data, the answer is provided to the model which then generates a rationale backward which is then added as training data. The experimental results are not very extensive but they clearly have signs for optimism: faster learning and on-par reasoning performance with the 30x larger GPT-3 model. Moreover, the STaR system clearly outperforms its vanilla rationale-free counterpart which is trained only on problem-solution pairs.


Trends in AI - April 2022

5. Do As I Can, Not As I Say (SayCan): Grounding Language in Robotic Affordances  Project page By Michael Ahn et al.  Why -> Lack of real-world grounding is a common critique of existing language models: how can any model have any meaningful understanding of language if it's not combined with observation and interaction of other modalities like vision?  Key insights -> A human user provides an instruction to the robot which can be long, abstract, or even ambiguous. The role of the LM is to disambiguate the instruction into shorter atomic steps. This is quite similar to previous work on using pre-trained Language Models to map high-level instructions into low-level actions¹⁰, but taking it a step further by including real-world robots enacting plans, instead of relying solely on simulations. Another interesting recent work that uses pre-trained Language Models to guide learning representations for images is Integrating Language Guidance into Vision-based Deep Metric Learning.


Trends in AI - April 2022

6. Latent Image Animator: Learning to Animate Images via Latent Space Navigation By Yaohui Wang, Di Yang, Francois Bremond, and Antitza Dantcheva.  Why -> Photorealistic animation with deep learning is pretty damn cool, and if it progresses it can become an enabling technology for applications such as gaming and VR.  Key insights -> Existing Deep Learning based image animation frameworks often rely on structured representations of images: human key points, optical flows, 3D meshes, and so on. This work proposes a Latent Image Animator (LIA), which only relies on a self-supervised image autoencoder without any explicitly structured representations. Instead, they define a Linear Motion Decomposition which aims to describe movement in a video as a latent path via a linear combination of a set of learned motion directions and magnitudes. The method consists of 2 models, an encoder and a generator. For training, 2 frames of the video are used as a self-supervised source of data that lets the model encode different views of a subject into its identity and decomposable motion parts, which the generator takes to output an image from which a reconstruction loss is derived. For inference, the source and driving image are replaced with different people, for which the model generates an output image with the identity of the source but the pose of the driving image.


Trends in AI - April 2022

7. Efficient Language Modeling with Sparse all-MLP By Ping Yu et al.  Why -> Is the role of architectures in ML shrinking even further? I'd argue yes.  Key insights -> Pay attention to MLPs¹ already showed us that "attention-free architectures" were competitive in language modeling, where information across tokens was propagated with a more rudimentary combination of MLPs. Now this work expands this idea to work in a sparse Mixture-of-Experts setting which has even stronger scaling behavior. In this work, we analyze the limitations of MLPs in expressiveness and propose sparsely activated MLPs with mixture-of-experts (MoEs) in both feature and input (token) dimensions. Similar to previous "all MLP architectures" for vision², information across and within tokens is mixed is by applying Fully Connected (FC) layers tokenwise, then transpose/mix, and then applying the FC feature-wise (see figure below).


Trends in AI - April 2022

8. Kubric: A scalable dataset generator   Code By Klaus Greff et al.  Why -> When natural labeled data is hard or expensive to come by synthetic data can come to the rescue. Here's the latest collaborative effort to build a library that enables the end-to-end creation of computer vision data.  Key insights -> Data generation software is less mature than its modeling counterpart, which is why the authors argue that more efforts are required on the side of tooling for data generation. Kubric is an open-source Python framework that interfaces with PyBullet (physics simulation engine) and Blender (rendering engine) to generate photo-realistic scenes with fine-grain control and dense annotations. A typical data generating pipeline (see figure below) combines fetching assets from an asset source, composing a scene with these assets as well as camera positioning, running physics simulation over the environment, and rendering it as different layers with the desired annotations and metadata. The library is also designed to scale across distributed computing to generate large amounts of data in HPC environments. The authors showcase the library by creating 13 datasets with new vision challenge problems ranging from 3D NeRF models to optical flow estimation with benchmark results.


Trends in AI - April 2022

9. Training Compute-Optimal Large Language Models By Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, et al.  Why -> BERT³ was a smashing success despite being massively underoptimized⁴, and new models being far from their true potential seems to be the rule not the exception when it comes to novel large Language Models. Are there optimization rules that can generalize and be applicable to a wide range of large-scale models to minimize this? It seems so.  Key insights -> The axis of study here is model size and the number of tokens seen in pretraining: given a fixed computation budget, should you pre-train a bigger language model on not-so-many tokens, or pret-rain a smaller model on more tokens? Interestingly, they find that compute-optimal scaling is pretty much scaling the model just as much as scaling the data. Largely speaking, existing works err on the side of training on two few tokens and having models that are too big. For instance, the authors show how a model 10x smaller than GPT-3 achieves performance parity when trained on a large enough corpus. The resulting family of models is named Chinchilla.


Trends in AI - April 2022

10. Make-A-Scene: Scene-Based Text-to-Image Generation with Human Priors By Oran Gafni et al.  Why -> Yet another step forward in the domain of controlled image generation.  Key insights -> We've gotten used to text-guided image generation, especially since OpenAI's DALLE⁸ rise to fame in early 2021. This work belongs to the same family of likelihood-based image generation on discrete tokens: learn discrete representations for image patches (using VQ-VAE⁹ or similar methods), and then do training and inference with an autoregressive prediction of next token with text-image pairs a la Language Modeling. There are 3 key novel components of this system that set it apart: Ability to add a scene (image segmentation) as part of the prompt.The use of a modified VQ-GAN⁹ model to learn high fidelity discrete patch representations which incorporate a perceptual loss.The addition of classifier-free guidance eliminates the need for post-generation filtering. Check out their story showcase! Other recent Computer Vision papers you might like about image segmentation are Unsupervised Semantic Segmentation by Distilling Feature Correspondences or Object discovery and representation networks.


Joining Data in Tableau: A Road to Tableau Desktop Specialist Certification

Table of Content Logical Layer & Physical LayerRelationshipsJoinsUnionsData BlendingWhich one to choose?Sample Exam Questions from this Topic


Logical Layer & Physical Layer Tableau Data Model comprises of two layers: Logical Layer -> The default data canvas view in our Data Source Page is our Logical Layer. It enables to join the data using Relationships(or Noodles). While combining data from multiple tables, we don't specify joins in Logical Layer but rather perform Relationship where Tableau automatically chooses adequate join type based on data and analysis. Tables formed in Logical Layers are known as Logical Tables. In earlier Tableau versions, there was only a Physical Layer, but from v2020.2 onwards, Tableau introduced Relationships & Logical Layer. The tables in logical layers aren't merged, instead, they remain distinct. The logical Layer consists of merged Physical Tables and other Logical Tables. Logical Tables may contain single or multiple physical tables associated with unions or joins. Physical Layer -> This can be regarded as a sub-logical layer, to access it, double click a logical table. It enables a combination of data using Joins/Union. Tables joined in Physical Layer are known as Physical Tables and are merged into a single flat table after transformations.


Relationships Relationships are the just launched USP of Tableau. It makes data joining easy for all, and doesn't specifically requires the knowledge of joins/union. These are denoted by a Noodle-like structure and are readily available on the Data Canvas page. The relationship can only be made in the Logical Layer. These are like a contract between two tables based on some matching field, following that contact Tableau automatically performs appropriate joins and combines the data. The matching field must have the same data type and it doesn't matter if matching columns are from the same data source or different. Relationships don't support Geographical data types as matching fields. Relationships require at least 1 data source. Relationships retain the original table structure. Relationships can't be defined on published data sources. Relationships are computed locally. A Relationship can't be edited after publishing a data source. When we join multiple tables using Relationships, Tableau automatically detects the field with the same name and creates a relationship. If data sources have different field names, Tableau would ask the user to define matching columns. To improve performance, we can modify the cardinality and look into referential integrity. But, most of the time, it is better to leave it to Tableau.


Joins Joins are a traditional method to combine our data based on certain conditions. In Tableau, Joins can only be done in the physical layer. To create a join, double-click on a logical table. Joins will always create a new table. A Join combines the data and then aggregates. Joins are Static. It requires at least 1 data source. It can be applied to multiple data connections. Joining data with different aggregations or levels of detail can cause data duplication. Tableau supports four types of joins: Inner, Outer, Left, Right. For illustrations, let's take two tables: Names and Marks. Inner Join -> It represents only those values that are common in both tables. If a value isn't entirely matched in either table, it will be dropped immediately. In our examples, we just had marked for StudentID 1,3, 5 and therefore, we got Student Name for those IDs respectively. Outer Join -> It represents all the values from both the tables, if a value from either table doesn't match, there will be a null value right there. In our example, since we only had 3 matching rows in both tables, the marks for the other ones were assigned as null. Right Join -> It represents all the values from the right table, if a value from left-right table doesn't match, it will be assigned null. If we perform right join on our tables Name & Marks, the result would be somewhat like inner join(it is not necessary that every time result of inner join and right join will be the same). But, if we perform the right join between Marks & Name, the result would be totally different i.e. like Outer Join. Left Join -> It represents all the values from the left table, if a value from right table doesn't match, it will be assigned null. If we perform left join on our tables Name & Marks, the result would be somewhat like outer join(it is not necessary that every time result of outer join and left join will be the same). But, if we perform left join between Marks & Name, the result would be totally different i.e. like Inner Join.


Cross-Database Joins Cross-database joins requires setting up data sources from multiple connections To create a Cross-Database join: Step1: Click on "Add". Step2: Add another connection. Step3: Once we go to the worksheet, we can find all the data in a single source. We can toggle between them.


Union Union is a way to append two data connections with the same number of columns and data types. This happens in the Physical layer, which can be accessed by double-clicking on a Logical Table. Union will always create a new table. Data from different data sources can't be unioned. In a union, Tableau adds reference fields to help identify the source of the data. A unioned table can be used to create joins. The union can be done in two ways: Manually, Wildcard Search


Manual Union To create a manual union, enter the physical layer and click on "New Union".


Wildcard Union This method is automatically creates a union between tables. The wildcard character will help to find a specific pattern for the table name. It will create a union with all files having "Order" in its name.


Matching Field Names or Field Ordering If two fields have different names or no names, we can ask Tableau to perform a union on basis of the ordering of data in tables.


Merging mismatched values When values in two tables are not matched, they are replaced by null values in the union table. We can merge all the non-matching fields together, to get rid of null values.


Data Blending Data Blending is another method to join data from multiple connections in Tableau. This is best for connecting data with different levels of details or in simple words, connecting data with different file formats. Blending requires two connections namely primary and secondary. The first chosen connection will be deemed as primary and later would be secondary. The primary connection will be represented by blue color, while the secondary connection will be represented by orange color. A blend aggregates and then combines. Blends retain the original table structure. Data Blend is a left-outer join between primary and secondary tables, there might exist some missing data from the secondary table. Data blends are worksheet specific i.e. different for different worksheets. There must be a common dimension between the data sources to create a data blend. Data is never truly combined in Blend but each data source is queried independently and the results are aggregated and presented together. The blended data can't be published to Tableau Online or Tableau Server. There are some data blending limitations around non-additive aggregates, such as COUNTD, MEDIAN, and RAWSQLAGG.


Which one to choose? Before answering this question, let's have a recap of all joining types: Relationships & Joins requires a single data source whereas Blends requires at least two data sources. Relationship, Join, Blend is the way to bind data on certain conditions but Union just appends the data. Now, the competition and confusion come down to three contenders: Relationship, Joins & Blend.


Sample Exam Questions from this Topic Relationships can be joined in Geographical fields/Calculated fields? TrueFalse Solution: False


References: [1] Tableau Help  Tableau Software [2] Personal Notes [3]Tableau Desktop Specialist Exam (New Pattern - 2021) - Apisero [4] sqlbelle


Thanks for Reading! Feel free to give claps so I know how helpful this post was for you, and share it on your social networks, this would be very helpful for me. If you like this article and want to learn more about Machine Learning, Data Science, Python, BI. Please consider subscribing to my newsletter: Find me on the Web: www.dakshtrehan.com Connect with me at LinkedIn: www.linkedin.com/in/dakshtrehan Read my Tech blogs: www.dakshtrehan.medium.com Connect with me at Instagram: www.instagram.com/_daksh_trehan_


Want to learn more? How is YouTube using AI to recommend videos?Detecting COVID-19 Using Deep LearningThe Inescapable AI Algorithm: TikTokGPT-3 Explained to a 5-year old.Tinder+AI: A perfect Matchmaking?An insider's guide to Cartoonization using Machine LearningHow Google made "Hum to Search?"One-line Magical code to perform EDA!Give me 5-minutes, I'll give you a DeepFake!


Top Three Tips on Turning Data Into Profits: A Blog on How To Turn Business Analytics Into Profits

1. How to Set Goals? Setting goals is often an afterthought in businesses. Perhaps they think they're too busy to set goals, or they're too focused on getting everything done that they forget to stop and set goals. The reality is that a business's goals are its roadmap. Goals define where a business is going, and the more specific the goals the more focused the business is on getting there. Achieving business goals is one of the primary objectives of any business owner. To attain these goals, you must first set them. This can seem like an overwhelming task as there are hundreds of different possible goals you could set your business to achieve. But there are only five categories of goals: operational, financial, strategic, long-term, and short-term goals. Goals aren't just fantasies you hope to achieve someday. They're important steps on your path to success. Goals help you visualize what you want to achieve and how you're going to get there. Goals can help you set short-term and long-term objectives, and they can help you set priorities and measure your progress. The most important thing you can do when you want to achieve something is to set a goal. Goals are things that you want to achieve, and the first step to achieving them is to make them clear. A goal that is not clear is not a goal at all. A goal must be written down and kept in front of you at all times, otherwise, you will not be able to work towards it. You must be as specific as you can be when you set a goal. A goal that is not specific is also not a goal at all. A goal is not a goal if you don't know what it is that you want to achieve. You must be specific about the kind of result you want to achieve. If you want to achieve money, you must be specific about how much money you want to achieve, and you must be specific about how you will achieve it. You must be specific about the date by which you want to achieve it. And you must be specific about how you will measure whether you have achieved it or not.


2. How to use Analytics to Reach your Goals Business analytics can be defined as the use of information and analytical techniques to aid in decision-making. Business analytics can be used to solve a wide variety of business problems. Business analytics is a process of collecting, analyzing, and reporting data to help managers make more effective decisions. Business analytics can be done in many ways. From trying new data collection methods to improving the way managers use the data they already have. Business analytics can also be used to create better models and more accurate predictions. Business analytics is a tool that is being used more and more to make decisions and drive profits in any business. But how do you use it? What's the best way to set it up? How do you make sure it's not going to be a costly mistake? There are a few ways to start turning data into profits; here are a few tips to help you get started: 1. If you're going to do data analytics, you need to be tracking your data. Start small - don't try to get everything you can out of data right off the bat. Start with the most important aspects of your business - marketing, finances, or sales. 2. You need to know what you're looking for in your data. This will help you to know how to use it. Analyzing data just for the sake of analyzing it is like reading a book without knowing what it's about. You can't fully experience the book without knowing what you're reading about. 3. Your data tools need to work with your analytical goals. If you want to be able to analyze your data quickly, you might want to consider cloud-based tools, like Google Analytics or Tableau. If you plan to do a lot of in-depth analysis, you might want to consider a more robust tool, like SAS. Every business wants to get ahead of its competitors. The problem is that many businesses don't have a good idea of where they stand compared to their competition. The reason for this is that most businesses don't track the right data or they don't know how to read that data correctly. But by tracking the right data and studying it, you can easily find areas for improvement. The problem with many business owners is that they think they have to spend thousands of dollars on tracking software when they don't. Free, simple, and easy-to-use tools are available to businesses, and they can be used to turn data into profits. The first step in turning data into profits is to make sure you have the right data. While some data is important, like revenue and profit, you need to make sure you have data that can help you make revenue and profit. The first thing you should look at is your website. While it might seem like a good idea to track every single thing that happens on your website, it isn't. You need to look at the information that is going to help you understand how people are using your website and what they are doing before they convert.


3. How to Apply Analytics to your Business Business analytics is all about having a clear view of your company's performance. The more you know about your business, the better you are able to make decisions that will help you grow. While many businesses are now turning to data analytics, many are still hesitant to do so. The thought of hiring a data analyst and learning new skills, such as web analytics, can be daunting. But, the truth is that you don't need to be a data expert to start using data analytics in your business. There are many ways to use data analysis to your advantage, including Automated reporting on customer activity and feedback, using tools such as Google Analytics, or Kissmetrics. Data is everywhere. From the GPS in your car to the ads you see on the subway and on your phone, it's hard to go about your everyday life without encountering some form of data. Data has become an increasingly important aspect of running a successful business, and the ability to turn that data into profits is becoming more and more important. Data analytics can be applied to a spectrum of areas within a business, from marketing and product development to customer service and social media. Business analytics is the business intelligence that shows you where your strengths and weaknesses are. Business analytics can help you transform your business strategy, and it is a way to make informed decisions based on data. Business analytics is a combination of business performance, operations, and financial data that can help you uncover new opportunities, make better business decisions, and drive increased profitability. There are many different types of business analytics, including dashboards and reports, business intelligence, predictive analytics, and online analytics. Analytics have become the norm in business. Companies are making huge gains by using analytics to increase their revenue and profits. The problem is, that the analytics most companies use are old-fashioned. They still rely on the same archaic, low-level analysis that has been around for ages. They use it because it's easy and quick and because it's what they've always done. The problem is, it's not going to help them cut costs, increase revenue or gain a competitive edge. It's going to be left in the dust as analytics evolves. Analytics has become more than just statistics. It's now a way to apply predictive modeling to business, and it's changing how companies work. By using analytics to analyze the right data, you can discover the right answers. You can use analytics to find trends in your business and in your industry, to predict the future, and to make better decisions. Analytics is an integral part of business today, and it's going to be a bigger part of business in the future.


Live vs Extract Connection: A Road to Tableau Desktop Specialist Certification

Table of Content Live ConnectionExtract ConnectionSelecting a better connection type for your dataSample Exam Questions from this topic


Live Connection As the name suggests, a Live connection is made when we want our data to keep flowing in our Tableau Data source from a dynamic database. This offers flexibility when we want real-time updates and instantaneous insights. Live data process queries in the source database. By default, when we create a connection, it is a Live connection. Single Cylinder represents Live Connection -> With Live connection, the data in our worksheet would be updated every time we re-open a worksheet or manually refreshes the data. To refresh the live data ->


Extract Connection "Extracts" are one of the most underrated features of Tableau. An Extract file have .hyper extension(previously referred as .tde) An extract connection is made over tde. Tableau Data Extract(.tde/also referred to as hyper file) is a compressed snapshot of live data that is stored locally and loaded into memory. To ease off our connection and minimize the load due to complex data, we can apply filters to our data, save it as a .hyper file and later use them for our extract connection. This tends to be much faster than Live Connections and hence provides an edge when used for complex visualizations. An extract process queries using Tableau Data Engine because a hyper file is so much optimized and efficient that Tableau in-memory Data engine can process queries easily. An extract is only an extract for that particular workbook, and when it will be shared with others it will act as live data. Double Cylinder represents Extract connection -> Extracts can't be updated automatically, but can only be refreshed either manually or periodically.


Extracting Data in Tableau Method 1 Step1 -> Chose "Extract" Connection Step2 -> When we chose "Extract" Data, Tableau ask for the location of .hyper file. Method 2 Step1 -> Go to the Data pane and right-click on Data Connection and click on "Extract Data" Step2 -> Add filters and modify the extract according to your needs.


Refreshing an Extract in Tableau Once an extract is made and loaded in our Workbook, there are two ways we can refresh our data: The first option will refresh the connection, but since the connection is static, there won't be any changes reflected in your data. This option is also present in Live connection and is more specifically to be used when we are working with Live data. The second option will create a new snapshot of the data i.e. new extract and hence the data in our workbook would be updated. To periodically refresh the data automatically, we can publish our data to Tableau Server and can choose the time interval for refreshing. Tableau offers to refresh the data in two ways, we can either go for a full refresh, which replaces all the content in the extract or can use an incremental refresh, which only adds new rows.


(Logical)Single Table vs Multiple(Physical) Table Extraction Logical Tables are extracted by default. Only use Physical tables, when the extract constitutes multiple tables with equality joins and meet the following conditions: No RAWSQL.No Incremental refreshes.No Sampling.No Extract Filters.Data Types of Columns used for relationship/joins are identical.All joins between physical tables are equality joins. Physical Tables should only be used when the size of our extract is larger than expected while Logical Tables must be used when we want to limit the amount of data in our extract using Filters or aggregations.


Benefits of Live Connection Allows working with real-time data and provides instantaneous insights.This connection is suggested if you're working with a rapid database.


Benefits of Extract Connection This can be used if you want a portable dataset.It helps us to limit the amount of data we need.It improves performance and efficiency.These are fast to create and work with.These support additional functionalities such as the COUNTD function.


Disadvantages of Extract Connection This connection is not suggested while working with sensitive data, as the extract is saved locally and hence can be shared with anyone.This requires a manual refresh.


Sample Exam Questions from this Topic Can we automatically refresh our Extract data? TrueFalse Solution: True


References: [1] Tableau Help  Tableau Software [2] Personal Notes [3]Tableau Desktop Specialist Exam (New Pattern - 2021) - Apisero


Thanks for Reading! Feel free to give claps so I know how helpful this post was for you, and share it on your social networks, this would be very helpful for me. If you like this article and want to learn more about Machine Learning, Data Science, Python, BI. Please consider subscribing to my newsletter: Find me on Web: www.dakshtrehan.com Connect with me at LinkedIn: www.linkedin.com/in/dakshtrehan Read my Tech blogs: www.dakshtrehan.medium.com Connect with me at Instagram: www.instagram.com/_daksh_trehan_


Data Types in Tableau: Using & Cleaning; A Road to Tableau Desktop Specialist Certification

Table of Content: Data Types in TableauExploring MetadataModifying MetadataChanging Data Type  Changing data type in the source page Changing data type from the data pane Changing data type in the viewHandling Mixed Data TypesSample Exam questions from this topic


Data Types in Tableau Data is the fuel powering Tableau and every field in our dataset constitutes data that belongs to a generic data type. The data type helps the software to understand the kind of data stored in that field. Tableau supports 7 data types. As soon as new data is uploaded, Tableau automatically detects the data type and assigns it to the fields. The data type can also be modified manually once the data is uploaded. String -> The "string" data type constitutes zero or more characters enclosed in single or double quotes. e.g. "Tableau is a BI tool" or 'Tableau is a BI tool'. The string data type can be classified in: Char: In char data type, the value of a string is of fixed length. If we try to load a value of a length greater than the specified length, Tableau throws an error. This data type is used to store alphanumeric data values.Varchar: Varchar stands for Variable char, the length of characters is flexible here and has no memory allocation restrictions. Date & Time Values -> This data type is used to store dates and times. Tableau can store dates in dd-mm-yy, dd-mm-yyyy, mm-dd-yyyy format. Some fields only include the date and hence can be stored in date data types. Some fields that store both date and time (more like a timestamp) can be stored in date & time data type. The time value can be a decade, year, quarter, month, day, hour, minute, second, etc. If you wish to enter a date in "string" format use "#" before the date. e.g. #14012022 and it will be stored in string format. Numerical Values -> This data type can contain either float or integer data points. We can also perform manual calculations over them to get a deeper insight into our data. Boolean Values -> This data is the result of relational calculations and can only contain two values: True or False. Geographic Values -> This data type is represented by the globe and contains the data that can be used in maps. This includes Latitude, Longitude, Country, Cities, Region, Postal Codes, etc. We can convert textual fields to geographic data We can change the geographical role of a dimension. There are two Maps available - Symbol Map and Filled Map. The geographic region data type is also a string. Cluster Groups -> Sometimes the data is too rough and represents mixed data types, this is the type of data that is stored in Cluster groups. Such kind of data can be handled either manually by segregating fields or letting Tableau do its wonders.


Exploring Metadata In Tableau, when we connect data to the Start page, we get a data preview where we can check out metadata for each column. By default, we can peek at only 1000 rows. To explore more about Metadata, click on "Manage Metadata: -> We can get Metadata in the following orders -> The metadata contains "Field name", "Data Type", "Table Name" and "Remote Field Name". The metadata is automatically identified by Tableau and can be further modified manually. When using the manage metadata option, when we change the name of a field, it is referred to as "Field name" which was previously referred to as "Remote Field Name"


Modifying Metadata We can perform the following operations on fields using the "Managed Metadata" option -> Tableau can further define its decision(on how it chose which data type this field has) and more about that field.


Changing Data Types Tableau automatically defines a data type for each field, but we can also manually challenge its decisions and change the data type for each field. This can be done in three ways: