Giter Site home page Giter Site logo

debugging_nhl's Introduction

Debugging

Solution to the debugging tasks from NHL as a part of Computer Vision & Data Science intake.

link to the code: https://github.com/heesos/debugging_nhl/blob/main/debugging.ipynb

Task 1

The solution here was to change the fruits parameter to List type making all of the items in it ordered

def id_to_fruit(fruit_id: int, fruits: List[str]) -> str:

Task 2

First obvious bug was that there was a wrong column put in the swap line. I have changed the column 1 to 0

coords[:, 0], coords[:, 1], coords[:, 2], coords[:, 3] = coords[:, 1], coords[:, 0], coords[:,3],coords[:, 2]

This was not enough, because we kept assigning only Y value to the X. It did not work vice versa The solution to it was making the hard copy of the coordinates and fetching the data from the copy array.

copy=coords.copy()
coords[:, 0], coords[:, 1], coords[:, 2], coords[:, 3] = coords[:, 1], copy[:, 0], coords[:, 3], copy[:, 2]

Task 3

Values from csv were intially fetched as strings had to change them to floats

coords_array = np.array(results, dtype=float)

Task 4

The issue with 64 batches was because there are 60 000 MNIST pictures. 60 000/64 = 937.5 At the end we were left with 32 pictures rather than 64. real_samples were 32 while generated_samples were still 64 which gave 96 in total. The solution to this bug was to reassign the value of batch_size in for loop.

batch_size=real_samples.size()[0]

The visual bug: I believe it was the issue that epoch number was showing incorrectly in the plot.

 name = f"Generate images\n Epoch: {epoch + 1} Loss D.: {loss_discriminator:.2f} Loss G.: {loss_generator:.2f}"

debugging_nhl's People

Contributors

heesos avatar

Watchers

 avatar

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.