Close Menu
geekfence.comgeekfence.com
    What's Hot

    Teaching Coding When AI Can Write the Code – O’Reilly

    July 28, 2026

    FCC exempts new Starlink devices from router ban

    July 28, 2026

    Posit AI Blog: TensorFlow and Keras 2.9

    July 28, 2026
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    Facebook Instagram
    geekfence.comgeekfence.com
    • Home
    • UK Tech News
    • AI
    • Big Data
    • Cyber Security
      • Cloud Computing
      • iOS Development
    • IoT
    • Mobile
    • Software
      • Software Development
      • Software Engineering
    • Technology
      • Green Technology
      • Nanotechnology
    • Telecom
    geekfence.comgeekfence.com
    Home»Artificial Intelligence»Posit AI Blog: TensorFlow and Keras 2.9
    Artificial Intelligence

    Posit AI Blog: TensorFlow and Keras 2.9

    AdminBy AdminJuly 28, 2026No Comments4 Mins Read0 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    Posit AI Blog: TensorFlow and Keras 2.9
    Share
    Facebook Twitter LinkedIn Pinterest Email



    The release of Deep Learning with R, 2nd
    Edition
    coincides with new releases of
    TensorFlow and Keras. These releases bring many refinements that allow
    for more idiomatic and concise R code.

    First, the set of Tensor methods for base R generics has greatly
    expanded. The set of R generics that work with TensorFlow Tensors is now
    quite extensive:

    methods(class = "tensorflow.tensor")
     [1] -           !           !=          [           [<-        
     [6] *           /           &           %/%         %%         
    [11] ^           +           <           <=          ==         
    [16] >           >=          |           abs         acos       
    [21] all         any         aperm       Arg         asin       
    [26] atan        cbind       ceiling     Conj        cos        
    [31] cospi       digamma     dim         exp         expm1      
    [36] floor       Im          is.finite   is.infinite is.nan     
    [41] length      lgamma      log         log10       log1p      
    [46] log2        max         mean        min         Mod        
    [51] print       prod        range       rbind       Re         
    [56] rep         round       sign        sin         sinpi      
    [61] sort        sqrt        str         sum         t          
    [66] tan         tanpi      

    This means that often you can write the same code for TensorFlow Tensors
    as you would for R arrays. For example, consider this small function
    from Chapter 11 of the book:

    reweight_distribution <-
      function(original_distribution, temperature = 0.5) {
        original_distribution %>%
          { exp(log(.) / temperature) } %>%
          { . / sum(.) }
      }

    Note that functions like reweight_distribution() work with both 1D R
    vectors and 1D TensorFlow Tensors, since exp(), log(), /, and
    sum() are all R generics with methods for TensorFlow Tensors.

    In the same vein, this Keras release brings with it a refinement to the
    way custom class extensions to Keras are defined. Partially inspired by
    the new R7 syntax, there is a
    new family of functions: new_layer_class(), new_model_class(),
    new_metric_class(), and so on. This new interface substantially
    simplifies the amount of boilerplate code required to define custom
    Keras extensions—a pleasant R interface that serves as a facade over
    the mechanics of sub-classing Python classes. This new interface is the
    yang to the yin of %py_class%–a way to mime the Python class
    definition syntax in R. Of course, the “raw” API of converting an
    R6Class() to Python via r_to_py() is still available for users that
    require full control.

    This release also brings with it a cornucopia of small improvements
    throughout the Keras R interface: updated print() and plot() methods
    for models, enhancements to freeze_weights() and load_model_tf(),
    new exported utilities like zip_lists() and %<>%. And let’s not
    forget to mention a new family of R functions for modifying the learning
    rate during training, with a suite of built-in schedules like
    learning_rate_schedule_cosine_decay(), complemented by an interface
    for creating custom schedules with new_learning_rate_schedule_class().

    You can find the full release notes for the R packages here:

    The release notes for the R packages tell only half the story however.
    The R interfaces to Keras and TensorFlow work by embedding a full Python
    process in R (via the
    reticulate package). One of
    the major benefits of this design is that R users have full access to
    everything in both R and Python. In other words, the R interface
    always has feature parity with the Python interface—anything you can
    do with TensorFlow in Python, you can do in R just as easily. This means
    the release notes for the Python releases of TensorFlow are just as
    relevant for R users:

    Thanks for reading!

    Photo by Raphael
    Wild

    on
    Unsplash

    Enjoy this blog? Get notified of new posts by email:

    Posts also available at r-bloggers

    Reuse

    Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don’t fall under this license and can be recognized by a note in their caption: “Figure from …”.

    Citation

    For attribution, please cite this work as

    Kalinowski (2022, June 9). Posit AI Blog: TensorFlow and Keras 2.9. Retrieved from 

    BibTeX citation

    @misc{kalinowskitf29,
      author = {Kalinowski, Tomasz},
      title = {Posit AI Blog: TensorFlow and Keras 2.9},
      url = {},
      year = {2022}
    }



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    How lasers could help provide fuel for nuclear reactors

    July 27, 2026

    Stranded in the Slow Zone – O’Reilly

    July 26, 2026

    Towards a conversational AI agent for everyday symptom assessment

    July 25, 2026

    Issue 05 | Signal Magazine

    July 24, 2026

    MIT projects selected for funding under US Department of Energy’s Genesis Mission | MIT News

    July 23, 2026

    The Current State of Agentic AI

    July 22, 2026
    Top Posts

    Understanding U-Net Architecture in Deep Learning

    November 25, 202566 Views

    The Next Paradigm in Efficient Inference Scaling – The Berkeley Artificial Intelligence Research Blog

    May 16, 202636 Views

    Hard-braking events as indicators of road segment crash risk

    January 14, 202634 Views
    Don't Miss

    Teaching Coding When AI Can Write the Code – O’Reilly

    July 28, 2026

    For as long as we’ve taught programming, the student’s code has provided a window into…

    FCC exempts new Starlink devices from router ban

    July 28, 2026

    Posit AI Blog: TensorFlow and Keras 2.9

    July 28, 2026

    Compliance Training Software: 5 Enterprise Providers

    July 28, 2026
    Stay In Touch
    • Facebook
    • Instagram
    About Us

    At GeekFence, we are a team of tech-enthusiasts, industry watchers and content creators who believe that technology isn’t just about gadgets—it’s about how innovation transforms our lives, work and society. We’ve come together to build a place where readers, thinkers and industry insiders can converge to explore what’s next in tech.

    Our Picks

    Teaching Coding When AI Can Write the Code – O’Reilly

    July 28, 2026

    FCC exempts new Starlink devices from router ban

    July 28, 2026

    Subscribe to Updates

    Please enable JavaScript in your browser to complete this form.
    Loading
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions
    © 2026 Geekfence.All Rigt Reserved.

    Type above and press Enter to search. Press Esc to cancel.