Skip to content

clarify TASK docs#550

Merged
martinjaggi merged 1 commit intodevelopfrom
update-task-doc
Dec 3, 2022
Merged

clarify TASK docs#550
martinjaggi merged 1 commit intodevelopfrom
update-task-doc

Conversation

@morganridel
Copy link
Copy Markdown
Collaborator

I clarified some part of the tasks docs to better reflect the task workflow after the refactoring (TaskProvider interface which wraps Task and tf.LayersModel).

I also tried to remove some duplicated information and fix broken links.

Copy link
Copy Markdown
Member

@martinjaggi martinjaggi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks a lot, this is super helpful. i just added some minor comments above from the perspective of a naive user :)

loss: 'categoricalCrossentropy',
metrics: ['accuracy']
},
modelID: 'my_new_task-model',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a bit confused why there are two tasks here, simple-face and my_new_task?

In this case, your model and task will be uploaded and stored on our DISCO servers. You will have to make the task visible to the API. For your custom model, the JSON model architecture is necessary, but the .bin weight file is optional : if you include the weights file, your model will be loaded with the passed weights. If a weights file is not specified, the weights for the model will be initialized randomly.
If you want to add a new task to our production DISCO server you have two possibilities:
* using the user interface as described above
* exporting your own `TaskProvider` from `discojs/discojs-core/src/default_tasks/` and adding a new default task by contributing to the code.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe say first one is without any coding required, second one is with describing the ML task in your own code

export { titanic } from './titanic'
export { simpleFace } from './simple_face'
export { myNewTask } as my_new_task from './my_new_task' // <---- including our new custom task!
export { geotags } from './geotags'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or new one last?


### Making the task visible to the API
> Note that `discojs-core` must only contain platform-agnostic code that works both in the browser and on Node.js.
> Thus, if your task requires reading some file from your local file system, you need to define the task in `discojs-node` only: `discojs/discojs-node/src/default_tasks/my_new_task.ts`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you comment on the easiest case first, where is the model usually read from (and mention can be initial model, or pre-trained model)


> Note, it's important to add the `export` tag to the model as well as to the subsequent objects that we define.
The interface let you load your model however you want, as long as you return a `tf.LayersModel` at the end. If you use a
pre-trained model, you can simply load and return said model in the function via `tf.loadLayersModel(modelPath)`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same comment as above, is the default recommendation some URL, or file-system access on the phone, or server?)

.set(defaultTasks.simple_face.task.taskID, simpleFaceModelPath)

```
At runtime, the models are stored in `disco/server/models/`, and it is also in the server side that we let disco know where exactly they are saved. In particular,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean the initial models for each task, or even the freshly trained ones? (i guess it's true for FL but not for decentralized?)

@martinjaggi martinjaggi merged commit 25f51f0 into develop Dec 3, 2022
@martinjaggi martinjaggi deleted the update-task-doc branch December 3, 2022 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants