|
11 | 11 |
|
12 | 12 | class NormLIMECVInterpreter(LIMECVInterpreter): |
13 | 13 | """ |
14 | | - NormLIME Interpreter for CV tasks. |
| 14 | + NormLIME Interpreter for CV tasks. |
| 15 | +
|
| 16 | + (TODO) Some technical details will be complete soon. |
15 | 17 |
|
16 | 18 | More details regarding the NormLIME method can be found in the original paper: |
17 | | - https://arxiv.org/abs/1909.04200 |
| 19 | + https://arxiv.org/abs/1909.04200. |
| 20 | +
|
| 21 | + Args: |
| 22 | + paddle_model (_type_): |
| 23 | + A user-defined function that gives access to model predictions. |
| 24 | + It takes the following arguments: |
| 25 | + - data: Data inputs. |
| 26 | + and outputs predictions. |
| 27 | + device (str, optional): The device used for running `paddle_model`, options: ``cpu``, ``gpu:0``, ``gpu:1`` etc. |
| 28 | + use_cuda (_type_, optional): Would be deprecated soon. Use ``device`` directly. |
18 | 29 | """ |
19 | 30 |
|
20 | 31 | def __init__(self, paddle_model, device='gpu:0', use_cuda=None): |
21 | | - """ |
22 | | - |
23 | | - Args: |
24 | | - paddle_model (_type_): |
25 | | - A user-defined function that gives access to model predictions. |
26 | | - It takes the following arguments: |
27 | | - - data: Data inputs. |
28 | | - and outputs predictions. |
29 | | - device (str, optional): The device used for running `paddle_model`, options: ``cpu``, ``gpu:0``, ``gpu:1`` etc. |
30 | | - use_cuda (_type_, optional): Would be deprecated soon. Use ``device`` directly. |
31 | | - """ |
32 | 32 |
|
33 | 33 | LIMECVInterpreter.__init__(self, paddle_model, use_cuda=use_cuda, device=device) |
34 | 34 | self.lime_interpret = super().interpret |
@@ -58,6 +58,8 @@ def interpret(self, |
58 | 58 | """ |
59 | 59 | Main function of the interpreter. |
60 | 60 |
|
| 61 | + (TODO) Some technical details will be complete soon. |
| 62 | +
|
61 | 63 | Args: |
62 | 64 | image_paths (list of strs): A list of image filepaths. |
63 | 65 | num_samples (int, optional): LIME sampling numbers. Larger number of samples usually gives more |
@@ -182,20 +184,18 @@ class NormLIMENLPInterpreter(LIMENLPInterpreter): |
182 | 184 | NormLIME Interpreter for NLP tasks. |
183 | 185 |
|
184 | 186 | More details regarding the NormLIME method can be found in the original paper: |
185 | | - https://arxiv.org/abs/1909.04200 |
186 | | - """ |
| 187 | + https://arxiv.org/abs/1909.04200. |
187 | 188 |
|
188 | | - def __init__(self, paddle_model: callable, device: str = 'gpu:0', use_cuda=None): |
189 | | - """ |
| 189 | + Args: |
| 190 | + paddle_model (callable): A user-defined function that gives access to model predictions. |
| 191 | + It takes the following arguments: |
190 | 192 |
|
191 | | - Args: |
192 | | - paddle_model (callable): A user-defined function that gives access to model predictions. |
193 | | - It takes the following arguments: |
| 193 | + - data: Data inputs. |
| 194 | + and outputs predictions. See the example at the end of ``interpret()``. |
| 195 | + device (str): The device used for running `paddle_model`, options: ``cpu``, ``gpu:0``, ``gpu:1`` etc. |
| 196 | + """ |
194 | 197 |
|
195 | | - - data: Data inputs. |
196 | | - and outputs predictions. See the example at the end of ``interpret()``. |
197 | | - device (str): The device used for running `paddle_model`, options: ``cpu``, ``gpu:0``, ``gpu:1`` etc. |
198 | | - """ |
| 198 | + def __init__(self, paddle_model: callable, device: str = 'gpu:0', use_cuda=None): |
199 | 199 | LIMENLPInterpreter.__init__(self, paddle_model, device, use_cuda) |
200 | 200 | self.lime_interpret = super().interpret |
201 | 201 |
|
|
0 commit comments