CINXE.COM

Presentamos KerasHub: la tienda de modelos preentrenados - Google Developers Blog

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title> Presentamos KerasHub: la tienda de modelos preentrenados - Google Developers Blog </title> <meta property="og:title" content="Presentamos KerasHub: la tienda de modelos preentrenados- Google Developers Blog" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="description" content="KerasHub is a new unified library for pretrained models fostering a more cohesive ecosystem for developers." /> <meta content="summary_large_image" name="twitter:card"/> <meta content="Google for Developers Blog - News about Web, Mobile, AI and Cloud" property="twitter:title"/> <meta property="og:title" content="Presentamos KerasHub: la tienda de modelos preentrenados" /> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{ "@type": "ListItem", "position": 1, "name": "Google for Developers Blog", "item": "https://developers.googleblog.com/" },{ "@type": "ListItem", "position": 2, "name": "Presentamos KerasHub: la tienda de modelos preentrenados", "item": "http://developers.googleblog.com/es/introducing-keras-hub-for-pretrained-models/" }] } </script> <script type="application/ld+json"> { "@context": "https://schema.org", "@type": "Article", "headline": "Presentamos KerasHub: la tienda de modelos preentrenados", "description": "KerasHub es una nueva biblioteca unificada para modelos preentrenados que fomenta un ecosistema más cohesivo para los desarrolladores.", "image": "https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Keras-GfD.2e16d0ba.fill-800x400.png", "datePublished": "2024-10-22", "author": [ { "@type": "Person", "name": "Divyashree Sreepathihalli", "url": "/es/search/?author=Divyashree+Sreepathihalli" }, { "@type": "Person", "name": "Luciano Martins", "url": "/es/search/?author=Luciano+Martins" } ] } </script> <meta content="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Keras-GfD.2e16d0ba.fill-1200x600.png" property="og:image"/> <!-- Google Tag Manager --> <script type="text/javascript" src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/js/analytics.js"></script> <!-- End Google Tag Manager --> <link href="//www.gstatic.com/glue/v27_1/glue.min.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/css/dgc_blog.css"> <link rel="icon" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/favicon.ico" type="image/x-icon"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preload" href="https://fonts.googleapis.com/css2?family=Product+Sans&family=Google+Sans+Display:ital@0;1&family=Google+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&family=Google+Sans+Text:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap" as="style"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Product+Sans&family=Google+Sans+Display:ital@0;1&family=Google+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&family=Google+Sans+Text:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap"> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400&display=swap"> <link href="https://www.gstatic.com/glue/cookienotificationbar/cookienotificationbar.min.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/css/blog_detail.css" /> <link rel="stylesheet" href="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/pygmentify/css/default.min.css"> </head> <body id="main-content" class="glue-body "> <!-- Google Tag Manager (noscript) --> <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WVTLDSL " height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <!-- End Google Tag Manager (noscript) --> <!-- HTML --> <header class="dgc-header"> <div class="dgc-header-inner"> <button class="hamburger" aria-haspopup="true" aria-expanded="false" aria-label="Abrir menú"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#menu"></use> </svg> </button> <div class="product-name-wrapper"> <a href="https://developers.google.com/" class="site-logo-link" data-label="Site logo"> <img src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/g-dev.svg" class="site-logo" alt="Google for Developers"> </a> </div> <div class="desktop-nav-wrapper"> <div class="upper-tabs-wrapper"> <div class="upper-tabs"> <nav class="tabs" aria-label="Pestañas superiores"> <div class="tab" dropdown> <a href="//developers.google.com/products" class="top-nav-title"> Productos </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="true" aria-label="Menú desplegable de Productos" class="dropdown-toggle"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </a> <div class="tabs-dropdown" aria-label="Submenú"> <div class="tabs-dropdown-content"> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="Menú Desarrolla">Desarrolla</li> <li class="nav-item"> <a href="//developer.android.com"> <div class="nav-item-title"> Android </div> </a> </li> <li class="nav-item"> <a href="//developer.chrome.com"> <div class="nav-item-title"> Chrome </div> </a> </li> <li class="nav-item"> <a href="//chromeos.dev/"> <div class="nav-item-title"> ChromeOS </div> </a> </li> <li class="nav-item"> <a href="//cloud.google.com"> <div class="nav-item-title"> Cloud </div> </a> </li> <li class="nav-item"> <a href="//firebase.google.com"> <div class="nav-item-title"> Firebase </div> </a> </li> <li class="nav-item"> <a href="//flutter.dev"> <div class="nav-item-title"> Flutter </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/assistant"> <div class="nav-item-title"> Google Assistant </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/maps"> <div class="nav-item-title"> Google Maps Platform </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/workspace"> <div class="nav-item-title"> Google Workspace </div> </a> </li> <li class="nav-item"> <a href="//www.tensorflow.org"> <div class="nav-item-title"> TensorFlow </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/youtube"> <div class="nav-item-title"> YouTube </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="Menú Crece">Crece</li> <li class="nav-item"> <a href="//firebase.google.com"> <div class="nav-item-title"> Firebase </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads"> <div class="nav-item-title"> Google Ads </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/analytics"> <div class="nav-item-title"> Google Analytics </div> </a> </li> <li class="nav-item"> <a href="//developer.android.com/distribute"> <div class="nav-item-title"> Google Play </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/search"> <div class="nav-item-title"> Search </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/web/fundamentals/engage-and-retain/push-notifications"> <div class="nav-item-title"> Web Push and Notification APIs </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="Menú Gana">Gana</li> <li class="nav-item"> <a href="//developers.google.com/admob"> <div class="nav-item-title"> AdMob </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads/api"> <div class="nav-item-title"> Google Ads API </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/pay"> <div class="nav-item-title"> Google Pay </div> </a> </li> <li class="nav-item"> <a href="//developer.android.com/google/play/billing/"> <div class="nav-item-title"> Google Play Billing </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/interactive-media-ads"> <div class="nav-item-title"> Interactive Media Ads </div> </a> </li> </ul> </div> </div> </div> </div> <div class="tab"> <a href="//developers.google.com/solutions/catalog" class="top-nav-title"> Soluciones </a> </div> <div class="tab"> <a href="//developers.google.com/events" class="top-nav-title"> Eventos </a> </div> <div class="tab"> <a href="//developers.google.com/learn" class="top-nav-title"> Aprende </a> </div> <div class="tab" dropdown> <a href="//developers.google.com/community" class="top-nav-title"> Comunidad </a> <a href="#" role="button" aria-haspopup="true" aria-expanded="true" aria-label="Menú desplegable de Comunidad" class="dropdown-toggle"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </a> <div class="tabs-dropdown" aria-label="Submenú"> <div class="tabs-dropdown-content"> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="Menú Grupos">Grupos</li> <li class="nav-item"> <a href="//developers.google.com/community/gdg"> <div class="nav-item-title"> Google Developer Groups </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc"> <div class="nav-item-title"> Google Developer Student Clubs </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/womentechmakers"> <div class="nav-item-title"> Woman Techmakers </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/experts"> <div class="nav-item-title"> Google Developer Experts </div> </a> </li> <li class="nav-item"> <a href="//www.techequitycollective.com/"> <div class="nav-item-title"> Tech Equity Collective </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="Menú Programas">Programas</li> <li class="nav-item"> <a href="//developers.google.com/community/accelerators"> <div class="nav-item-title"> Accelerator </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc-solution-challenge"> <div class="nav-item-title"> Solution Challenge </div> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/devfest"> <div class="nav-item-title"> DevFest </div> </a> </li> </ul> </div> <div class="tabs-dropdown-column"> <ul class="tabs-dropdown-section"> <li class="nav-title" aria-label="Menú Historias">Historias</li> <li class="nav-item"> <a href="//developers.google.com/community/stories"> <div class="nav-item-title"> Todas las historias </div> </a> </li> </ul> </div> </div> </div> </div> <div class="tab"> <a href="//developers.google.com/profile/u/me" class="top-nav-title"> Programa para desarrolladores </a> </div> <div class="tab"> <a href="//developers.googleblog.com/" class="top-nav-title"> Blog </a> </div> </nav> </div> </div> </div> </div> <div class="dgc-header-search"> <div class="search-wrapper glue-page"> <div class="glue-grid"> <form id="search-form" action="/es/search/" method="get" class="search-content glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-9-md glue-grid__col--span-7-lg"> <div class="search-input-wrapper"> <svg role="presentation" aria-hidden="true" class="glue-icon search-icon"> <use href="/glue-icon/#search"></use> </svg> <input type="text" name="query" placeholder="Buscar todos los artículos..." aria-label="Buscar" class="search-input-field" /> </div> <button class="glue-button glue-button--high-emphasis"> Buscar </button> </form> <div class="language-selector glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-3-md glue-grid__col--span-5-lg" aria-label="Selecciona tu preferencia de idioma"> <button type="button" aria-controls="lang-menu-header" aria-haspopup="true"> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#language"></use> </svg> <span class="lang-label">Español (Latam)</span> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </button> <div id="lang-menu-header" class="lang-menu hidden" role="menu"> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en" href="/en/introducing-keras-hub-for-pretrained-models/">English</a> </li> <li role="presentation"> <a role="menuitem" lang="es" aria-current="true" href="/es/introducing-keras-hub-for-pretrained-models/">Español (Latam)</a> </li> <li role="presentation"> <a role="menuitem" lang="id" href="/id/introducing-keras-hub-for-pretrained-models/">Bahasa Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="ja" href="/ja/introducing-keras-hub-for-pretrained-models/">日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko" href="/ko/introducing-keras-hub-for-pretrained-models/">한국어</a> </li> <li role="presentation"> <a role="menuitem" lang="pt-br" href="/pt-br/introducing-keras-hub-for-pretrained-models/">Português (Brasil)</a> </li> <li role="presentation"> <a role="menuitem" lang="zh-hans" href="/zh-hans/introducing-keras-hub-for-pretrained-models/">简体中文</a> </li> </ul> </div> </div> </div> </div> </div> </header> <div class="mobile-drawer" top-level-nav> <nav class="nav-content" aria-label="Menú lateral"> <div class="mobile-header"> <button class="nav-close-btn nav-btn" aria-label="Cerrar navegación"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#close"></use> </svg> </button> <button class="nav-back-btn nav-btn hidden" aria-label="Regresar al menú"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-back"></use> </svg> </button> <div class="product-name-wrapper"> <a href="https://developers.google.com/" class="site-logo-link" data-label="Site logo"> <img src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/g-dev.svg" class="site-logo" alt="Google for Developers"> </a> </div> </div> <div class="nav-wrapper"> <div class="mobile-nav-top"> <ul class="nav-list"> <li class="nav-item"> <a href="//developers.google.com/products" class="nav-title" data-label="Tab: Products"> <span class="nav-text" tooltip=""> Productos </span> </a> <ul class="nav-responsive-tabs"> <li class="nav-item"> <span tabindex="0" class="nav-title products-btn" data-label="More Products"> <span class="nav-text" menu="Products"> Más </span> <span class="nav-icon" menu="Products"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-forward"></use> </svg> </span> </span> </li> </ul> </li> <li class="nav-item"> <a href="//developers.google.com/solutions/catalog" class="nav-title" data-label="Tab: Solutions"> <span class="nav-text" tooltip=""> Soluciones </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/events" class="nav-title" data-label="Tab: Events"> <span class="nav-text" tooltip=""> Eventos </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/learn" class="nav-title" data-label="Tab: Learn"> <span class="nav-text" tooltip=""> Aprende </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community" class="nav-title" data-label="Tab: Community"> <span class="nav-text" tooltip=""> Comunidad </span> </a> <ul class="nav-responsive-tabs"> <li class="nav-item"> <span tabindex="0" class="nav-title community-btn" data-label="More Community"> <span class="nav-text" menu="Community"> Más </span> <span class="nav-icon" menu="Community"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#arrow-forward"></use> </svg> </span> </span> </li> </ul> </li> <li class="nav-item"> <a href="//developers.google.com/profile/u/me" class="nav-title" data-label="Tab: Developer Program"> <span class="nav-text" tooltip=""> Programa para desarrolladores </span> </a> </li> <li class="nav-item"> <a href="//developers.googleblog.com/" class="nav-title" data-label="Tab: Blog"> <span class="nav-text" tooltip=""> Blog </span> </a> </li> </ul> </div> <div class="mobile-nav-bottom"> <ul class="nav-list products-submenu" menu="Products" aria-label="Menú lateral"> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> Desarrolla </span> </span> </li> <li class="nav-item"> <a href="//developer.android.com" class="nav-title"> <span class="nav-text"> Android </span> </a> </li> <li class="nav-item"> <a href="//developer.chrome.com" class="nav-title"> <span class="nav-text"> Chrome </span> </a> </li> <li class="nav-item"> <a href="//chromeos.dev/" class="nav-title"> <span class="nav-text"> ChromeOS </span> </a> </li> <li class="nav-item"> <a href="//cloud.google.com" class="nav-title"> <span class="nav-text"> Cloud </span> </a> </li> <li class="nav-item"> <a href="//firebase.google.com" class="nav-title"> <span class="nav-text"> Firebase </span> </a> </li> <li class="nav-item"> <a href="//flutter.dev" class="nav-title"> <span class="nav-text"> Flutter </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/assistant" class="nav-title"> <span class="nav-text"> Google Assistant </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/maps" class="nav-title"> <span class="nav-text"> Google Maps Platform </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/workspace" class="nav-title"> <span class="nav-text"> Google Workspace </span> </a> </li> <li class="nav-item"> <a href="//www.tensorflow.org" class="nav-title"> <span class="nav-text"> TensorFlow </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/youtube" class="nav-title"> <span class="nav-text"> YouTube </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> Crece </span> </span> </li> <li class="nav-item"> <a href="//firebase.google.com" class="nav-title"> <span class="nav-text"> Firebase </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads" class="nav-title"> <span class="nav-text"> Google Ads </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/analytics" class="nav-title"> <span class="nav-text"> Google Analytics </span> </a> </li> <li class="nav-item"> <a href="//developer.android.com/distribute" class="nav-title"> <span class="nav-text"> Google Play </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/search" class="nav-title"> <span class="nav-text"> Search </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/web/fundamentals/engage-and-retain/push-notifications" class="nav-title"> <span class="nav-text"> Web Push and Notification APIs </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> Gana </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/admob" class="nav-title"> <span class="nav-text"> AdMob </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/google-ads/api" class="nav-title"> <span class="nav-text"> Google Ads API </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/pay" class="nav-title"> <span class="nav-text"> Google Pay </span> </a> </li> <li class="nav-item"> <a href="//developer.android.com/google/play/billing/" class="nav-title"> <span class="nav-text"> Google Play Billing </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/interactive-media-ads" class="nav-title"> <span class="nav-text"> Interactive Media Ads </span> </a> </li> </ul> <ul class="nav-list community-submenu hidden" menu="Community" aria-label="Menú lateral"> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> Grupos </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdg" class="nav-title"> <span class="nav-text"> Google Developer Groups </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc" class="nav-title"> <span class="nav-text"> Google Developer Student Clubs </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/womentechmakers" class="nav-title"> <span class="nav-text"> Woman Techmakers </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/experts" class="nav-title"> <span class="nav-text"> Google Developer Experts </span> </a> </li> <li class="nav-item"> <a href="//www.techequitycollective.com/" class="nav-title"> <span class="nav-text"> Tech Equity Collective </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> Programas </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/community/accelerators" class="nav-title"> <span class="nav-text"> Accelerator </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/gdsc-solution-challenge" class="nav-title"> <span class="nav-text"> Solution Challenge </span> </a> </li> <li class="nav-item"> <a href="//developers.google.com/community/devfest" class="nav-title"> <span class="nav-text"> DevFest </span> </a> </li> <li class="nav-item nav-heading"> <span class="nav-title"> <span class="nav-text"> Historias </span> </span> </li> <li class="nav-item"> <a href="//developers.google.com/community/stories" class="nav-title" aria-label="All Stories"> <span class="nav-text"> Todas las historias </span> </a> </li> </ul> </div> </div> </nav> <select aria-label="Cambiar idioma" name="lang-selector" id="lang-selector-nav" class="glue-form__dropdown glue-mobile-nav__lang-dropdown" onchange="window.location.href=this.value" > <option value="/en/introducing-keras-hub-for-pretrained-models/" lang="en" > English </option> <option value="/es/introducing-keras-hub-for-pretrained-models/" lang="es" selected > Español (Latam) </option> <option value="/id/introducing-keras-hub-for-pretrained-models/" lang="id" > Bahasa Indonesia </option> <option value="/ja/introducing-keras-hub-for-pretrained-models/" lang="ja" > 日本語 </option> <option value="/ko/introducing-keras-hub-for-pretrained-models/" lang="ko" > 한국어 </option> <option value="/pt-br/introducing-keras-hub-for-pretrained-models/" lang="pt-br" > Português (Brasil) </option> <option value="/zh-hans/introducing-keras-hub-for-pretrained-models/" lang="zh-hans" > 简体中文 </option> </select> </div> <div class="backdrop"></div> <div class="blog-detail-container"> <section class="tags-container glue-page glue-spacer-5-top"> <div class="glue-eyebrow"><a href="/es/search/?product_categories=Gemma">Gemma</a></div> </section> <section class="heading-container glue-page glue-spacer-1-top"> <h1 class="glue-headline glue-headline--headline-1">Presentamos KerasHub: la tienda de modelos preentrenados</h1> </section> <section class="summary-container glue-page glue-spacer-4-top"> <div class="date-time"> <div class="published-date glue-font-weight-medium">OCT 22, 2024</div> </div> </section> <section class="glue-page glue-grid glue-spacer-1-top"> <section class="author-container glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-10-md"> <div class="author-obj"> <a class="glue-font-weight-medium" href="/es/search/?author=Divyashree+Sreepathihalli">Divyashree Sreepathihalli</a> <span class="glue-font-weight-medium role">Software Engineer</span> </div> <div class="author-obj"> <a class="glue-font-weight-medium" href="/es/search/?author=Luciano+Martins">Luciano Martins</a> <span class="glue-font-weight-medium role">Developer Advocate</span> <span class="glue-font-weight-medium team">Google AI</span> </div> </section> <section class="social-container glue-grid__col glue-grid__col--span-4-sm glue-grid__col--span-2-md"> <button id="social-button" class="glue-button glue-button--low-emphasis glue-button--icon" aria-haspopup="true" aria-expanded="false"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#share"></use> </svg> <span>Compartir</span> </button> <ul id="social-menu" class="glue-elevation-level-1" role="menu" aria-labelledby="social-button"> <li> <a href="https://www.facebook.com/sharer/sharer.php?u={url}" title="Share on Facebook" target="_blank" rel="noopener"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#post-facebook"></use> </svg> <span>Facebook</span> </a> </li> <li> <a href="https://twitter.com/intent/tweet?text={url}" title="Share on Twitter" target="_blank" rel="noopener"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#twitter-x"></use> </svg> <span>Twitter</span> </a> </li> <li> <a href="https://www.linkedin.com/shareArticle?url={url}&amp;mini=true" title="Share on LinkedIn" target="_blank" rel="noopener"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#post-linkedin"></use> </svg> <span>LinkedIn</span> </a> </li> <li> <a href="mailto:name@example.com?subject=Check%20out%20this%20site&body=Check%20out%20{url}" title="Send via Email"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#email"></use> </svg> <span>Mail</span> </a> </li> <li> <a href="#" title="Get shareable link" data-link="" data-copy-text="Copiar vínculo" data-copied-text="¡Copiado!"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--social glue-icon--32px"> <use href="/glue-icon/#link"></use> </svg> <span></span> </a> </li> </ul> </section> </section> <section class="blocks-container glue-page glue-spacer-3-top"> <div class="block"> <img class="banner-image" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Keras-GfD-Banner.original.png" alt="Keras on Google for Developers - banner" /> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">El mundo del aprendizaje profundo está evolucionando con rapidez, y los modelos preentrenados son cada vez más importantes para realizar una amplia variedad de tareas. Keras, conocida por su API fácil de usar y su enfoque en la accesibilidad, siempre estuvo al frente de este movimiento ofreciendo bibliotecas especializadas, como KerasNLP para modelos basados en texto y KerasCV para modelos de visión artificial.</p><p data-block-key="as7cn">Sin embargo, a medida que los modelos desdibujan cada vez más las diferencias entre modalidades (piensa en los potentes LLM de chat con entrada de imágenes o las tareas de visión que aprovechan los codificadores de texto), mantener estos dominios separados es menos práctico. La división entre PLN y CV puede dificultar el desarrollo y la implementación de modelos verdaderamente multimodales, lo que lleva a esfuerzos redundantes y una experiencia de usuario fragmentada.</p> </div> <div class="inner-block-content"> <div class="image-wrapper"> <img class="regular-image" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/image3_ljbDif4.original.png" alt="keras-team/keras-hub, a unified, comprehensive library for pretrained models" /> </div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">Para resolver este problema, nos complace anunciar una importante evolución en el ecosistema de Keras: <a href="https://keras.io/keras_hub/">KerasHub</a>, una biblioteca unificada y completa para modelos preentrenados, que agiliza el acceso a arquitecturas de PLN y CV de vanguardia. KerasHub es un repositorio central donde puedes explorar y utilizar sin problemas modelos de vanguardia como BERT para el análisis de texto junto con EfficientNet para la clasificación de imágenes, todo dentro de un marco de Keras consistente y familiar.</p><h3 data-block-key="620os"><br/><b>Una experiencia unificada para desarrolladores</b></h3><p data-block-key="fklj1">Esta unificación no solo simplifica el descubrimiento y el uso de modelos, sino que también fomenta un ecosistema más cohesivo. Con KerasHub, puedes aprovechar funciones avanzadas, como la publicación y el intercambio de modelos simplificados, el ajuste de LoRA para una adaptación eficiente de recursos, la cuantificación para un rendimiento optimizado y una sólida capacitación de múltiples hosts para abordar conjuntos de datos a gran escala, todo aplicable en diversas modalidades. Esto marca un paso significativo hacia la democratización del acceso a potentes herramientas de IA y la aceleración del desarrollo de aplicaciones multimodales innovadoras.</p><h3 data-block-key="6vq37"><br/><b>Cinco pasos con KerasHub</b></h3><p data-block-key="8n85p">Para empezar, instala KerasHub en tu sistema. A partir de ahí, puedes explorar la extensa colección de <a href="https://keras.io/api/keras_hub/models/">modelos ya disponibles</a> y diferentes implementaciones de arquitecturas populares. Luego, podrás cargar e incorporar fácilmente estos modelos preentrenados en tus propios proyectos y ajustarlos para un rendimiento óptimo en función de tus requisitos específicos.</p><h3 data-block-key="4cu9q"><br/><b>Cómo instalar KerasHub</b></h3><p data-block-key="8btr5">Para instalar la versión más reciente de KerasHub con Keras 3, ejecuta lo siguiente:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="shell"><span></span>$<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>--upgrade<span class="w"> </span>keras-hub </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">A continuación, podrás empezar a explorar los modelos disponibles. El entorno de configuración estándar para comenzar a trabajar con Keras 3 no cambia con KerasHub:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">os</span> <span class="c1"># Define el backend de Keras 3 que quieres usar - &quot;jax&quot;, &quot;tensorflow&quot; o &quot;torch&quot;</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;KERAS_BACKEND&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;jax&quot;</span> <span class="c1"># Importa los módulos de Keras 3 y KerasHub</span> <span class="kn">import</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="nn">keras_hub</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h2 data-block-key="u50tg">Cómo usar modelos de visión artificial y lenguaje natural con KerasHub</h2><p data-block-key="728q8">Ahora ya puedes comenzar a usar KerasHub para acceder a los modelos disponibles en el ecosistema de Keras 3 y utilizarlos. Estos son algunos ejemplos:</p><h3 data-block-key="6b0r3"><b><br/>Gemma</b></h3><p data-block-key="87ia"><a href="https://ai.google.dev/gemma/docs/base">Gemma</a> es una colección de modelos abiertos de vanguardia, pero accesibles, desarrollados por Google. Como aprovechan la misma investigación y tecnología que usan los modelos Gemini, los modelos base de Gemma se destacan en diversas tareas de generación de texto. Algunos ejemplos son responder preguntas, resumir información y hacer razonamientos lógicos. Además, se pueden personalizar para satisfacer necesidades específicas.</p><p data-block-key="fgnpl">En este ejemplo, usarás Keras y KerasHub para cargar e iniciar la generación de contenidos usando parámetros Gemma2-2B. Para obtener más información sobre las variantes de Gemma, consulta la <a href="https://www.kaggle.com/models/google/gemma/">tarjeta de modelo de Gemma 2</a> en Kaggle.</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="c1"># Carga el parámetro 2-2B de los modelos de Kaggle </span> <span class="n">gemma_lm</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">GemmaCausalLM</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span><span class="s2">&quot;gemma_2b_en&quot;</span><span class="p">)</span> <span class="c1"># Comienza a generar contenidos con Gemma 2-2B</span> <span class="n">gemma_lm</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span><span class="s2">&quot;Keras is a&quot;</span><span class="p">,</span> <span class="n">max_length</span><span class="o">=</span><span class="mi">32</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h3 data-block-key="u50tg"><b>PaliGemma</b></h3><p data-block-key="cj0hi"><a href="https://ai.google.dev/gemma/docs/paligemma">PaliGemma</a> es un modelo abierto y compacto que comprende tanto imágenes como texto. Como obtiene inspiración de <a href="https://arxiv.org/abs/2310.09199">PaLI-3</a> y está construido con componentes de código abierto, como el <a href="https://arxiv.org/abs/2303.15343">modelo de visión SigLIP</a> y el <a href="https://arxiv.org/abs/2403.08295">modelo de lenguaje Gemma</a>, PaliGemma puede brindar respuestas detalladas y relevantes para lograr una mejor comprensión del contenido visual, lo que posibilita funciones como la generación de subtítulos para imágenes y videos cortos, la identificación de objetos e incluso la lectura de texto dentro de imágenes.</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">os</span> <span class="c1"># Define el backend de Keras 3 que quieras usar - &quot;jax&quot;, &quot;tensorflow&quot; o &quot;torch&quot;</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;KERAS_BACKEND&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;jax&quot;</span> <span class="c1"># Importa los módulos de Keras 3 y KerasHub</span> <span class="kn">import</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="nn">keras_hub</span> <span class="kn">from</span> <span class="nn">keras.utils</span> <span class="kn">import</span> <span class="n">get_file</span><span class="p">,</span> <span class="n">load_img</span><span class="p">,</span> <span class="n">img_to_array</span> <span class="c1"># Importa PaliGemma 3B con ajuste de imágenes de 224x224</span> <span class="n">pali_gemma_lm</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">PaliGemmaCausalLM</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;pali_gemma_3b_mix_224&quot;</span> <span class="p">)</span> <span class="c1"># Descarga una imagen de prueba y prepárala para su uso con KerasHub</span> <span class="n">url</span> <span class="o">=</span> <span class="s1">&#39;https://storage.googleapis.com/keras-cv/models/paligemma/cow_beach_1.png&#39;</span> <span class="n">img_path</span> <span class="o">=</span> <span class="n">get_file</span><span class="p">(</span><span class="n">origin</span><span class="o">=</span><span class="n">url</span><span class="p">)</span> <span class="n">img</span> <span class="o">=</span> <span class="n">img_to_array</span><span class="p">(</span><span class="n">load_img</span><span class="p">(</span><span class="n">image_path</span><span class="p">))</span> <span class="c1"># Crea la instrucción con la pregunta sobre la imagen</span> <span class="n">prompt</span> <span class="o">=</span> <span class="s1">&#39;answer where is the cow standing?&#39;</span> <span class="c1"># Genera los contenidos con PaliGemma</span> <span class="n">output</span> <span class="o">=</span> <span class="n">pali_gemma_lm</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span> <span class="n">inputs</span><span class="o">=</span><span class="p">{</span> <span class="s2">&quot;images&quot;</span><span class="p">:</span> <span class="n">img</span><span class="p">,</span> <span class="s2">&quot;prompts&quot;</span><span class="p">:</span> <span class="n">prompt</span><span class="p">,</span> <span class="p">}</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">Para obtener más detalles sobre los modelos preentrenados disponibles en Keras 3, consulta la <a href="https://www.kaggle.com/organizations/keras/models">lista de modelos en Keras</a> en Kaggle.</p><h3 data-block-key="fcv95"><br/><b>Stable Diffusion 3 de stability.ai</b></h3><p data-block-key="56ia0">También tienes a disposición modelos de visión artificial. Por ejemplo, puedes usar <a href="https://stability.ai/news/stable-diffusion-3">Stable Diffusion 3</a> de stability.ai con KerasHub:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">from</span> <span class="nn">PIL</span> <span class="kn">import</span> <span class="n">Image</span> <span class="kn">from</span> <span class="nn">keras.utils</span> <span class="kn">import</span> <span class="n">array_to_img</span> <span class="kn">from</span> <span class="nn">keras_hub.models</span> <span class="kn">import</span> <span class="n">StableDiffusion3TextToImage</span> <span class="n">text_to_image</span> <span class="o">=</span> <span class="n">StableDiffusion3TextToImage</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;stable_diffusion_3_medium&quot;</span><span class="p">,</span> <span class="n">height</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span> <span class="n">width</span><span class="o">=</span><span class="mi">1024</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="s2">&quot;float16&quot;</span><span class="p">,</span> <span class="p">)</span> <span class="c1"># Genera imágenes con SD3</span> <span class="n">image</span> <span class="o">=</span> <span class="n">text_to_image</span><span class="o">.</span><span class="n">generate</span><span class="p">(</span> <span class="s2">&quot;photograph of an astronaut riding a horse, detailed, 8k&quot;</span><span class="p">,</span> <span class="p">)</span> <span class="c1"># Muestra la imagen generada</span> <span class="n">img</span> <span class="o">=</span> <span class="n">array_to_img</span><span class="p">(</span><span class="n">image</span><span class="p">)</span> <span class="n">img</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">Para obtener más detalles sobre los modelos de visión artificial preentrenados disponibles en Keras 3, consulta la <a href="https://keras.io/api/keras_hub/models/">lista de modelos en Keras</a>.</p><h2 data-block-key="6bgmm"><br/>¿Qué cambia para los desarrolladores de KerasNLP?</h2><p data-block-key="b4vep">La transición de KerasNLP a KerasHub es un proceso directo. Solo requiere actualizar la instrucción de importación de <code>keras_nlp</code> a <code>keras_hub</code>.</p><p data-block-key="8mod1">Ejemplo: Anteriormente, si importabas keras_nlp para usar un modelo BERT como el siguiente</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras_nlp</span> <span class="c1"># Carga un modelo de BERT </span> <span class="n">classifier</span> <span class="o">=</span> <span class="n">keras_nlp</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">BertClassifier</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;bert_base_en_uncased&quot;</span><span class="p">,</span> <span class="n">num_classes</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">Ajusta la importación y ya podrás usar KerasHub:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras_hub</span> <span class="c1"># Carga un modelo de BERT </span> <span class="n">classifier</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">BertClassifier</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;bert_base_en_uncased&quot;</span><span class="p">,</span> <span class="n">num_classes</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h2 data-block-key="u50tg">¿Qué cambia para los desarrolladores de KerasCV?</h2><p data-block-key="deqts">Si usas KerasCV actualmente, actualizar a KerasHub te brindará estos beneficios:</p><p data-block-key="4blku"></p><ul><li data-block-key="8g3j5"><b>Carga de modelos simplificada:</b> KerasHub ofrece una API consistente para cargar modelos, que puede simplificar tu código si estás trabajando tanto con KerasCV como con KerasNLP.</li></ul><p data-block-key="8nte9"></p><ul><li data-block-key="f8le9"><b>Flexibilidad de marco de trabajo:</b> Si te interesa explorar diferentes marcos de trabajo, como JAX o PyTorch, KerasHub te permite usarlos fácilmente con los modelos KerasCV y KerasNLP.</li></ul><p data-block-key="4mdot"></p><ul><li data-block-key="76h9c"><b>Repositorio centralizado:</b> Encontrar y acceder a los modelos es más fácil con el repositorio de modelos unificado de KerasHub, ya que allí se agregarán nuevas arquitecturas en el futuro.</li></ul><h3 data-block-key="e5gb4"><br/><b>¿Cómo adapto mi código a KerasHub?</b></h3><h3 data-block-key="13otm">Modelos</h3><p data-block-key="107ui">Actualmente, se están portando los modelos de KerasCV a KerasHub. Si bien la mayoría ya están disponibles, algunos todavía están en progreso. Ten en cuenta que el modelo de <a href="https://www.kaggle.com/models/keras/centerpillar">Centerpillar</a> no se transferirá. Deberías poder usar cualquier modelo de visión en KerasHub con lo siguiente:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras_hub</span> <span class="c1"># Carga un modelo usando ajustes predeterminados</span> <span class="n">Model</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.&lt;</span><span class="n">model_name</span><span class="o">&gt;.</span><span class="n">from_preset</span><span class="p">(</span><span class="s1">&#39;preset_name`)</span> <span class="c1"># o carga un modelo personalizado especificando el backbone y el preprocessor</span> <span class="n">Model</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.&lt;</span><span class="n">model_name</span><span class="o">&gt;</span><span class="p">(</span><span class="n">backbone</span><span class="o">=</span><span class="n">backbone</span><span class="p">,</span> <span class="n">preprocessor</span><span class="o">=</span><span class="n">preprocessor</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">KerasHub presenta nuevas e interesantes funciones para los desarrolladores de KerasCV, lo que ofrece una mayor flexibilidad y capacidades ampliadas. Incluye lo siguiente:</p><h3 data-block-key="fela8"><br/>Preprocesamiento integrado</h3><p data-block-key="6sjsv">Cada modelo está acompañado de un preprocesador personalizado que aborda las tareas rutinarias, como el cambio de tamaño o de escala, y mucho más, lo que optimiza el flujo de trabajo.</p><p data-block-key="ai30i">Antes de esto, el preprocesamiento de entrada se realiza manualmente antes de proporcionar las entradas al modelo.</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="c1"># Preprocesa entradas de ejemplo</span> <span class="k">def</span> <span class="nf">preprocess_inputs</span><span class="p">(</span><span class="n">image</span><span class="p">,</span> <span class="n">label</span><span class="p">):</span> <span class="c1"># Cambia el tamaño o haz más preprocesamiento en las entradas</span> <span class="k">return</span> <span class="n">preprocessed_inputs</span> <span class="n">backbone</span> <span class="o">=</span> <span class="n">keras_cv</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ResNet50V2Backbone</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span> <span class="s2">&quot;resnet50_v2_imagenet&quot;</span><span class="p">,</span> <span class="p">)</span> <span class="n">model</span> <span class="o">=</span> <span class="n">keras_cv</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ImageClassifier</span><span class="p">(</span> <span class="n">backbone</span><span class="o">=</span><span class="n">backbone</span><span class="p">,</span> <span class="n">num_classes</span><span class="o">=</span><span class="mi">4</span><span class="p">,</span> <span class="p">)</span> <span class="n">output</span> <span class="o">=</span> <span class="n">model</span><span class="p">(</span><span class="n">preprocessed_input</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">Actualmente, el preprocesamiento de los modelos de tareas está integrado dentro de los preajustes establecidos. Las entradas se someten a preprocesamiento, donde las imágenes de muestra se someten a cambios de tamaño y escala dentro del preprocesador. Este es un componente intrínseco del modelo de tareas. No obstante, está la opción de utilizar uno personalizado.</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="n">classifier</span> <span class="o">=</span> <span class="n">keras_hub</span><span class="o">.</span><span class="n">models</span><span class="o">.</span><span class="n">ImageClassifier</span><span class="o">.</span><span class="n">from_preset</span><span class="p">(</span><span class="s1">&#39;resnet_18_imagenet&#39;</span><span class="p">)</span> <span class="n">classifier</span><span class="o">.</span><span class="n">predict</span><span class="p">(</span><span class="n">inputs</span><span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h3 data-block-key="u50tg">Funciones de pérdida</h3><p data-block-key="5qhd">Al igual que las capas de aumento, las funciones de pérdida de KerasCV ahora están disponibles en Keras a través de <code>keras.losses.&lt;loss_function&gt;</code>. Por ejemplo, si actualmente usas la <a href="https://keras.io/api/keras_cv/losses/focal_loss/">función FocalLoss</a>:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras</span> <span class="kn">import</span> <span class="nn">keras_cv</span> <span class="n">keras_cv</span><span class="o">.</span><span class="n">losses</span><span class="o">.</span><span class="n">FocalLoss</span><span class="p">(</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.25</span><span class="p">,</span> <span class="n">gamma</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">from_logits</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">label_smoothing</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <p data-block-key="u50tg">Solo debes ajustar tu código de definición de función de pérdida para usar <code>keras.losses</code> en lugar de <code>keras_cv.losses</code>:</p> </div> <div class="inner-block-content code-block"> <div class="highlight"><pre class="python"><span></span><span class="kn">import</span> <span class="nn">keras</span> <span class="n">keras</span><span class="o">.</span><span class="n">losses</span><span class="o">.</span><span class="n">FocalLoss</span><span class="p">(</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">0.25</span><span class="p">,</span> <span class="n">gamma</span><span class="o">=</span><span class="mi">2</span><span class="p">,</span> <span class="n">from_logits</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">label_smoothing</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span> <span class="p">)</span> </pre></div> </div> <div class="inner-block-content rich-content"> <h2 data-block-key="u50tg"><b>Comienza a usar KerasHub</b></h2><p data-block-key="e16fi">Descubre el mundo de KerasHub hoy mismo:</p><p data-block-key="e3thf"></p><ul><li data-block-key="22sc3"><b>Para empezar, consulta la documentación:</b><a href="https://keras.io/keras_hub/"> https://keras.io/keras_hub/</a></li></ul><p data-block-key="3nqt6"></p><ul><li data-block-key="bsh6s"><b>Consulta las guías de introducción de KerasHub:</b> <a href="https://keras.io/guides/keras_hub/">https://keras.io/guides/keras_hub/</a></li></ul><p data-block-key="56fd8"></p><ul><li data-block-key="atjro"><b>Experimenta con los modelos preentrenados:</b> <a href="https://keras.io/api/keras_hub/models/">https://keras.io/api/keras_hub/models/</a></li></ul><p data-block-key="dqjhr"></p><ul><li data-block-key="6vhaq"><b>Explora el código fuente y haz contribuciones:</b><a href="https://github.com/keras-team/keras-hub/"> https://github.com/keras-team/keras-hub/</a></li></ul><p data-block-key="elc5i"></p><ul><li data-block-key="19vfn"><b>Obtén más información sobre Keras en Kaggle:</b> <a href="https://www.kaggle.com/organizations/keras">https://www.kaggle.com/organizations/keras</a></li></ul><p data-block-key="3adku"><br/>Únete a la comunidad de Keras y aprovecha los modelos de aprendizaje profundo unificados, accesibles y eficientes. El futuro de la IA es multimodal, y KerasHub es tu forma de acceder a él.</p> </div> </div> </section> <section class="navigation-container glue-page glue-spacer-6-top"> <div class="posted-in-section"> <div class="posted-in-section__heading"> <span class="glue-caption"> publicado en: </span> </div> <div class="posted-in-section__tags"> <ul> <li> <a href="/es/search/?product_categories=Gemma" class="glue-caption">Gemma</a> </li> <li> <a href="/es/search/?technology_categories=AI" class="glue-caption">AI</a> </li> <li> <a href="/es/search/?content_type_categories=Announcements" class="glue-caption">Announcements</a> </li> <li> <a href="/es/search/?content_type_categories=Best+Practices" class="glue-caption">Best Practices</a> </li> <li> <a href="/es/search/?tag=Keras" class="glue-caption">Keras</a> </li> <li> <a href="/es/search/?tag=Learn" class="glue-caption">Learn</a> </li> <li> <a href="/es/search/?tag=multimodal" class="glue-caption">multimodal</a> </li> <li> <a href="/es/search/?tag=PaliGemma" class="glue-caption">PaliGemma</a> </li> <li> <a href="/es/search/?tag=quantization" class="glue-caption">quantization</a> </li> <li> <a href="/es/search/?tag=Stable Diffusion" class="glue-caption">Stable Diffusion</a> </li> <li> <a href="/es/search/?tag=multi-host training" class="glue-caption">multi-host training</a> </li> <li> <a href="/es/search/?tag=deep learning" class="glue-caption">deep learning</a> </li> <li> <a href="/es/search/?tag=fine-tuning" class="glue-caption">fine-tuning</a> </li> <li> <a href="/es/search/?tag=LoRA" class="glue-caption">LoRA</a> </li> </ul> </div> </div> <div class="buttons-section"> <div class="buttons-section__left"> <a href="/es/evolving-the-responsible-generative-ai-toolkit-with-new-tools-for-every-llm/" class="glue-button--icon glue-elevation-level-1 " aria-label="Anterior"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#chevron-left"></use> </svg> </a> <span class="caption ">Anterior</span> </div> <div class="buttons-section__right"> <span class="caption ">Siguiente</span> <a href="/es/compare-mode-in-google-ai-studio/" class="glue-button--icon glue-elevation-level-1 " aria-label="Siguiente"> <svg role="presentation" aria-hidden="true" class="glue-icon"> <use href="/glue-icon/#chevron-right"></use> </svg> </a> </div> </div> </section> <section class="related-posts-container glue-page glue-spacer-6-top glue-spacer-3-bottom"> <span class="glue-headline glue-headline--headline-3">Publicaciones relacionadas</span> <div class="related-posts-container__carousel glue-page glue-spacer-5-top"> <div class="glue-carousel glue-carousel--cards glue-carousel-related-posts" aria-label="Publicaciones relacionadas"> <!-- Previous --> <button class="glue-carousel__button glue-carousel__button--prev" aria-label="Ir a la diapositiva anterior"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--32px"> <use href="/glue-icon/#chevron-left"></use> </svg> </button> <!-- Next --> <button class="glue-carousel__button glue-carousel__button--next" aria-label="Ir a la siguiente diapositiva"> <svg role="presentation" aria-hidden="true" class="glue-icon glue-icon--32px"> <use href="/glue-icon/#chevron-right"></use> </svg> </button> <!-- List --> <div class="glue-carousel__viewport"> <div class="glue-carousel__list"> <a class="glue-card glue-carousel__item" href="/es/introducing-the-google-developer-program-premium/"> <div aria-label="Introducing Google Developer Program premium membership" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="Introducing Google Developer Program premium membership" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Google-Developers-program-feature.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Cloud</span> <span class="glue-label">Announcements</span> <span class="glue-label">Community</span> </div> <p class="glue-headline glue-headline--headline-5">Introducing Google Developer Program premium membership</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">25 de noviembre de 2024</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/es/advancing-multilingual-ai-with-gemma-2-and-a-150k-challenge/"> <div aria-label="Hacia una comprensión global: avances de la IA multilingüe con Gemma 2 y un desafío por USD 150,000" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="Hacia una comprensión global: avances de la IA multilingüe con Gemma 2 y un desafío por USD 150,000" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Gemma_2_J_Model_-_metadata2x.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Gemma</span> <span class="glue-label">AI</span> <span class="glue-label">Announcements</span> </div> <p class="glue-headline glue-headline--headline-5">Hacia una comprensión global: avances de la IA multilingüe con Gemma 2 y un desafío por USD 150,000</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">3 de octubre de 2024</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/es/7-examples-of-geminis-multimodal-capabilities-in-action/"> <div aria-label="7 examples of Gemini’s multimodal capabilities in action" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="7 examples of Gemini’s multimodal capabilities in action" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Gemini-Vision-Feature_1.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Gemini</span> <span class="glue-label">AI</span> <span class="glue-label">Announcements</span> <span class="glue-label">Industry Trends</span> </div> <p class="glue-headline glue-headline--headline-5">7 examples of Gemini’s multimodal capabilities in action</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">25 de noviembre de 2024</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/es/join-us-at-the-women-in-ai-summit-2024/"> <div aria-label="Join us at the Women in AI Summit 2024!" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="Join us at the Women in AI Summit 2024!" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/WAI-2024-Feature.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">AI</span> <span class="glue-label">Community</span> <span class="glue-label">Events</span> </div> <p class="glue-headline glue-headline--headline-5">Join us at the Women in AI Summit 2024!</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">22 de noviembre de 2024</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> <a class="glue-card glue-carousel__item" href="/es/inference-with-gemma-using-dataflow-and-vllm/"> <div aria-label="Inferencia con Gemma con Dataflow y vLLM" class="glue-card__inner"> <picture class="glue-card__asset"> <img alt="Inferencia con Gemma con Dataflow y vLLM" src="https://storage.googleapis.com/gweb-developer-goog-blog-assets/images/Gemma-Dataflow-ML-vLLM.2e16d0ba.fill-800x400.png"> </picture> <div class="glue-card__content"> <div class="glue-card__tags glue-spacer-2-top"> <span class="glue-label">Gemma</span> <span class="glue-label">AI</span> <span class="glue-label">Cloud</span> <span class="glue-label">How-To Guides</span> <span class="glue-label">Problem-Solving</span> </div> <p class="glue-headline glue-headline--headline-5">Inferencia con Gemma con Dataflow y vLLM</p> <div class="glue-card__cta-custom glue-spacer-3-top"> <span class="glue-cta">13 de noviembre de 2024</span> <svg aria-hidden="true" class="glue-icon glue-icon--24px" role="presentation"> <use href="/glue-icon/#arrow-forward"></use> </svg> </div> </div> </div> </a> </div> </div> <!-- Navigation dots --> <div class="glue-carousel__navigation" aria-label="Choose a page" data-glue-carousel-navigation-label="Selected tab $glue_carousel_page_number$ of $glue_carousel_page_total$"> </div> </div> </div> </section> </div> <div class="footer-linkboxes__wrapper"> <nav class="footer-linkboxes" aria-label="Vínculos de pie de página"> <ul class="footer-linkboxes__list"> <li class="footer-linkbox"> <span class="footer-linkbox-heading"> Conectar </span> <ul class="footer-linkbox-list"> <li class="footer-linkbox-list__item"> <a href="//googledevelopers.blogspot.com" class="footer-linkbox-list__link"> Blog </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/googlefordevs" class="footer-linkbox-list__link"> Instagram </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/gdevs-li" class="footer-linkbox-list__link"> LinkedIn </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/gdevs-tw" class="footer-linkbox-list__link"> Twitter </a> </li> <li class="footer-linkbox-list__item"> <a href="https://goo.gle/developers" class="footer-linkbox-list__link"> YouTube </a> </li> </ul> </li> <li class="footer-linkbox"> <span class="footer-linkbox-heading"> Programas </span> <ul class="footer-linkbox-list"> <li class="footer-linkbox-list__item"> <a href="//www.womentechmakers.com" class="footer-linkbox-list__link"> Women Techmakers </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/gdg" class="footer-linkbox-list__link"> Google Developer Groups </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/experts" class="footer-linkbox-list__link"> Google Developer Experts </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/accelerators" class="footer-linkbox-list__link"> Accelerators </a> </li> <li class="footer-linkbox-list__item"> <a href="//developers.google.com/community/gdsc" class="footer-linkbox-list__link"> Google Developer Student Clubs </a> </li> </ul> </li> <li class="footer-linkbox"> <span class="footer-linkbox-heading"> Consolas de desarrollador </span> <ul class="footer-linkbox-list"> <li class="footer-linkbox-list__item"> <a href="//console.developers.google.com" class="footer-linkbox-list__link"> Google API Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//console.cloud.google.com" class="footer-linkbox-list__link"> Google Cloud Platform Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//play.google.com/apps/publish" class="footer-linkbox-list__link"> Google Play Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//console.firebase.google.com" class="footer-linkbox-list__link"> Firebase Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//console.actions.google.com" class="footer-linkbox-list__link"> Actions on Google Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//cast.google.com/publish" class="footer-linkbox-list__link"> Cast SDK Developer Console </a> </li> <li class="footer-linkbox-list__item"> <a href="//chrome.google.com/webstore/developer/dashboard" class="footer-linkbox-list__link"> Chrome Web Store Dashboard </a> </li> </ul> </li> </ul> </nav> </div> <div class="footer-utility__wrapper"> <div> <nav class="footer-sites" aria-label="Otros sitios web de Google Developers"> <a href="https://developers.google.com/" class="site-logo-link" data-label="Site logo"> <img src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/images/g-dev.svg" class="site-logo" alt="Google for Developers"> </a> <ul class="footer-sites-list"> <li class="footer-sites-item"> <a href="//developer.android.com" class="footer-sites-link"> Android </a> </li> <li class="footer-sites-item"> <a href="//developer.chrome.com/home" class="footer-sites-link"> Chrome </a> </li> <li class="footer-sites-item"> <a href="//firebase.google.com" class="footer-sites-link"> Firebase </a> </li> <li class="footer-sites-item"> <a href="//cloud.google.com" class="footer-sites-link"> Google Cloud Platform </a> </li> <li class="footer-sites-item"> <a href="//developers.google.com/products" class="footer-sites-link"> All products </a> </li> <li class="footer-sites-item"> <button aria-hidden="true" class="glue-cookie-notification-bar-control footer-sites-link"> Manage cookies </button> </li> </ul> </nav> <nav class="footer-utility-links"> <ul class="footer-utility-list"> <li class="footer-utility-item"> <a href="//developers.google.com/terms/site-terms" class="footer-utility-link"> Términos </a> </li> <li class="footer-utility-item"> <a href="//policies.google.com/privacy" class="footer-utility-link"> Privacidad </a> </li> </ul> <div class="language-selector footer" aria-label="Selecciona tu preferencia de idioma"> <button type="button" aria-controls="lang-selector-footer" aria-haspopup="true"> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#language"></use> </svg> <span class="lang-label">Español (Latam)</span> <svg role="presentation" aria-hidden="true" class="glue-icon lang-icon"> <use href="/glue-icon/#arrow-drop-down"></use> </svg> </button> <div id="lang-selector-footer" class="lang-menu hidden" role="menu"> <ul role="presentation"> <li role="presentation"> <a role="menuitem" lang="en" href="/en/introducing-keras-hub-for-pretrained-models/">English</a> </li> <li role="presentation"> <a role="menuitem" lang="es" aria-current="true" href="/es/introducing-keras-hub-for-pretrained-models/">Español (Latam)</a> </li> <li role="presentation"> <a role="menuitem" lang="id" href="/id/introducing-keras-hub-for-pretrained-models/">Bahasa Indonesia</a> </li> <li role="presentation"> <a role="menuitem" lang="ja" href="/ja/introducing-keras-hub-for-pretrained-models/">日本語</a> </li> <li role="presentation"> <a role="menuitem" lang="ko" href="/ko/introducing-keras-hub-for-pretrained-models/">한국어</a> </li> <li role="presentation"> <a role="menuitem" lang="pt-br" href="/pt-br/introducing-keras-hub-for-pretrained-models/">Português (Brasil)</a> </li> <li role="presentation"> <a role="menuitem" lang="zh-hans" href="/zh-hans/introducing-keras-hub-for-pretrained-models/">简体中文</a> </li> </ul> </div> </div> </nav> </div> </div> <script src="https://www.youtube.com/player_api"></script> <script src="//www.gstatic.com/glue/v27_1/glue.min.js"></script> <script type="text/javascript" src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/js/dgc_blog.js"></script> <script src="https://www.gstatic.com/glue/cookienotificationbar/cookienotificationbar.min.js" data-glue-cookie-notification-bar-category="2A" data-glue-cookie-notification-bar-site-id="developers.googleblog.com"> </script> <script src="https://storage.googleapis.com/gweb-developer-goog-blog-cms-assets/3beac713-6e5f-4da4-a648-60ba0b0a6ffe/js/blog_detail.js"></script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10