Giter Site home page Giter Site logo

fbuchert / fixmatch-pytorch Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 1.0 52 KB

PyTorch implementation of FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence

License: MIT License

Python 100.00%
computer-vision deep-learning image-classification machine-learning semi-supervised-learning

fixmatch-pytorch's People

Contributors

fbuchert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

fixmatch-pytorch's Issues

Model Input

Hello,

First off, great work. I have been looking through your code to get ideas on how to implement something similar for a project of mine. I have a question about the last layer of the model and training though.

Do I understand correctly, that the inputs (weak, u_weak, u_strong) are concatenated in the batch dimension, meaning the model input is now [B x 3, C, H, W], and the output also [B x 3, ...] ? There are no other "special" modification to the model itself to produce the correct output?

Best Regards,
L

`    logits = model(inputs)
    logits_x = logits[:len(x_weak)]
    logits_u_weak, logits_u_strong = logits[len(x_weak):].chunk(2)
    del inputs
labeled_loss = F.cross_entropy(logits_x, labels, reduction="mean")

  with torch.no_grad():
      pseudo_labels = torch.softmax(logits_u_weak, dim=1)
      max_probs, targets_u = torch.max(pseudo_labels, dim=1)
      mask = max_probs.ge(args.threshold).float()`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.