{"id":4314,"date":"2022-01-17T10:04:06","date_gmt":"2022-01-17T09:04:06","guid":{"rendered":"https:\/\/www.m2hycon.de\/?p=4314"},"modified":"2024-04-23T15:41:17","modified_gmt":"2024-04-23T13:41:17","slug":"introduction-to-ragged-tensors","status":"publish","type":"post","link":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/","title":{"rendered":"Intro\u00adduc\u00adtion to ragged tensors"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"4314\" class=\"elementor elementor-4314\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ff85573 elementor-section-full_width elementor-section-height-min-height red noisy elementor-section-height-default elementor-section-items-middle\" data-id=\"ff85573\" data-element_type=\"section\" data-e-type=\"section\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-no\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-482e998\" data-id=\"482e998\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a820fea elementor-widget elementor-widget-theme-post-featured-image elementor-widget-image\" data-id=\"a820fea\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"theme-post-featured-image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"512\" src=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960-1024x512.jpg\" class=\"attachment-large size-large wp-image-4326\" alt=\"Introduction to ragged tensors\" srcset=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960-1024x512.jpg 1024w, https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960-300x150.jpg 300w, https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960-768x384.jpg 768w, https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960-1536x768.jpg 1536w, https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960.jpg 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-8c2be4e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"8c2be4e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-923e421\" data-id=\"923e421\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7118ddc elementor-widget elementor-widget-theme-post-title elementor-page-title elementor-widget-heading\" data-id=\"7118ddc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"theme-post-title.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h1 class=\"elementor-heading-title elementor-size-default\">Intro\u00adduc\u00adtion to ragged tensors<\/h1>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b319741 elementor-widget elementor-widget-post-info\" data-id=\"b319741\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"post-info.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<ul class=\"elementor-inline-items elementor-icon-list-items elementor-post-info\">\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-db030de elementor-inline-item\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-custom\">\n\t\t\t\t\t\t\t\t\t\tVon Torben Windler\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<li class=\"elementor-icon-list-item elementor-repeater-item-2efc209 elementor-inline-item\" itemprop=\"datePublished\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text elementor-post-info__item elementor-post-info__item--type-date\">\n\t\t\t\t\t\t\t\t\t\t<time>January 17, 2022<\/time>\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-f9ac5b0 elementor-section-content-middle elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f9ac5b0\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-c38a12e\" data-id=\"c38a12e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5c8e1ed elementor-widget__width-auto elementor-widget elementor-widget-text-editor\" data-id=\"5c8e1ed\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h4>Beitrag teilen:<\/h4>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ae685d9 elementor-share-buttons--view-icon elementor-share-buttons--skin-minimal elementor-share-buttons--color-custom elementor-widget__width-auto elementor-share-buttons--shape-circle elementor-grid-0 elementor-widget elementor-widget-share-buttons\" data-id=\"ae685d9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"share-buttons.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-grid\" role=\"list\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_facebook\" role=\"button\" tabindex=\"0\" aria-label=\"Share on facebook\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<i class=\"fab fa-facebook\" aria-hidden=\"true\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_twitter\" role=\"button\" tabindex=\"0\" aria-label=\"Share on twitter\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<i class=\"fab fa-twitter\" aria-hidden=\"true\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_linkedin\" role=\"button\" tabindex=\"0\" aria-label=\"Share on linkedin\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<i class=\"fab fa-linkedin\" aria-hidden=\"true\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-grid-item\" role=\"listitem\">\n\t\t\t\t\t\t<div class=\"elementor-share-btn elementor-share-btn_xing\" role=\"button\" tabindex=\"0\" aria-label=\"Share on xing\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-share-btn__icon\">\n\t\t\t\t\t\t\t\t<i class=\"fab fa-xing\" aria-hidden=\"true\"><\/i>\t\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-f408ab5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f408ab5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-281546f\" data-id=\"281546f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d986110 maths elementor-widget elementor-widget-text-editor\" data-id=\"d986110\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<h3>Intro\u00adduc\u00adtion<\/h3><div>&nbsp;<\/div><div>We review Tensorflow\u2019s concept of <a href=\"https:\/\/www.tensorflow.org\/guide\/ragged_tensor\"><span style=\"text-decoration: underline;\"><strong>ragged tensors<\/strong><\/span><\/a>, which were intro\u00adduced at the end of 2018. We explain their basic struc\u00adture and why they are useful.<\/div><div>&nbsp;<\/div><h3 id=\"problem-statement\">Problem state\u00adment<\/h3><div>&nbsp;<\/div><p>With the standar\u00addiza\u00adtion of tradi\u00adtional machine learning problems, many models are very easy to imple\u00adment: read a table of features from a database, use pandas and numpy for prepro\u00adces\u00adsing, build a model with one of the well-known libra\u00adries, and type <strong>model.fit()<\/strong>. In many cases \u2013 that\u2019s it! Done!<\/p><p>But wait \u2013 what if the data does not come in tabular form and is irregular by nature? What if there are instances with varying dimen\u00adsions? Consider a scenario for time series classi\u00adfi\u00adca\u00adtion and suppose we have a dataset consis\u00adting of four diffe\u00adrent short time series:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-876a744 elementor-widget elementor-widget-image\" data-id=\"876a744\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/elementor\/thumbs\/m2hycon_blog_ragged_tensors_in_text_1-q1wf14xbdoy9qqz0v5w6cht5wnctk0a6lvkq5x40ds.png\" title=\"Intro\u00adduc\u00adtion to ragged tensors\" alt=\"Introduction to ragged tensors\" loading=\"lazy\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-41d62d2 maths elementor-widget elementor-widget-text-editor\" data-id=\"41d62d2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>As you can see, the series differ in both the number and time of the measu\u00adre\u00adments. Since machine learning models typically require a fixed input size, it\u2019s a bit more compli\u00adcated to fit such data into our models.<\/p><p>There are a number of possi\u00adbi\u00adli\u00adties to handle this type of input; for example we could inter\u00adpo\u00adlate the series and take <em>virtual<\/em> measu\u00adre\u00adments at the same timestamps for each series:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-88012b7 elementor-widget elementor-widget-image\" data-id=\"88012b7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/elementor\/thumbs\/m2hycon_blog_ragged_tensors_in_text_2-q1wf14xbdoy9qqz0v5w6cht5wnctk0a6lvkq5x40ds.png\" title=\"Intro\u00adduc\u00adtion to ragged tensors\" alt=\"Introduction to ragged tensors\" loading=\"lazy\">\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-a51859e maths elementor-widget elementor-widget-text-editor\" data-id=\"a51859e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Here we take the values from timestamps 0, 2, 4, 6, 8, and 10 such that every series consists of 6 values. However, at this stage we already have to choose hyper\u00adpa\u00adra\u00adme\u00adters such as the type of inter\u00adpo\u00adla\u00adtion, how many values, etc. However, we cannot rely on the accuracy of the inter\u00adpo\u00adla\u00adtion, especi\u00adally for extra\u00adpo\u00adlated values and values within large gaps between succes\u00adsive measu\u00adre\u00adments (see the orange and green series at time 10).<\/p><p>From the technical side, when we feed the data into a Tensor\u00adFlow Keras model and do not want to use inter\u00adpo\u00adla\u00adtion techni\u00adques, a common practice is to pad the series, e.g.&nbsp;with zeros at the end. This is neces\u00adsary because Tensor\u00adFlow groups batches of data together which must have the same shape in every dimen\u00adsion. A batch of the 4 series above would have the shape (4, 6) with 4 being the number of series (=batch dimen\u00adsion) and 6 being the number of measu\u00adre\u00adments per series.<\/p><p>However, the 6 arises from artifi\u00adcial data, either inter\u00adpo\u00adlated measu\u00adre\u00adments or padding values. To overcome the uncer\u00adtainty and the overhead of both these techni\u00adques, we can use ragged tensors to work with the original data.<\/p><h3>Concept of ragged tensors<\/h3><div>&nbsp;<\/div><p>The concept of ragged tensors is surpri\u00adsingly easy after under\u00adstan\u00adding the inten\u00adtion behind them. Let\u2019s stick with our above example with 4 time series. As you can see, the minimum number of measu\u00adre\u00adments per series is 3, while the maximum is 5. With padding we would have to fill every series with zeros at the end (or sometimes at the begin\u00adning) to achieve a common length of 5.<\/p><p>In contrast, a ragged tensor consists of the conca\u00adte\u00adna\u00adtion of all values from all series together with metadata speci\u00adfying where to split the conca\u00adte\u00adna\u00adtion into the indivi\u00addual series. Let\u2019s define our dataframe <strong>df<\/strong> and then our ragged tensor <strong>rt<\/strong>:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-df5b34a elementor-widget elementor-widget-html\" data-id=\"df5b34a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<table style=\"width: auto !important; margin-left: auto; margin-right: auto; margin-bottom: 1rem;\ncolor: #212529; border: 1px solid #bbb\">\n<thead>\n<tr>\n<th style=\"text-align:right;\">\ntime\n<\/th>\n<th style=\"text-align:right;\">\nvalue\n<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n0\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n3\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n3\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n1\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n6\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n8\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n8\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n0\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n10\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n9\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n0\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n15\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n5\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n11\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n8\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n7\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n0\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n12\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n2\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n7\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n4\n<\/td>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n8\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n9\n<\/td>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n2\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right; border: 1px solid #bbb\">\n0\n<\/td>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n9\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n4\n<\/td>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n0\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n6\n<\/td>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n13\n<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n10\n<\/td>\n<td style=\"text-align:right;border: 1px solid #bbb\">\n4\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-766ba8f elementor-widget elementor-widget-html\" data-id=\"766ba8f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>row_splits = [0, 5, 8, 12, 16]\nrt = tf.RaggedTensor.from_row_splits(values=df.values, row_splits=row_splits)\nrt\n\n&lt;tf.RaggedTensor [[[0, 3], [3, 1], [6, 8], [8, 0], [10, 9]], [[0, 15], [5, 11], [8, 7]], [[0, 12], [2, 7], [4, 8], [9, 2]], [[0, 9], [4, 0], [6, 13], [10, 4]]]&gt;\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5bdf45f maths elementor-widget elementor-widget-text-editor\" data-id=\"5bdf45f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>As we can see, the <strong>row_splits<\/strong> array defines the indivi\u00addual series by speci\u00adfying their startrow (inclu\u00adsive) and endrow (exclu\u00adsive).<\/p>\n<p>That\u2019s it. This is the really simple struc\u00adture of ragged tensors. As an alter\u00adna\u00adtive to speci\u00adfying the <strong>row_splits<\/strong> we can also create the same ragged tensor with one of the follo\u00adwing methods:<\/p>\n<ul>\n<li><strong>value_rowids<\/strong>: for every row in the conca\u00adte\u00adn\u00adated series we specify an id number which indexes the indivi\u00addual series:<\/li><\/ul><ul>\n<\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c16b8d7 elementor-widget elementor-widget-html\" data-id=\"c16b8d7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>value_rowids = [0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3]\nrt_1 = tf.RaggedTensor.from_value_rowids(values=df.values, value_rowids=value_rowids)\nrt_1\n\n&lt;tf.RaggedTensor [[[0, 3], [3, 1], [6, 8], [8, 0], [10, 9]], [[0, 15], [5, 11], [8, 7]], [[0, 12], [2, 7], [4, 8], [9, 2]], [[0, 9], [4, 0], [6, 13], [10, 4]]]&gt;\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1d79225 maths elementor-widget elementor-widget-text-editor\" data-id=\"1d79225\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul><li><strong>row_lengths<\/strong>: we state the length of every indivi\u00addual series:<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ab0a1bf elementor-widget elementor-widget-html\" data-id=\"ab0a1bf\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>row_lengths = [5, 3, 4, 4]\nrt_2 = tf.RaggedTensor.from_row_lengths(values=df.values, row_lengths=row_lengths)\nrt_2\n\n&lt;tf.RaggedTensor [[[0, 3], [3, 1], [6, 8], [8, 0], [10, 9]], [[0, 15], [5, 11], [8, 7]], [[0, 12], [2, 7], [4, 8], [9, 2]], [[0, 9], [4, 0], [6, 13], [10, 4]]]&gt;\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-adfad4c maths elementor-widget elementor-widget-text-editor\" data-id=\"adfad4c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<ul><li><strong>constant<\/strong>: we can define the ragged tensor as a \u201cconstant\u201d by directly speci\u00adfying a list of arrays:<\/li><\/ul>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b3739a6 elementor-widget elementor-widget-html\" data-id=\"b3739a6\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>rt_3 = tf.ragged.constant([df.loc[0:4, :].values, df.loc[5:7, :].values, df.loc[8:11, :].values, df.loc[12:15, :].values])\nrt_3\n\n&lt;tf.RaggedTensor [[[0, 3], [3, 1], [6, 8], [8, 0], [10, 9]], [[0, 15], [5, 11], [8, 7]], [[0, 12], [2, 7], [4, 8], [9, 2]], [[0, 9], [4, 0], [6, 13], [10, 4]]]&gt;\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b090bb8 maths elementor-widget elementor-widget-text-editor\" data-id=\"b090bb8\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>Intern\u00adally, it does not matter which method we choose to create a ragged tensor, the results are all equiva\u00adlent. Next we\u2019ll see how to perform mathe\u00adma\u00adtical opera\u00adtions on ragged tensors.<\/p><h3>Working with ragged tensors<\/h3><div>&nbsp;<\/div><p>Tensor\u00adFlow provides a very handy function to perform opera\u00adtions on ragged tensors: <strong>tf.ragged.map_flat_values(op, *args, **kwargs)<\/strong>. It does what the function name says \u2013 every ragged tensor in <strong>args<\/strong> is substi\u00adtuted by its conca\u00adte\u00adn\u00adated (=flat) version, omitting the batch dimen\u00adsion. In our example, this is the same as if we operate on the <strong>df.values<\/strong> directly. The only diffe\u00adrence is that the output of the opera\u00adtion is again a ragged tensor with the same metadata infor\u00adma\u00adtion about where to split. Let\u2019s consider an example where we compute the matrix product of the ragged tensor with a matrix <strong>m<\/strong>\u001b of shape (2, 5). Each indivi\u00addual series in our ragged tensor has shape (k, 2) where k corre\u00adsponds to the number of measu\u00adre\u00adments in the given series. Taking care to first casting to floats:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-77adba2 elementor-widget elementor-widget-html\" data-id=\"77adba2\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>m = tf.random.uniform(shape=[2, 5])\nprint(m.shape)\n\n(2, 5)\n\nrt = tf.cast(rt, tf.float32)\nresult = tf.ragged.map_flat_values(tf.matmul, rt, m)\nprint(*(t.shape for t in result), sep='\\n')\n\n(5, 5)\n(3, 5)\n(4, 5)\n(4, 5)\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c525f58 maths elementor-widget elementor-widget-text-editor\" data-id=\"c525f58\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tPerfect! The resul\u00adting ragged tensor has the same row splits as the input, but the inner dimen\u00adsion changed from 2 to 5 because of the matrix multi\u00adpli\u00adca\u00adtion. We could do some more compli\u00adcated opera\u00adtions, for example if <strong>m<\/strong> is not a 2-dimen\u00adsional matrix, but a 3-dimen\u00adsional tensor:\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-c2996a3 elementor-widget elementor-widget-html\" data-id=\"c2996a3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>m = tf.random.uniform(shape=[2, 5, 4])\nprint(m.shape)\n\n(2, 5, 4)\n\nrt = tf.cast(rt, tf.float32)\nresult = tf.ragged.map_flat_values(tf.einsum, \"bi, ijk -&gt; bjk\", rt, m)\nprint(*(t.shape for t in result), sep='\\n')\n\n(5, 5, 4)\n(3, 5, 4)\n(4, 5, 4)\n(4, 5, 4)\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2ae8f09 maths elementor-widget elementor-widget-text-editor\" data-id=\"2ae8f09\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>As expected, the batch dimen\u00adsion <strong>b<\/strong> corre\u00adsponds to the length of the indivi\u00addual series, while the other dimen\u00adsions origi\u00adnate from <code>m<\/code>. By the way, <strong>tf.einsum<\/strong> refers to the Einstein summa\u00adtion conven\u00adtion, which is extre\u00admely handy if we are working with higher dimen\u00adsional tensors. Read more about it <a href=\"https:\/\/rockt.github.io\/2018\/04\/30\/einsum\"><span style=\"text-decoration: underline;\"><strong>here<\/strong><\/span><\/a>.<\/p><p>One last thing, it is also very easy to perform aggre\u00adga\u00adtions over ragged tensors. For example, if we want to know the colum\u00adnwise sum, we can use reduc\u00adtion functions for this:<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-aab4382 elementor-widget elementor-widget-html\" data-id=\"aab4382\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<pre class=\"code-box\"><code>tf.reduce_sum(rt, axis=1)\n\n&lt;tf.Tensor: shape=(4, 2), dtype=float32, numpy=\narray([[27., 21.],\n       [13., 33.],\n       [15., 29.],\n       [20., 26.]], dtype=float32)&gt;\n<\/code><\/pre>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-394dd06 maths elementor-widget elementor-widget-text-editor\" data-id=\"394dd06\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>There exists many more opera\u00adtions for ragged tensors which are listed <a href=\"https:\/\/www.tensorflow.org\/api_docs\/python\/tf\/ragged\">here<\/a>.<\/p>\n<h3 id=\"conclusion\">Conclu\u00adsion<\/h3>\n<p><\/p><p>We learned about the struc\u00adture of Tensor\u00adFlow ragged tensors and how to perform basic mathe\u00adma\u00adtical opera\u00adtions on them. They make it unneces\u00adsary to apply unnatural prepro\u00adces\u00adsing techni\u00adques like inter\u00adpo\u00adla\u00adtion or padding. This is especi\u00adally useful for irregular time series datasets, although there are many other appli\u00adca\u00adtions. Imagine a dataset with images of various sizes \u2013 ragged tensors are even able to handle multiple ragged dimen\u00adsions, perfect for that.<\/p>\n<p>In a subse\u00adquent post I will dive a bit deeper into how to work with ragged tensors as input types for a Keras model by treating the indivi\u00addual time series as sets and performing atten\u00adtion directly on the ragged tensors. Stay tuned!<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-c519333 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c519333\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-ac9195e\" data-id=\"ac9195e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b592d10 elementor-widget elementor-widget-author-box\" data-id=\"b592d10\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"author-box.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-author-box\">\n\t\t\t\t\t\t\t<div class=\"elementor-author-box__avatar\">\n\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/09\/m2hycon_ueberuns_team_Torben_Windler_800x800-300x300.jpg\" alt=\"Picture of Torben Windler\" loading=\"lazy\">\n\t\t\t\t<\/div>\n\t\t\t\n\t\t\t<div class=\"elementor-author-box__text\">\n\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t<h4 class=\"elementor-author-box__name\">\n\t\t\t\t\t\t\tTorben Windler\t\t\t\t\t\t<\/h4>\n\t\t\t\t\t<\/div>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-50 elementor-top-column elementor-element elementor-element-4ee3c0b elementor-hidden-tablet elementor-hidden-mobile\" data-id=\"4ee3c0b\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ead50ba elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ead50ba\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-94af29a\" data-id=\"94af29a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-de64447 elementor-widget elementor-widget-post-navigation\" data-id=\"de64447\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"post-navigation.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-post-navigation\" role=\"navigation\" aria-label=\"Post Navigation\">\n\t\t\t<div class=\"elementor-post-navigation__prev elementor-post-navigation__link\">\n\t\t\t\t<a href=\"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/what-is-preventive-maintenance\/\" rel=\"prev\"><span class=\"post-navigation__arrow-wrapper post-navigation__arrow-prev\"><i aria-hidden=\"true\" class=\"fas fa-angle-left\"><\/i><span class=\"elementor-screen-only\">Prev<\/span><\/span><span class=\"elementor-post-navigation__link__prev\"><span class=\"post-navigation__prev--label\">Voriger Beitrag<\/span><span class=\"post-navigation__prev--title\">What is preven\u00adtive mainten\u00adance?<\/span><\/span><\/a>\t\t\t<\/div>\n\t\t\t\t\t\t<div class=\"elementor-post-navigation__next elementor-post-navigation__link\">\n\t\t\t\t<a href=\"https:\/\/www.m2hycon.de\/en\/news\/project-management\/the-why-and-how-of-my-pmp-certification-a-personal-journey\/\" rel=\"next\"><span class=\"elementor-post-navigation__link__next\"><span class=\"post-navigation__next--label\">N\u00e4chster Beitrag<\/span><span class=\"post-navigation__next--title\">A personal journey to the how and why of my PMP certi\u00adfi\u00adca\u00adtion!<\/span><\/span><span class=\"post-navigation__arrow-wrapper post-navigation__arrow-next\"><i aria-hidden=\"true\" class=\"fas fa-angle-right\"><\/i><span class=\"elementor-screen-only\">Next<\/span><\/span><\/a>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>We review Tensorflow\u2019s concept of ragged tensors, which were intro\u00adduced at the end of 2018. We explain their basic struc\u00adture and why they are useful.<\/p>\n","protected":false},"author":11,"featured_media":4326,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wp_typography_post_enhancements_disabled":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"disabled","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"disabled","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[164],"tags":[],"class_list":["post-4314","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-expert-knowledge"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.2 (Yoast SEO v28.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Introduction to ragged tensors - m2hycon Blog<\/title>\n<meta name=\"description\" content=\"We review Tensorflow\u2019s concept of ragged tensors, which were introduced at the end of 2018. We explain their basic structure and why they are useful.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Introduction to ragged tensors - m2hycon Blog\" \/>\n<meta property=\"og:description\" content=\"Aufbauend auf dem Bayes\u2019schen Theorem hat sich die Bayes\u2019sche Statistik entwickelt, welche im Rahmen der induktiven Statistik und des maschinellen Lernens zur Sch\u00e4tzung von Parametern und zum Testen von Hypothesen verwendet wird.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/\" \/>\n<meta property=\"og:site_name\" content=\"m2hycon\" \/>\n<meta property=\"article:published_time\" content=\"2022-01-17T09:04:06+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-23T13:41:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2022\/11\/m2ycon_blog_bayessche_statistik_1920x960.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Elisa J\u00e4ger\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Introduction to ragged tensors - m2hycon Blog\" \/>\n<meta name=\"twitter:description\" content=\"Aufbauend auf dem Bayes\u2019schen Theorem hat sich die Bayes\u2019sche Statistik entwickelt, welche im Rahmen der induktiven Statistik und des maschinellen Lernens zur Sch\u00e4tzung von Parametern und zum Testen von Hypothesen verwendet wird.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2022\/11\/m2ycon_blog_bayessche_statistik_1920x960.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elisa J\u00e4ger\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/\"},\"author\":{\"name\":\"Elisa J\u00e4ger\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#\\\/schema\\\/person\\\/6e8ca5ae2cf5f2ca5cce816cfc0e8052\"},\"headline\":\"Intro\u00adduc\u00adtion to ragged tensors\",\"datePublished\":\"2022-01-17T09:04:06+00:00\",\"dateModified\":\"2024-04-23T13:41:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/\"},\"wordCount\":1010,\"publisher\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.m2hycon.de\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/m2hycon_blog_ragged_tensors_1920x960.jpg\",\"articleSection\":[\"Expert knowledge\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/\",\"url\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/\",\"name\":\"Introduction to ragged tensors - m2hycon Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.m2hycon.de\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/m2hycon_blog_ragged_tensors_1920x960.jpg\",\"datePublished\":\"2022-01-17T09:04:06+00:00\",\"dateModified\":\"2024-04-23T13:41:17+00:00\",\"description\":\"We review Tensorflow\u2019s concept of ragged tensors, which were introduced at the end of 2018. We explain their basic structure and why they are useful.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.m2hycon.de\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/m2hycon_blog_ragged_tensors_1920x960.jpg\",\"contentUrl\":\"https:\\\/\\\/www.m2hycon.de\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/m2hycon_blog_ragged_tensors_1920x960.jpg\",\"width\":1920,\"height\":960,\"caption\":\"Introduction to ragged tensors\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/news\\\/expert-knowledge\\\/introduction-to-ragged-tensors\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Startseite\",\"item\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/start\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Intro\u00adduc\u00adtion to ragged tensors\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#website\",\"url\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/\",\"name\":\"m2hycon\",\"description\":\"let&#039;s data science\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#organization\",\"name\":\"m2hycon GmbH\",\"url\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.m2hycon.de\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/m2hycon_logo_claim_rgb_web_2022-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.m2hycon.de\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/m2hycon_logo_claim_rgb_web_2022-scaled.jpg\",\"width\":2560,\"height\":1072,\"caption\":\"m2hycon GmbH\"},\"image\":{\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/company\\\/m2hycon\",\"https:\\\/\\\/www.xing.com\\\/pages\\\/m2hycongmbh\"],\"description\":\"Mehr Effizienz durch Daten und intelligente Algorithmen! Es ist nicht die Kunst einen Algorithmus zu entwickeln, sondern den richtigen Algorithmus f\u00fcr das richtige Umfeld, die richtige Organisation, zur richtigen Zeit und in der richtigen Komplexit\u00e4t. Daran arbeiten wir in unseren Services.\",\"email\":\"hamburg@m2hycon.de\",\"telephone\":\"+49 (0)40 \u2013 369 397 93\",\"legalName\":\"M2Hycon GmbH\",\"foundingDate\":\"2018-01-01\",\"vatID\":\"DE 320863131\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.m2hycon.de\\\/en\\\/#\\\/schema\\\/person\\\/6e8ca5ae2cf5f2ca5cce816cfc0e8052\",\"name\":\"Elisa J\u00e4ger\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/244382485c18029112d70bd4170578540aa467f464bda8a85130903031277fd8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/244382485c18029112d70bd4170578540aa467f464bda8a85130903031277fd8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/244382485c18029112d70bd4170578540aa467f464bda8a85130903031277fd8?s=96&d=mm&r=g\",\"caption\":\"Elisa J\u00e4ger\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Introduction to ragged tensors - m2hycon Blog","description":"We review Tensorflow\u2019s concept of ragged tensors, which were introduced at the end of 2018. We explain their basic structure and why they are useful.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/","og_locale":"en_US","og_type":"article","og_title":"Introduction to ragged tensors - m2hycon Blog","og_description":"Aufbauend auf dem Bayes\u2019schen Theorem hat sich die Bayes\u2019sche Statistik entwickelt, welche im Rahmen der induktiven Statistik und des maschinellen Lernens zur Sch\u00e4tzung von Parametern und zum Testen von Hypothesen verwendet wird.","og_url":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/","og_site_name":"m2hycon","article_published_time":"2022-01-17T09:04:06+00:00","article_modified_time":"2024-04-23T13:41:17+00:00","og_image":[{"width":1920,"height":960,"url":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2022\/11\/m2ycon_blog_bayessche_statistik_1920x960.jpg","type":"image\/jpeg"}],"author":"Elisa J\u00e4ger","twitter_card":"summary_large_image","twitter_title":"Introduction to ragged tensors - m2hycon Blog","twitter_description":"Aufbauend auf dem Bayes\u2019schen Theorem hat sich die Bayes\u2019sche Statistik entwickelt, welche im Rahmen der induktiven Statistik und des maschinellen Lernens zur Sch\u00e4tzung von Parametern und zum Testen von Hypothesen verwendet wird.","twitter_image":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2022\/11\/m2ycon_blog_bayessche_statistik_1920x960.jpg","twitter_misc":{"Written by":"Elisa J\u00e4ger","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#article","isPartOf":{"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/"},"author":{"name":"Elisa J\u00e4ger","@id":"https:\/\/www.m2hycon.de\/en\/#\/schema\/person\/6e8ca5ae2cf5f2ca5cce816cfc0e8052"},"headline":"Intro\u00adduc\u00adtion to ragged tensors","datePublished":"2022-01-17T09:04:06+00:00","dateModified":"2024-04-23T13:41:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/"},"wordCount":1010,"publisher":{"@id":"https:\/\/www.m2hycon.de\/en\/#organization"},"image":{"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#primaryimage"},"thumbnailUrl":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960.jpg","articleSection":["Expert knowledge"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/","url":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/","name":"Introduction to ragged tensors - m2hycon Blog","isPartOf":{"@id":"https:\/\/www.m2hycon.de\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#primaryimage"},"image":{"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#primaryimage"},"thumbnailUrl":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960.jpg","datePublished":"2022-01-17T09:04:06+00:00","dateModified":"2024-04-23T13:41:17+00:00","description":"We review Tensorflow\u2019s concept of ragged tensors, which were introduced at the end of 2018. We explain their basic structure and why they are useful.","breadcrumb":{"@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#primaryimage","url":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960.jpg","contentUrl":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2023\/02\/m2hycon_blog_ragged_tensors_1920x960.jpg","width":1920,"height":960,"caption":"Introduction to ragged tensors"},{"@type":"BreadcrumbList","@id":"https:\/\/www.m2hycon.de\/en\/news\/expert-knowledge\/introduction-to-ragged-tensors\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Startseite","item":"https:\/\/www.m2hycon.de\/en\/start\/"},{"@type":"ListItem","position":2,"name":"Intro\u00adduc\u00adtion to ragged tensors"}]},{"@type":"WebSite","@id":"https:\/\/www.m2hycon.de\/en\/#website","url":"https:\/\/www.m2hycon.de\/en\/","name":"m2hycon","description":"let&#039;s data science","publisher":{"@id":"https:\/\/www.m2hycon.de\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.m2hycon.de\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.m2hycon.de\/en\/#organization","name":"m2hycon GmbH","url":"https:\/\/www.m2hycon.de\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.m2hycon.de\/en\/#\/schema\/logo\/image\/","url":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2022\/10\/m2hycon_logo_claim_rgb_web_2022-scaled.jpg","contentUrl":"https:\/\/www.m2hycon.de\/wp-content\/uploads\/2022\/10\/m2hycon_logo_claim_rgb_web_2022-scaled.jpg","width":2560,"height":1072,"caption":"m2hycon GmbH"},"image":{"@id":"https:\/\/www.m2hycon.de\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/company\/m2hycon","https:\/\/www.xing.com\/pages\/m2hycongmbh"],"description":"Mehr Effizienz durch Daten und intelligente Algorithmen! Es ist nicht die Kunst einen Algorithmus zu entwickeln, sondern den richtigen Algorithmus f\u00fcr das richtige Umfeld, die richtige Organisation, zur richtigen Zeit und in der richtigen Komplexit\u00e4t. Daran arbeiten wir in unseren Services.","email":"hamburg@m2hycon.de","telephone":"+49 (0)40 \u2013 369 397 93","legalName":"M2Hycon GmbH","foundingDate":"2018-01-01","vatID":"DE 320863131","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.m2hycon.de\/en\/#\/schema\/person\/6e8ca5ae2cf5f2ca5cce816cfc0e8052","name":"Elisa J\u00e4ger","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/244382485c18029112d70bd4170578540aa467f464bda8a85130903031277fd8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/244382485c18029112d70bd4170578540aa467f464bda8a85130903031277fd8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/244382485c18029112d70bd4170578540aa467f464bda8a85130903031277fd8?s=96&d=mm&r=g","caption":"Elisa J\u00e4ger"}}]}},"_links":{"self":[{"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/posts\/4314","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/comments?post=4314"}],"version-history":[{"count":0,"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/posts\/4314\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/media\/4326"}],"wp:attachment":[{"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/media?parent=4314"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/categories?post=4314"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.m2hycon.de\/en\/wp-json\/wp\/v2\/tags?post=4314"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}