TensorFlow Hub: A Library for Reusable Machine Learning Modules in TensorFlow

Introducing TensorFlow Hub: Library for Reusable Machine Learning Modules at TensorFlow

One of the most fundamental things in software development is the idea of ​​a store of shared code that is easy to ignore. As programmers, libraries instantly make us more effective. In a sense, they change the process of problem-solving programming. When using the library, we often think of programming in terms of building blocks - or modules - that can be glued together.


How can a library be considered a machine education developer? Of course, in addition to the share to code, we also want to share pre-trend models. Sharing pre-trained models make it possible for developers to optimize for their domain, without access to computer resources or data used to train the model in the original hands. For example, the NASNet train took thousands of GPU-hours. By sharing the weights learned, a model developer can make it easier for others to reuse and build their work.





It's a library idea for machine education developers that inspired the TensorFlow Hub, and we're happy to share it with the community today. TensorFlow Hub TensorFlow is a platform for publishing, locating, and reusing portions of machine learning modules. By a module, we mean a self-contained fraction of a TensorFlow graph, with its weight, which can be reused in other, similar functions. By reusing the module, a developer can train the model using a small dataset, improve generalizations, or simply speed up the training. Let's look at some examples of how to make this concrete.

Image retraining


As a first example, let's look at a technique that you can use to train an image classifier, starting with a small amount of training data. Modern image recognition models have millions of parameters, and of course, training from scratch requires a large amount of labeled data and computing power. Using a technique called image retraining, you can train the model using very little data, and very little computing time. Here's what it looks like in a TensorFlow hub.

The basic idea is to reuse existing image recognition modules to extract features from your images, and then train new categorizers on these. As you can see above, TensorFlow Hub modules can be instant from the URL (or, from the file system path) when the TensorFlow graph is being created. From there, TensorFlow Hub has a variety of modules that you can choose from, including NASNet, MobileNet (including its latest V2), Inception, ResNet, and more. To use the module you import the TensorFlow Hub, then copy/paste the module's URL into your code.


Some image modules are available at TensorFlow Hub.


Each module has a defined interface that allows it to be used in a modifiable way, with little or no knowledge of its interiors. In this case, this module has a method that you can use to retrieve the desired image size. As a developer, you only need to provide the correct size of the group of images, and call modules in them to get feature representation. This module takes care of the pre-processing of images for you so that you can represent the feature in a single step directly from the group of images. From here, you can classify linear models or other types, above all.

In this case, notify that the module we are using is hosted by Google, and has been edited (so that you cannot change the module that you use in your experiments). Modules can be used as a simple Python type to construct a portion of a graphic. Once exported to disk, the modules contain themselves, and others can use it to create code and data, create it and use it for training (of course you can also publish).



Text classification


Let's take a look at the second example. Imagine that you want to train a model to categorize movie reviews as positive or negative, starting with just a small amount of training data (say, several hundred positive and negative movie reviews). Since you have a limited number of examples you decide to pick up a dataset of word embedding, first trained in a very large corpus. Here's how to use a tensor flow hub.


As before, we start by selecting the module. TensorFlow Hub has a variety of text modules for you to explore, including neural network language models in different languages ​​(N, JP, DE, and ES), as well as Word 2vec trained on Wikipedia, and NNLM embedding trained on Google News.


Some text modules shared in TensorFlow Hub.


In this case, we will use the module for word embedding. The code above downloads the module, uses it to preprocess the sentence, then retrieves the embedding for each token. This means you can go directly to your dataset from a sentence that can go to the appropriate format for the classifier in one step. The module works to tokenize sentences, and to handle other logic-like words outside of vocabulary. Both preprocessing logic and embedding are encapsulated in a single module, making it easy to use different datasets of simple word embedding, or different pre-processing strategies, without changing your code.


Text classification tutorial using TensorFlow Hub.


If you want to try it, use this tutorial to take it for a spin and to learn how the TensorFlow Hub module works with TensorFlow Estimators.


Universal Sentence Encoder


We've also shared the new TensorFlow Hub module! Below is an example of the Universal Sentence Encoder used. It is a sentence-level embedding module that is trained in a wide variety of datasets (in other words, "universal"). Some of the good things about it are semantic similarity, custom text classification, and cluster.


This notebook shows how to train a simple binary text classifier above any TF-Hub module.


As with image retraining, the module requires relatively little label data to adapt to your own work. Let's try this in a restaurant review for example.



Other modules

Tensorflow hub is more than image and text classification. On the website, you will also find some modules for progressive GAN and Google Landmark Deep local features.

Ideas

There are some important considerations when using the TensorFlow Hub modules. First, note that the modules contain code that can be turned on. Always use modules from trusted sources. Second, as in all machine learning, fairness is an important consideration. Both examples are large pre-trained datasets we have shown above. When replicating such a dataset, it is important to consider what data it contains (and whether there are any existing biases), and how this may affect the product you are building and its users.

