Transfer learning25,26 is a method where previously learned knowledge is applied to another task and the task domains may be different. In our case, the domain is very differ- ent. ImageNet consists of natural camera images and does not include any type of lung nodule or cancer image. Our image set consists of only lung nodules in CT images. We experimented with three different pretrained CNN’s [vgg (visual geometry group)-m/vgg-f/vgg-s]27 in this study using a MA TLAB toolbox named MA TCONVNET.28 The f, m, and s after vgg- stand for fast, medium, and slow and refer to training time (so partly the number of weights). We obtained deep features from the outputs of the last fully connected layer after applying the activation function using a rectified linear unit (post-ReLU), which changes all values <0 to be 0. The LDCT images were grayscale (no color component and we changed the voxel intensities of LDCT images to 0-255 or 8 bit), but the pretrained network was trained on RGB images, so we normalized the images by the average red, green, and blue channel images, and exper- imented by using each channel separately. 解释
时间: 2024-02-14 10:03:52 浏览: 140
Transfer learning是一种方法,其中先前学习的知识被应用于另一个任务,任务域可能不同。在我们的情况下,领域非常不同。ImageNet由自然相机图像组成,不包括任何类型的肺结节或癌症图像。我们的图像集仅包含CT图像中的肺结节。在本研究中,我们使用名为MATCONVNET的MATLAB工具箱尝试了三种不同的预训练CNN(vgg(visual geometry group)-m / vgg-f / vgg-s)进行实验。vgg之后的f,m和s代表快速,中等和慢,并且指的是训练时间(因此部分权重的数量)。我们从应用激活函数后的最后一个完全连接层的输出中获得深层特征,使用修正线性单元(post-ReLU)对所有值<0进行更改以使其为0。LDCT图像是灰度的(没有彩色分量),我们将LDCT图像的体素强度更改为0-255或8位,但预训练网络是在RGB图像上训练的,因此我们通过平均红色,绿色和蓝色通道图像对图像进行归一化,并尝试分别使用每个通道。
相关问题
You have a lock with an integer array a of length n written on it. The numbers in the array can be repeated. The lock opens only when the array is sorted in non-decreasing order. To change the state of the array there is only operation available which uses a permutation p of numbers from 1 to n. When this operation is applied the elements of the array change positions according to this permutation, meaning the number ai moves from position i to position Pi for each i.In the beginning the array on the lock was sorted in non-decreasing order but then this operation was applied to it once. Your goal is to unlock the lock again but there's a trick: you can independently restore any position of the array to the value that was on this position before. In general, you can do the following: 1. First, you record the current state of the array. 2. Then you apply the operation to the array moving its elements according to the permutation p. 3. If for every i there exists a previously recorded state in which a equals to the initial value of ai, you stop, otherwise you repeat the first two steps. How many iterations of this algorithm will be performed until you'll be able to restore the initial values? Notice that you strictly follow the algorithm, for example if the array is already sorted in non-decreasing order you stil perform one iteration before you stop.给出中文解释和c++代码
问题要求计算执行算法的迭代次数,直到能够恢复初始值。我们可以使用深度优先搜索(DFS)来解决这个问题。
中文解释:
1. 首先,我们创建一个数组`visited`,用于记录已经访问过的状态。
2. 然后,我们定义一个辅助函数`dfs`来执行深度优先搜索。这个函数有四个参数:当前状态`state`,初始状态`initial_state`,数组`a`和数组长度`n`。
3. 在`dfs`函数中,我们首先将当前状态添加到已访问集合中,并递归地遍历每个位置i。
4. 对于每个位置i,我们检查是否存在之前记录的状态,使得a等于初始状态的ai。如果存在,则继续递归地执行`dfs`函数。
5. 如果遍历完所有位置i后仍然没有找到满足条件的状态,则返回false。
6. 在主函数中,我们首先记录初始状态,然后调用`dfs`函数进行深度优先搜索,并返回迭代次数。
下面是对应的C++代码实现:
```cpp
#include <iostream>
#include <vector>
int iterations = 0;
bool dfs(std::vector<int>& state, std::vector<int>& initial_state, std::vector<int>& a, int n) {
if (state == initial_state) {
return true;
}
if (iterations > n) {
return false;
}
iterations++;
for (int i = 0; i < n; i++) {
if (state[i] != a[i] && state[a[i] - 1] == a[i]) {
std::swap(state[i], state[a[i] - 1]);
if (dfs(state, initial_state, a, n)) {
return true;
}
std::swap(state[i], state[a[i] - 1]);
}
}
return false;
}
int main() {
int n;
std::cin >> n;
std::vector<int> a(n);
for (int i = 0; i < n; i++) {
std::cin >> a[i];
}
std::vector<int> state(a);
std::vector<int> initial_state(a);
iterations = 0;
dfs(state, initial_state, a, n);
std::cout << iterations << std::endl;
return 0;
}
```
请注意,这只是一个基本的实现示例,并未进行错误处理和输入验证。在实际应用中,您可能需要根据实际情况进行更多的输入检查和错误处理。
An Executor that provides methods to manage termination and methods that can produce a Future for tracking progress of one or more asynchronous tasks. An ExecutorService can be shut down, which will cause it to reject new tasks. Two different methods are provided for shutting down an ExecutorService. The shutdown method will allow previously submitted tasks to execute before terminating, while the shutdownNow method prevents waiting tasks from starting and attempts to stop currently executing tasks. Upon termination, an executor has no tasks actively executing, no tasks awaiting execution, and no new tasks can be submitted. An unused ExecutorService should be shut down to allow reclamation of its resources. Method submit extends base method Executor.execute(Runnable) by creating and returning a Future that can be used to cancel execution and/or wait for completion. Methods invokeAny and invokeAll perform the most commonly useful forms of bulk execution, executing a collection of tasks and then waiting for at least one, or all, to complete. (Class ExecutorCompletionService can be used to write customized variants of these methods.) The Executors class provides factory methods for the executor services provided in this package. Usage Examples Here is a sketch of a network service in which threads in a thread pool service incoming requests. It uses the preconfigured Executors.newFixedThreadPool factory method:
An ExecutorService is an Executor that provides additional methods for managing termination and tracking the progress of asynchronous tasks. It extends the base Executor interface and adds functionalities such as task submission, task cancellation, and waiting for task completion.
An ExecutorService can be shut down, which means it will stop accepting new tasks and initiate the process of terminating existing tasks. There are two methods provided for shutting down an ExecutorService:
1. `shutdown()`: This method allows previously submitted tasks to complete execution before terminating the ExecutorService. It will not interrupt already running tasks, but it will prevent new tasks from being accepted.
2. `shutdownNow()`: This method attempts to stop all actively executing tasks and prevents waiting tasks from starting. It interrupts the running tasks and may forcibly terminate them.
Once an ExecutorService is shut down, it reaches a terminated state where no tasks are actively executing, no tasks are awaiting execution, and no new tasks can be submitted. It is recommended to shut down an unused ExecutorService to release its resources.
The `submit()` method is an extended version of the base `execute(Runnable)` method in the Executor interface. It submits a task for execution and returns a Future object that can be used to track the progress of the task, cancel its execution, or wait for its completion.
The `invokeAny()` and `invokeAll()` methods are higher-level methods that execute a collection of tasks and wait for their completion. `invokeAny()` waits for at least one task to complete and returns the result of the first completed task. `invokeAll()` waits for all tasks to complete and returns a list of Future objects representing the results of all tasks.
The Executors class provides factory methods for creating different types of ExecutorService instances. For example, `Executors.newFixedThreadPool()` creates a thread pool with a fixed number of threads.
Here's an example usage of an ExecutorService with a fixed thread pool:
```java
ExecutorService executor = Executors.newFixedThreadPool(5);
// Submit tasks for execution
executor.submit(new Task1());
executor.submit(new Task2());
// Shut down the executor when no longer needed
executor.shutdown();
```
In this example, a fixed thread pool with 5 threads is created using the `newFixedThreadPool()` method. Two tasks, `Task1` and `Task2`, are submitted for execution using the `submit()` method. Finally, the executor is shut down using the `shutdown()` method.
阅读全文