Skip to content

Setting up a UNet model#46

Merged
jemrobinson merged 16 commits intomainfrom
43-add-unet
Aug 7, 2025
Merged

Setting up a UNet model#46
jemrobinson merged 16 commits intomainfrom
43-add-unet

Conversation

@IFenton
Copy link
Copy Markdown
Contributor

@IFenton IFenton commented Aug 1, 2025

Closes #43

Co-authored-by: Maria Novitasari <mnovitasari@turing.ac.uk>
Co-authored-by: Louisa van Zeeland <louisa-ai2@protonmail.com>
Co-authored-by: James Robinson <james.em.robinson@gmail.com>
@IFenton IFenton changed the title Initial commit for setting up a UNet model Setting up a UNet model Aug 1, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Aug 1, 2025

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  ice_station_zebra/models/processors
  __init__.py 1-4
  unet.py 1-82
Project Total  

This report was generated by python-coverage-comment-action

Comment thread ice_station_zebra/models/processors/unet.py Outdated
Comment thread ice_station_zebra/models/processors/unet.py Outdated
Comment thread ice_station_zebra/models/processors/unet.py Outdated
Comment thread ice_station_zebra/training/cli.py Outdated
Comment thread ice_station_zebra/training/cli.py Outdated
Copy link
Copy Markdown
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

This is broadly OK, but needs some tidying up. Can you take care of this @IFenton ?

@IFenton
Copy link
Copy Markdown
Contributor Author

IFenton commented Aug 4, 2025

This is broadly OK, but needs some tidying up. Can you take care of this @IFenton ?

Thanks for the comments - I'm working on this.

I've also been thinking about adding some basic tests for the models, but maybe that should be a separate PR? What do you think @jemrobinson?

@jemrobinson
Copy link
Copy Markdown
Member

Always good to add tests, but don't let perfect be the enemy of good. Let's try to merge PRs once they're good enough.

IFenton and others added 4 commits August 4, 2025 12:45
Co-authored-by: James Robinson <james.em.robinson@gmail.com>
Co-authored-by: James Robinson <james.em.robinson@gmail.com>
Co-authored-by: James Robinson <james.em.robinson@gmail.com>
Co-authored-by: James Robinson <james.em.robinson@gmail.com>
@IFenton IFenton requested a review from jemrobinson August 4, 2025 15:32
Comment thread ice_station_zebra/models/processors/unet.py Outdated
Comment thread ice_station_zebra/models/processors/unet.py Outdated

start_out_channels = 64

reduced_channels = int(start_out_channels * n_filters_factor)
Copy link
Copy Markdown
Member

@jemrobinson jemrobinson Aug 4, 2025

Choose a reason for hiding this comment

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

Wouldn't it be easier to make reduced_channels an argument rather than having n_filters_factor as an argument that we multiply by 64?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's actually neatest to just let people set the start_out_channels argument in the config file, then there is no need for the n_filters_factor or the reduced_channels

Comment thread ice_station_zebra/models/processors/unet.py
Comment thread ice_station_zebra/models/processors/unet.py Outdated
Copy link
Copy Markdown
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

A couple of minor fixes, plus some thoughts about code structure.

IFenton and others added 2 commits August 6, 2025 10:10
Co-authored-by: James Robinson <james.em.robinson@gmail.com>
import torch.nn as nn
from torch import Tensor
import torch
import torch.nn.functional as F
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.

I think we don't use this anymore

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Which 'this'? I think we do need to import those four things

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.

Sorry, I was trying to point to import torch.nn.functional as F

@IFenton IFenton requested a review from jemrobinson August 7, 2025 12:00
Comment thread ice_station_zebra/models/processors/unet.py
Comment thread ice_station_zebra/models/processors/unet.py Outdated
Comment thread ice_station_zebra/models/processors/unet.py Outdated
Copy link
Copy Markdown
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

LGTM

@jemrobinson jemrobinson merged commit f3e7616 into main Aug 7, 2025
3 checks passed
@jemrobinson jemrobinson deleted the 43-add-unet branch August 7, 2025 13:20
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.

Implement a UNet model inside the pipeline

2 participants