# Transfer Learning

## What is Transfer Learning?

Transfer learning is an approach used to transfer information from one machine learning task to another. Practically speaking, a pre-trained model that was trained for one task is re-purposed as the starting point for a new task.  As a result, great amounts of time and resources can be saved by transfer learning.

Creating complex models from scratch requires vast amounts of compute resources, data, and time.  Transfer learning accelerates the process by leveraging commonalities between tasks (such as detecting edges in images) and applying those learning to a new task.  Training time for a model can go from weeks to hours, making machine learning more commercially viable for many businesses.

![Source: Drivers of ML industrial success by Andrew Ng, 2016 NIPS](/files/-LvQyCF90QZxcaY5Jm0B)

Transfer learning is very popular in domains like computer vision and NLP where large amounts of data are needed to produce accurate models.&#x20;

### An Example

Let's say we have merely 1,000 images of an object we want to classify.  If we take a pre-trained CNN such as ResNet-50 which was trained on millions of images, we can re-train the model on our small dataset and build a state-of-the-art model with minimal effort.  In neural networks, this is achieved by removing the final layer in the existing model (called the "loss output" layer) and replacing it with a new layer for the intended prediction. &#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://machine-learning.paperspace.com/wiki/transfer-learning.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
