tensorflow/addons: Useful extra functionality for ... - GitHub

文章推薦指數: 80 %
投票人數:10人

TensorFlow Addons is a repository of contributions that conform to well-established API patterns, but implement new functionality not available in core ... Skiptocontent {{message}} tensorflow / addons Public Notifications Fork 589 Star 1.6k UsefulextrafunctionalityforTensorFlow2.xmaintainedbySIG-addons License Apache-2.0license 1.6k stars 589 forks Star Notifications Code Issues 208 Pullrequests 39 Actions Projects 2 Security Insights More Code Issues Pullrequests Actions Projects Security Insights tensorflow/addons Thiscommitdoesnotbelongtoanybranchonthisrepository,andmaybelongtoaforkoutsideoftherepository. master Branches Tags Couldnotloadbranches Nothingtoshow {{refName}} default Couldnotloadtags Nothingtoshow {{refName}} default Atagalreadyexistswiththeprovidedbranchname.ManyGitcommandsacceptbothtagandbranchnames,socreatingthisbranchmaycauseunexpectedbehavior.Areyousureyouwanttocreatethisbranch? 20 branches 34 tags Code Clone HTTPS GitHubCLI UseGitorcheckoutwithSVNusingthewebURL. WorkfastwithourofficialCLI. Learnmore. OpenwithGitHubDesktop DownloadZIP LaunchingGitHubDesktop Ifnothinghappens,downloadGitHubDesktopandtryagain. LaunchingGitHubDesktop Ifnothinghappens,downloadGitHubDesktopandtryagain. LaunchingXcode Ifnothinghappens,downloadXcodeandtryagain. LaunchingVisualStudioCode Yourcodespacewillopenonceready. Therewasaproblempreparingyourcodespace,pleasetryagain. Latestcommit chenmoneygithub GetcompatiblewithoptimizermigrationinTF2.11(#2766) … 1f14395 Oct12,2022 GetcompatiblewithoptimizermigrationinTF2.11(#2766) *GetcompatiblewithoptimizermigrationinTF2.11 *Fixcomments *addadamwtothechange *Addtypeexception 1f14395 Gitstats 1,483 commits Files Permalink Failedtoloadlatestcommitinformation. Type Name Latestcommitmessage Committime .devcontainer BuildagainstTF2.9(#2696) May20,2022 .github BuildAgainstTF2.10(#2744) Sep20,2022 build_deps FixlocalbuildwithGPUsupport(#2764) Sep26,2022 docs Fixtypoinaverageoptimizerscallback(#2692) Apr12,2022 tensorflow_addons GetcompatiblewithoptimizermigrationinTF2.11(#2766) Oct11,2022 tools GetcompatiblewithoptimizermigrationinTF2.11(#2766) Oct11,2022 .bazeliskrc Increasebazelto4.2.1(#2625) Dec15,2021 .dockerignore Useadockerfiletoproducethelinuxwheel.(#1287) Mar12,2020 .flake8 Finishingthepytestmigration.(#1661) Apr24,2020 .gitignore Addpip-wheel-metadatatogitignore(#1804) May9,2020 BUILD CLN:Movebuildpippkgscriptfromrootdirectory(#921) Jan23,2020 CODE_OF_CONDUCT.md BUILD:Setupforrelease(#62) Mar4,2019 CONTRIBUTING.md BuildAgainstTF2.10(#2744) Sep20,2022 LICENSE removecopyrightnotice(#702) Nov19,2019 MANIFEST.in BuildAddonsforWindows(CPU)(#771) Dec19,2019 MIGRATION_TO_CORE.md *Updatemigrationstrategy(#2156) Nov1,2020 README.md UpdateCompatMatrix(#2759) Oct4,2022 STYLE_GUIDE.md Clean-upofthedockertoolsforlocaldev.(#1028) Feb8,2020 WORKSPACE BuildAgainstTF2.10(#2744) Sep20,2022 configure.py BuildAgainstTF2.10(#2744) Sep20,2022 pyproject.toml ⬆️Lintingdependencies(#2663) Feb15,2022 pytest.ini Enabledoctest(#2069) Aug7,2020 requirements.txt migrateapiandfixbuildissue(#2682) Mar10,2022 setup.py Buildagainsttf2.8(#2635) Feb15,2022 Viewcode ContinuousBuildStatus AddonsSubpackages Maintainership Installation StableBuilds PythonOpCompatility PythonOpCompatibilityMatrix C++CustomOpCompatibility C++CustomOpCompatibilityMatrix NightlyBuilds InstallingfromSource CPUCustomOps GPUandCPUCustomOps Tutorials CoreConcepts StandardizedAPIwithinSubpackages GPUandCPUCustomOps ProxyMaintainership PeriodicEvaluationofSubpackages Contributing Community License README.md ContinuousBuildStatus Build Status Ubuntu/macOS/Windows UbuntuGPUcustomops TensorFlowAddonsisarepositoryofcontributionsthatconformto well-establishedAPIpatterns,butimplementnewfunctionality notavailableincoreTensorFlow.TensorFlownativelysupports alargenumberofoperators,layers,metrics,losses,andoptimizers. However,inafastmovingfieldlikeML,therearemanyinterestingnew developmentsthatcannotbeintegratedintocoreTensorFlow (becausetheirbroadapplicabilityisnotyetclear,oritismostly usedbyasmallersubsetofthecommunity). AddonsSubpackages tfa.activations tfa.callbacks tfa.image tfa.layers tfa.losses tfa.metrics tfa.optimizers tfa.rnn tfa.seq2seq tfa.text Maintainership ThemaintainersofTensorFlowAddonscanbefoundintheCODEOWNERSfileoftherepo.Thisfile isparsedandpullrequestswillautomaticallytagtheownersusingabot.Ifyouwould liketomaintainsomething,pleasefeelfreetosubmitaPR.Weencouragemultiple ownersforallsubmodules. Installation StableBuilds TensorFlowAddonsisavailableonPyPIforLinux,macOS,andWindows.Toinstallthelatestversion, runthefollowing: pipinstalltensorflow-addons ToensureyouhaveaversionofTensorFlowthatiscompatiblewithTensorFlowAddons, youcanspecifythetensorflowextrarequirementduringinstall: pipinstalltensorflow-addons[tensorflow] Similarextrasexistforthetensorflow-gpuandtensorflow-cpupackages. TouseTensorFlowAddons: importtensorflowastf importtensorflow_addonsastfa PythonOpCompatility TensorFlowAddonsisactivelyworkingtowardsforwardcompatibilitywithTensorFlow2.x. However,therearestillafewprivateAPIuseswithintherepositorysoatthemoment wecanonlyguaranteecompatibilitywiththeTensorFlowversionswhichitwastestedagainst. Warningswillbeemittedwhenimportingtensorflow_addonsifyourTensorFlowversiondoesnotmatch whatitwastestedagainst. PythonOpCompatibilityMatrix TensorFlowAddons TensorFlow Python tfa-nightly 2.8,2.9,2.10 3.7,3.8,3.9,3.10 tensorflow-addons-0.18.0 2.8,2.9,2.10 3.7,3.8,3.9,3.10 tensorflow-addons-0.17.1 2.7,2.8,2.9 3.7,3.8,3.9,3.10 tensorflow-addons-0.16.1 2.6,2.7,2.8 3.7,3.8,3.9,3.10 tensorflow-addons-0.15.0 2.5,2.6,2.7 3.7,3.8,3.9 tensorflow-addons-0.14.0 2.4,2.5,2.6 3.6,3.7,3.8,3.9 tensorflow-addons-0.13.0 2.3,2.4,2.5 3.6,3.7,3.8,3.9 tensorflow-addons-0.12.1 2.3,2.4 3.6,3.7,3.8 tensorflow-addons-0.11.2 2.2,2.3 3.5,3.6,3.7,3.8 tensorflow-addons-0.10.0 2.2 3.5,3.6,3.7,3.8 tensorflow-addons-0.9.1 2.1,2.2 3.5,3.6,3.7 tensorflow-addons-0.8.3 2.1 3.5,3.6,3.7 tensorflow-addons-0.7.1 2.1 2.7,3.5,3.6,3.7 tensorflow-addons-0.6.0 2.0 2.7,3.5,3.6,3.7 C++CustomOpCompatibility TensorFlowC++APIsarenotstableandthuswecanonlyguaranteecompatibilitywiththe versionTensorFlowAddonswasbuiltagainst.Itispossiblecustomopswillworkwithmultiple versionsofTensorFlow,butthereisalsoachanceforsegmentationfaultsorotherproblematiccrashes. WarningswillbeemittedwhenloadingacustomopifyourTensorFlowversiondoesnotmatch whatitwasbuiltagainst. Additionally,customopsregistrationdoesnothaveastableABIinterfacesoitis requiredthatusershaveacompatibleinstallationofTensorFloweveniftheversions matchwhatwehadbuiltagainst.AsimplificationofthisisthatTensorFlowAddons customopswillworkwithpip-installedTensorFlowbutwillhaveissueswhenTensorFlow iscompileddifferently.Atypicalexampleofthiswouldbeconda-installedTensorFlow. RFC#133aimstofixthis. C++CustomOpCompatibilityMatrix TensorFlowAddons TensorFlow Compiler cuDNN CUDA tfa-nightly 2.10 GCC9.3.1 8.1 11.2 tensorflow-addons-0.18.0 2.10 GCC9.3.1 8.1 11.2 tensorflow-addons-0.17.1 2.9 GCC9.3.1 8.1 11.2 tensorflow-addons-0.16.1 2.8 GCC7.3.1 8.1 11.2 tensorflow-addons-0.15.0 2.7 GCC7.3.1 8.1 11.2 tensorflow-addons-0.14.0 2.6 GCC7.3.1 8.1 11.2 tensorflow-addons-0.13.0 2.5 GCC7.3.1 8.1 11.2 tensorflow-addons-0.12.1 2.4 GCC7.3.1 8.0 11.0 tensorflow-addons-0.11.2 2.3 GCC7.3.1 7.6 10.1 tensorflow-addons-0.10.0 2.2 GCC7.3.1 7.6 10.1 tensorflow-addons-0.9.1 2.1 GCC7.3.1 7.6 10.1 tensorflow-addons-0.8.3 2.1 GCC7.3.1 7.6 10.1 tensorflow-addons-0.7.1 2.1 GCC7.3.1 7.6 10.1 tensorflow-addons-0.6.0 2.0 GCC7.3.1 7.4 10.0 NightlyBuilds TherearealsonightlybuildsofTensorFlowAddonsunderthepippackage tfa-nightly,whichisbuiltagainstthelateststableversionofTensorFlow.Nightlybuilds includenewerfeatures,butmaybelessstablethantheversionedreleases.Contraryto whatthenameimplies,nightlybuildsarenotreleasedeverynight,butateverycommit ofthemasterbranch.0.9.0.dev20200306094440meansthatthecommittimewas 2020/03/06at09:44:40CoordinatedUniversalTime. pipinstalltfa-nightly InstallingfromSource Youcanalsoinstallfromsource.ThisrequirestheBazelbuildsystem(version>=1.0.0). CPUCustomOps gitclonehttps://github.com/tensorflow/addons.git cdaddons #ThisscriptlinksprojectwithTensorFlowdependency python3./configure.py bazelbuildbuild_pip_pkg bazel-bin/build_pip_pkgartifacts pipinstallartifacts/tensorflow_addons-*.whl GPUandCPUCustomOps gitclonehttps://github.com/tensorflow/addons.git cdaddons exportTF_NEED_CUDA="1" #Settheseifthebelowdefaultsaredifferentonyoursystem exportTF_CUDA_VERSION="11" exportTF_CUDNN_VERSION="8" exportCUDA_TOOLKIT_PATH="/usr/local/cuda" exportCUDNN_INSTALL_PATH="/usr/lib/x86_64-linux-gnu" #ThisscriptlinksprojectwithTensorFlowdependency python3./configure.py bazelbuildbuild_pip_pkg bazel-bin/build_pip_pkgartifacts pipinstallartifacts/tensorflow_addons-*.whl Tutorials Seedocs/tutorials/ forend-to-endexamplesofvariousaddons. CoreConcepts StandardizedAPIwithinSubpackages Userexperienceandprojectmaintainabilityarecoreconceptsin TensorFlowAddons.Inordertoachievethesewerequirethatouradditions conformtoestablishedAPIpatternsseenincoreTensorFlow. GPUandCPUCustomOps TensorFlowAddonssupportsprecompiledcustomopsforCPUandGPU.However, GPUcustomopscurrentlyonlyworkonLinuxdistributions.ForthisreasonWindowsandmacOS willfallbacktopureTensorFlowPythonimplementationswheneverpossible. TheorderofpriorityonmacOS/Windowsis: PureTensorFlow+Pythonimplementation(worksonCPUandGPU) C++implementationforCPU TheorderofpriorityonLinuxis: CUDAimplementation C++implementation PureTensorFlow+Pythonimplementation(worksonCPUandGPU) Ifyouwanttochangethedefaultpriority,"C++andCUDA"VS"pureTensorFlowPython", youcansettheenvironmentvariableTF_ADDONS_PY_OPS=1fromthecommandlineor runtfa.options.disable_custom_kernel()inyourcode. Forexample,ifyouareonLinuxandyouhavecompatibilityproblemswiththecompiledops, youcangiveprioritytothePythonimplementations: Fromthecommandline: exportTF_ADDONS_PY_OPS=1 orinyourcode: importtensorflow_addonsastfa tfa.options.disable_custom_kernel() ThisvariabledefaultstoTrueonWindowsandmacOS,andFalseonLinux. ProxyMaintainership TensorFlowAddonshasbeendesignedtocompartmentalizesubmodulesso thattheycanbemaintainedbycommunityuserswhohaveexpertise,andavested interestinthatcomponent.Weheavilyencourageuserstosubmitsignuptomaintaina submodulebysubmittingyourusernametotheCODEOWNERSfile. Fullwriteaccesswillonlybegrantedaftersubstantialcontribution hasbeenmadeinordertolimitthenumberofuserswithwritepermission. Contributionscancomeintheformofissueclosings,bugfixes,documentation, newcode,oroptimizingexistingcode.Submodulemaintainershipcanbegranted withalowerbarrierforentryasthiswillnotincludewritepermissionsto therepo. FormoreinformationseetheRFC onthistopic. PeriodicEvaluationofSubpackages Giventhenatureofthisrepository,submodulesmaybecomeless andlessusefultothecommunityastimegoeson.Inordertokeepthe repositorysustainable,we'llbeperformingbi-annualreviewsofourcodeto ensureeverythingstillbelongswithintherepo.Contributingfactorstothis reviewwillbe: Numberofactivemaintainers AmountofOSSuse Amountofissuesorbugsattributedtothecode Ifabettersolutionisnowavailable FunctionalitywithinTensorFlowAddonscanbecategorizedintothreegroups: Suggested:well-maintainedAPI;useisencouraged. Discouraged:abetteralternativeisavailable;theAPIiskeptfor historicreasons;ortheAPIrequiresmaintenanceandisthewaitingperiod tobedeprecated. Deprecated:useatyourownrisk;subjecttobedeleted. Thestatuschangebetweenthesethreegroupsis: SuggestedDiscouraged->Deprecated. TheperiodbetweenanAPIbeingmarkedasdeprecatedandbeingdeletedwillbe 90days.Therationalebeing: IntheeventthatTensorFlowAddonsreleasesmonthly,therewillbe2-3 releasesbeforeanAPIisdeleted.Thereleasenotescouldgiveuserenough warning. 90daysgivesmaintainersampletimetofixtheircode. Contributing TensorFlowAddonsisacommunity-ledopensourceproject(onlyafewmaintainersworkforGoogle!). Assuch,theprojectdependsonpubliccontributions,bugfixes,anddocumentation. ThisprojectadherestoTensorFlow'scodeofconduct. Byparticipating,youareexpectedtoupholdthiscode. Doyouwanttocontributebutarenotsureofwhat?Hereareafewsuggestions: Addanewtutorial.Locatedindocs/tutorials/, theseareagreatwaytofamiliarizeyourselfandotherswithTensorFlowAddons.See theguidelinesformoreinformationonhowtoadd examples. Improvethedocstrings.Thedocstringsarefetchedandthendisplayedinthedocumentation. Doachangeandhundredsofdeveloperswillseeitandbenefitfromit.Maintainersareoftenfocused onmakingAPIs,fixingbugsandothercoderelatedchanges.Thedocumentationwillnever belovedenough! Solveanexistingissue. Theserangefromlow-levelsoftwarebugstohigher-leveldesignproblems. Checkoutthelabelhelpwanted.Ifyou'reanewcontributor,thelabelgoodfirstissuecanbeagoodplacetostart. Reviewapullrequest.Soyou'renotasoftwareengineerbutyouknowalot aboutacertainfieldaresearch?That'sawesomeandweneedyourhelp!Manypeople aresubmittingpullrequeststoaddlayers/optimizers/functionstakenfromrecent papers.SinceTensorFlowAddonsmaintainersarenotspecializedineverything, youcanimaginehowharditistoreview.Ittakesverylongtoreadthepaper, understanditandcheckthemathinthepullrequest.Ifyou'respecialized,lookat thelistofpullrequests. Ifthereissomethingfromapaperyouknow,pleasecommentonthepullrequestto checkthemathisok.Ifyouseethateverythingisgood,sayit!Itwillhelp themaintainerstosleepbetteratnightknowingthathe/shewasn'ttheonly persontoapprovethepullrequest. Youhaveanopinionandwanttoshareit?Thedocsarenotveryhelpfulfor afunctionoraclass?Youtriedtoopenapullrequestbutyoudidn'tmanageto installortestanythingandyouthinkit'stoocomplicated?Youmadeapullrequest butyoudidn'tfindtheprocessgoodenoughanditmadenosensetoyou?Please sayit!Wewantfeedback.Maintainersaretoomuchtheheadintothecode tounderstandwhatit'slikeforsomeonenewtoopensourcetocometothisproject. Ifyoudon'tunderstandsomething,beawaretherearenopeoplewhoare badatunderstanding,therearejustbadtutorialsandbadguides. Pleaseseecontributionguidelinestogetstarted(andremember, ifyoudon'tunderstandsomething,openanissue,orevenmakeapullrequestto improvetheguide!). Community PublicMailingList SIGMonthlyMeetingNotes Joinourmailinglistandreceivecalendarinvitestothemeeting License ApacheLicense2.0 About UsefulextrafunctionalityforTensorFlow2.xmaintainedbySIG-addons Topics python machine-learning deep-learning neural-network tensorflow tensorflow-addons Resources Readme License Apache-2.0license Codeofconduct Codeofconduct Stars 1.6k stars Watchers 54 watching Forks 589 forks Releases 33 TensorFlowAddonsv0.18.0 Latest Sep21,2022 +32releases Packages0 Nopackagespublished Usedby6.7k +6,698 Contributors195 +184contributors Languages Python 84.1% C++ 9.0% Smarty 4.7% Starlark 1.1% Other 1.1% Youcan’tperformthatactionatthistime. Yousignedinwithanothertaborwindow.Reloadtorefreshyoursession. Yousignedoutinanothertaborwindow.Reloadtorefreshyoursession.



請為這篇文章評分?