×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What are the two ways to use Keras?

by EITCA Academy / Wednesday, 02 August 2023 / Published in Artificial Intelligence, EITC/AI/GCML Google Cloud Machine Learning, Advancing in Machine Learning, Introduction to Keras, Examination review

Keras is a high-level deep learning framework that provides a user-friendly interface for building and training neural networks. It is widely used in the field of artificial intelligence and has gained popularity due to its simplicity and flexibility. In this answer, we will discuss the two main ways to use Keras: the Sequential API and the Functional API.

The Sequential API is the simplest and most commonly used way to build neural networks in Keras. It allows you to create a linear stack of layers, where each layer has exactly one input tensor and one output tensor. You can add layers to the network using the `add()` method, specifying the type of layer and its parameters. Here is an example of how to create a simple sequential model in Keras:

python
from keras.models import Sequential
from keras.layers import Dense

model = Sequential()
model.add(Dense(units=64, activation='relu', input_shape=(input_dim,)))
model.add(Dense(units=10, activation='softmax'))

In this example, we create a sequential model with two layers: a fully connected layer with 64 units and ReLU activation, and an output layer with 10 units and softmax activation. The `input_shape` parameter in the first layer defines the shape of the input data. Once the model is defined, you can compile it using the `compile()` method, specifying the loss function, optimizer, and optional metrics. Finally, you can train the model using the `fit()` method, providing the training data and the number of epochs.

The Functional API, on the other hand, allows for more complex network architectures, including multi-input and multi-output models, shared layers, and non-sequential connections. It is particularly useful when building models with branching or merging layers. Instead of using the `Sequential` class, you define the model as a directed acyclic graph of layers. Each layer is a callable object that takes a tensor as input and returns a tensor as output. Here is an example of how to create a model using the Functional API:

python
from keras.models import Model
from keras.layers import Input, Dense

input_tensor = Input(shape=(input_dim,))
hidden_tensor = Dense(units=64, activation='relu')(input_tensor)
output_tensor = Dense(units=10, activation='softmax')(hidden_tensor)

model = Model(inputs=input_tensor, outputs=output_tensor)

In this example, we define an input tensor, apply a dense layer with 64 units and ReLU activation, and connect it to an output tensor with 10 units and softmax activation. The `Model` class is then used to create the model, specifying the input and output tensors. Similarly to the Sequential API, you can compile and train the model using the same methods.

Keras provides two main ways to build and train neural networks: the Sequential API and the Functional API. The Sequential API is simpler and suitable for linear stack architectures, while the Functional API allows for more complex network structures. Both APIs offer a user-friendly interface for building and training models in Keras.

Other recent questions and answers regarding Examination review:

  • What are the three components that need to be specified when compiling a Keras model?
  • What are the activation functions used in the layers of the Keras model in the example?
  • What are the steps involved in preprocessing the Fashion-MNIST dataset before training the model?
  • How is Keras described in terms of its design and functionality?

More questions and answers:

  • Field: Artificial Intelligence
  • Programme: EITC/AI/GCML Google Cloud Machine Learning (go to the certification programme)
  • Lesson: Advancing in Machine Learning (go to related lesson)
  • Topic: Introduction to Keras (go to related topic)
  • Examination review
Tagged under: Artificial Intelligence, Deep Learning, Functional API, Keras, Neural Networks, Sequential API
Home » Artificial Intelligence » EITC/AI/GCML Google Cloud Machine Learning » Advancing in Machine Learning » Introduction to Keras » Examination review » » What are the two ways to use Keras?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.
Eligibility for EITCA Academy 90% EITCI DSJC Subsidy support
90% of EITCA Academy fees subsidized in enrolment

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.