Keras is a high-level open-source neural networks library written in Python. It is designed to enable fast experimentation with deep learning algorithms. Developed with a focus on user-friendliness, modularity, and extensibility, Keras works as an interface for the TensorFlow and Theano libraries. It's an excellent option for developers who want to build and experiment quickly with different types of deep learning models.

Keras: High-level overview

Keras operates at a high level of abstraction, simplifying the process of building and designing deep learning models. It works by making use of backend engines such as TensorFlow or Theano, and by providing a clean and straightforward API, it makes it easy to design and create deep learning models irrespective of the backend computational libraries.

The workflow in Keras is quite streamlined and involves only a few steps. Start by defining your model––you can choose from a sequential model (for a simple stack of layers where each layer has exactly one input tensor and one output tensor) or a functional model (for more complex architectures). Next, add layers to the model one at a time. These layers could be dense (fully connected), Convolutional (for images), Recurrent (for time series), and more. After that, you compile the model, which configures the learning process. You choose the optimizer (that decides how the network will be updated based on the loss function), and the loss function (which measures the error of the network).

Finally, you fit the model to the data by defining the number of epochs (iterations over the entire dataset). Keras also offers advanced features such as callbacks––which are functions that can be applied at certain stages of the training process––and built-in capabilities for image and text data, which are handy for data preprocessing. Keras also supports multi-GPU and distributed training, and you can export your models for use in a web browser or a mobile phone.

Lakera LLM Security Playbook
Learn how to protect against the most common LLM vulnerabilities

Download this guide to delve into the most common LLM security risks and ways to mitigate them.

Related terms
untouchable mode.
Get started for free.

Lakera Guard protects your LLM applications from cybersecurity risks with a single line of code. Get started in minutes. Become stronger every day.

Join our Slack Community.

Several people are typing about AI/ML security. 
Come join us and 1000+ others in a chat that’s thoroughly SFW.