Get started with TensorFlow.js → https://js.tensorflow.org

Comments

Popular posts from this blog

Artificial intelligence (AI) - the ability of a digital computer.

Facebook's name has been changed to 'rebranding'

What is SEO and how to do search engine optimization?

Labels

Social media of Facebook What a and This phone are on you mobile IT internet Android Do Nepal smartphone your workforce app for from can iPhone robot use will with Machine Learning Python media not account be company computer these Apple YouTube data does password twitter Instagram digital feature like new that why ChatGPT Whatsapp by machine social Tiktok an China Future free information or search work has make online out people way website without India Laptop ML Now One US apps corona features find public video videos year Elon Musk If Know Microsoft billion cyber market million protect service user users Avoid Have Intelligence Windows battery chrome education history home money photo photos update want Bitcoin Here Machine Learning Future Nepali Operators Scientists Wi-Fi about browser code download hacking may need network security smart system tips which world Amazon Artificial Intelligence Future Cryptocurrency Learning TV Things artificial being don't down hacker human malware many netflix phones safe software study there used when 10 15 Beginners Buy Content Deep Learning Did Gmail Privacy Who after business career chat cloud digital marketing easy look marketing millions number sent settings two virus work force 7 Agriculture Bug Deep Earth GPS Google Maps Kaggle Keep NASA RAM Some Than Top Types Windows 11 World Cup Xiaomi address all also as at attack available camera change dangerous difference drive earn email going hacked hackers image including its job jobs language life message meta mind news old open passwords pay price really search engine storage store such take their version watch windows 10 working 14 2020 2022 4 5 6 Cambridge Dark Web GB GPT Global Health-care Here's Lite Maps Messages More Oppo Pakistan PayPal Print Pro QR Reasons Risk SEE SEO Samsung So Telegram TensorFlow Thinking Tutorial Type Vision Ways WiFi Zoom advertising any bank been best better biggest blue brain buying chip comments computers country created cyber attacks doing electricity engine eyes fake files first football function game games get go government hidden hours install lost medical misused mode monetization monitor moon name once percent play problem problems processing program quantum quickly robots scan science send share signal smartphones space stay story them they thousands time topics tricks up useful using was water web where while wireless workers 000 2024 5G AI Education Alan Musk America Analytica Applications Army Banned Because Before Blockchain Bounty CCTV COVID-19 Chat GPT Choose Clean Close Clubhouse Computer Vision Crypto DL DNS Developer Development Docs EV Electric Even Explain Factory Finally Gemini Google chrome Google drive Healthcare Help I IBM Includes Japan Keras Kernels Large Lifestyle Looking MDMS Mac Models Music Musk Must Natural Ncell Nepal's Net Notebooks Operating PC Preparing Prime Revolution Russia SIM SMS Save Scikit-Learn Skills SpaceX Stephen Hawking Sun Tesla Theme Therefore VPN Variables Visas Word WorldLink ability accounts ads age airplane along aware background bandwidth become becoming beneficial between blocked bring bully cable call cameras cannot captions capture care cause charge charging chatbots check come coming companies complete consumption control copyright corona-virus could countries courses create currency cyber security dataset datasets days delete deleted deleting details developed device different dislike doctor documents domain due during dynamic easier employees energy engineer engineering exactly forever forget found fraud full gadgets getting given glasses good got guest hand handle his humans iOS iOS 26 iPhone 14 iPhones important increase industry invest keyboard known launch launched law learn list listen live main manager map meaning megapixel memory messenger model month months most movies much nonsense nuclear opening original over own phishing physics porn post posts prevent private product production programming protection ready real-world reduce reward robotics run same saving say saying says scandal searched secure selfie show site sold someone source speaking speed spyware stuck students subscription systems target techology television tick today torrent traffic trick trillion universe upload various verification voice war weakest women worldwide years "Nano Banana" $100 & 'Buy the Dip' 'HDR' 'I' 'Mr. Beast' 'Professional Mode' 'football intelligence' 'hidden' 'refill station' (IoT) (LLM) (NLP) 1 100 10:10 10th 11 12 145 16 17 19 2 200 2007 25 30 35 3D 40 4000 48 4K 5 P's 60 7 C's 8 @everyone on A17 AI Tool AI ethics AI-Based AI-powered API AR Adjust Adobe Adopt Adsense Adsense Supports Africa Alexa Ali Baba Altman Amazon Jungle Amazon Prime Ambani American Anaconda Android 11 Android TV Android phone Annoyed Apply Appoints Arithmetic Art Art through NFTs Artficial Intelligence Artificial neural Artuficial Intellegence Ashika Tamang Assignment Assistant Astronauts Astronomy Atrificial Inteligence Attacks Audiobooks Augmented Reality Australia Auto-GPT AutoML Avatar 2 Bachelors Banning Bard AI Based Bernie Sanders Beyond Big data BigQuery Bill Gates Bitwise Blind Blockchain Developer Blockchain Technology Books Brave Brave Browser Brazil Browser's Bumble C charger CEO CPU CPU temperature CTEVT CV Cases Casting Changed ChatGBT Chery Chinese Citroën C5 Cloud Factory Cloud Factory Nepal Club House Colab Command Comparison Compute Concatenate Contactless Contactless payment system Copa America Copilot Couple Challenge Crash test Create your first Project on Python Crossover Cup Cybersecurity DRS Gaming Dark mode Datalab Dating Deep Fake Deep Learinig Deep Learning with Python Deep Neural Networks Deepfake Defender Demat Dept Development in predictive analytics Didn't Digital avatars Disable Discontinuing Discovers Do not Dodge Dogecoin DuckDuckGo E-task EA ETF EU Earbuds Earth 2 Earthquake Economic Edge Computing El Salvador Elected Electric Vehicles Electrical Elon Embassy Embedded Application Embedded Application (EA) Emoji Estimators Ethical Hacking Euro NCAP European Everyone Evolve Explained Explosion Express WiFi FPS Facebook Messenger Facebook's Facets Fears Federal Reserve System Finance Firefox FiveG Fixed wireless Follow Forge Fraud Call Freefire Freelancing GIF Gboard Git Glass Gold Google Chat Google Cloud Google Meet Google Play Music Google Plus Google Plus code Google Workspace Google search Google's Green room Greenroom. Spotify Guest Mode HDMI Happy Birthday Health sector Holi Honest Honeygain Huawei Hyundai ID IMD IP ISP Identify Implementing Increasing Indonesia Inflation InfoSec Input Inspiration Installation Integrated circuit Intel Intelligent Internet of Things (IoT) Introduction Iranian Island Isn't JBL JPG JPMorgan Chase & Co Jack Ma January JavaScript Jio Joker Virus Jungle Jupyter Jupyter Notebooks Keys Korean LAN LLM LP Large Language Models Launch of better autonomous systems Lee Kun-hee Library Line Linux Liquid Logical Lucky MDMS Nepal ML Engine MSN MaAfee Mark Zuckerberg Max Meet Membership Mero Share Metaverse Microsoft Office Microsoft Teams Military Military weapons Minister Mobile Operating System Module Mouse Mukesh Ambani NASA's NEA NFT NFTs Natural language processing (NLP) Nepal. radio mapping Nepali businesses Nepali game Nepali youth Nepalis NetTV Neural Network Neural Networks New Technology No Nokia North Korea Note Nvidia Object Detection Open-source OpenAI Opera PDF PNG PPT PUBG Pandas Paytm Pendrive Photoshoot Pi Network Pip Plan Play Store Pokémon Pokémon Go Police Premium Preparations Prerequisite Pro's Process Process discovery Pycharm Pyenv Python Programming Python Tutorial Python Tutorials Python for Beginners Python on Windows Quick Draw RCS Race Radically Ransomware Rashtra Bank Reboot Recommender Recommender Systems Redmi Reinforcement Reinforcement learning Reliable Reliance Reliance Jio Remittances Remotely Remove. bg Replacing Reverse Rice that grows for years once planted Rises Robot Sophia Roles Ronaldo Routine of Nepal Banda S&P 500 S&P Global Ratings SD Scale Scaling Scikit Screen Pinning Selection Seven Shorts Singapore Sitting SixG Snapchat Sophia South Korea Space X Spam Stable Coin Starlink Steve Jobs Stock market String Success Sundar Pichai Supermarket Supervised Supervised Learning Supervised Machine Learning Supply Chain Attack Supports Swift TIFF Teenagers Telecom TensorBoard TensorFLow Hub Thes Tiktok stop Time Travel Tool Training Data Transforming Translation Trojan Truecaller Trump Trusting Try Type-C Typing US Congress USA USB Understand United States Unnecessary Unsupervised Unsupervised Learning Unsupervised LearningUnsupervised Machine Learning Unsupervised Machine Learning Upcoming Upcoming Technology Urges Using a drone VPNs VR Vehicles Virtual reality Virtualenv Visualize WWW Wait Walkthrough Walmart WeChat Wha What are Assignment Operators in Python What are Comparison Operators in Python What are Logical Operators in Python What are Operators in Python What are the basic laws of quantum physics What is What is Chat GPT What is Google Adsense What is Pycharm What is Python What is String in Python What is Variable in Python Whose Wi-Fi 6 Wikipedia WordPress Wrangling data Write X X8 series XAI XOR XSS YouTuber Ziglar Zipty Zuckerberg admin advantage advertisers again against agency agricultural ai beauty aims air aircraft aired alert algorithm almost alpha alternative analytics ancient angles announcement announces another answer answering antivirus anyone anything appear appearance appliances application approach approaching approaching science meaning apps. google arise arrived article artificial blood vessels arts associated attention attractions audience authentic authentication automatic automatically autonomous avatars back backed ban bans bar basic batteries beginner benefit benefits bitcoin mine bitcoins black block boarding bogged book bought box brand break brings broadband brought browsing bug bounty build but buttons bypass cable internet cables calculus calls campaign can't cancer car cards careeer carry cave center challenge channel charger chat.com cheap cheaper checkmarks chess child children choose. a class clicking climbers clock closest club coding colleges color combat common communicate compensates compete competing completely computer mouse computer science concept connect cons consider controls controversies credit crimes crisis criteria crore crores crowdsourcing culture cyberattack cyberspace cycle d about damaged danger dark data center data science dating apps day debit dedicated delete data deny depression destination devices diary die digit digital banking digital cameras digital land digital privacy disappeared disappearing discovered discovery displaced display displays disrupt disturbing document dog dollars doodle door downloads drains dream drone drug trafficking e features e-Rupee e-books e-passport e-sewa eBooks ePassport each earn money from Nepal easily eating economy edit editing effective electronic eligible else email server emails emerged emergency emojis employee end enough entering entire espionage etflix ethics except excessive excuse existence expected expire extracts eye face app facial verification factor facts failed family far farm fax fdown.net fee feet fiber fight file film final five flying foldable food fooled footprint forced foreigners forensics forgotten form formats foundation free upgrade frequency freshman from search fruit fuel game tips gamer gas gasoline geometry gestures gets gives goes good content goodbye goods google docs gossip granted great groups growing hack had hall handy happen happy harmful he head headphones headset heater hobby human brain human intelligence human trafficking hundreds hurting hydrogen hype iCloud iPhone 12 Pro illegal data illicit trade image processing processor images impair inbox incidents incognito income increased incur insecure instant instrument interest internal storage internet speed into intranet introduced invented invention investigating investment invites it's it’s jack join journalists journey kit laboratory lakh languages last later latest launches launching lawmakers laws leak leaks legalize let letter letters light likes link lives loaded location locked longest lose loss love machine vision made main features maintain maker makes man manage management system mango marketplace martial mask matches matter meanings measuring meetings melting meme messaging microphone middle million. downloads mine mistake mistakes mobile number moble moment monetize monitors mountain move movie moving mute name-x naming near necessary networks neural neural networking new code new look new windows news anchor next night mode non notes notifications now.gg nuclear energy obscene official officially offline open source opened operate operated operating system opposed optic optical fiber optimization option options other others our outbreak overheating oversold owner page paid pandemic paper participant participate passkeys passports password. patent pattern paying payment peace pen drive permanent permission person personal perspective phone confidential picture pictures pirated placed placing planting platform platforms policy political pop-up popular popularity port possible powered practice predictive pregnant prepared principles prize processor product key programmatically programming languages project prompt property pros protected provided proxies proxy quantum computer quantum internet quires quota r daily radio rain rainy season rate reach reading real reason rebranding record recovery reform refresh refreshes refrigerator regarding registered registration regulators rejected relationship released remain remove removes removing repairing replace report requiring reset residence resolution responsibilities restaurants returned revenue review rings risks risky road robotic dog rocket room rooms round ruin rules running runs safely safety sale satellite scammers scary schedule scheme schools screen screens search engines secret secretly selectric cars sell semi-final semiconductor sending series server services shared shield ships shocked shortage should shoulders shuffled shut shuts shutting sidebar simple since sites sky sleeping slightly slow smartblock smartly social engineering hacking software. tech solutions solve somewhere soon sources space center space debris spacecraft spaceships special specifications spectrum spend spending sponsors sports spying star starship start started starting starvation steps stocks stolen stop stories strategy streaming strong student studying subject subscribers successful suggested suggestions suitable suitcase superintelligence surface surprised survive t are tag tagging talent talk teach team technlogy technoloy technonlogy telecommunication terminology test text think thousand thread threat to threats through throwaway tightens timer tinder toilet too took tools topic tossing touch pad tracking trackpad trading transact transactions transport travel trending trends trip turn turns tweets unbuyable unemployed unemployment unpleasant unregistered unsafe unseen unveils upgrades uses versatility very view viral virtual virtual currency virtual world vishing visit visiting voter vulnerabilities warning washing waterproof we weapon weapons web design websites week well went were wet willing withdrawn woman won't words works workspace world war worrie worried worth writer written wrong young ‘Hosts’ ‘Wi-Fi Pineapple’
Show more