OxWearables / ssl-wearables

Self-supervised learning for wearables using the UK-Biobank (>700,000 person-days)
https://oxwearables.github.io/ssl-wearables/
Other
104 stars 24 forks source link

What is the context about the example of pre-trained model usage? #10

Closed ValerianRey closed 1 year ago

ValerianRey commented 1 year ago

Hi! First of all, thanks for this high quality and open research!

I ran the usage example shown in the README.md:

import torch
import numpy as np

repo = 'OxWearables/ssl-wearables'
harnet5 = torch.hub.load(repo, 'harnet5', class_num=5, pretrained=True)
x = np.random.rand(1, 3, 150)
x = torch.FloatTensor(x)
harnet5(x)

harnet10 = torch.hub.load(repo, 'harnet10', class_num=5, pretrained=True)
x = np.random.rand(1, 3, 300)
x = torch.FloatTensor(x)
harnet10(x)

harnet30 = torch.hub.load(repo, 'harnet30', class_num=5, pretrained=True)
x = np.random.rand(1, 3, 900)
x = torch.FloatTensor(x)
harnet30(x)

I have trouble understanding exactly what the harnet models are. I understand that they are instances of sslearning.models.accNet.Resnet, and my understanding is the following:

Is my understanding correct? Also, would it be possible to write this information next to the usage example?

Thanks a lot in advance :)

angerhang commented 1 year ago

@ValerianRey

Thanks for the query. Appreciate your interest in our work.

Your understanding is correct:

We are very busy with a few upcoming deadlines right now. If you wish to make a pull request, very happy to take a look and merge it in :D

ValerianRey commented 1 year ago

Thanks for your answer! I made a PR. Hopefully my explanation is accurate enough!