GithubHelp home page GithubHelp logo

muxamilian / duralava Goto Github PK

View Code? Open in Web Editor NEW
90.0 90.0 6.0 1.05 GB

duralava is a neural network which can simulate a lava lamp in an infinite loop.

Home Page: https://news.ycombinator.com/item?id=30222243

deep-learning gan machine-learning neural-network physics-simulation rnn

duralava's People

Contributors

muxamilian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

duralava's Issues

Images with different input shape

When changing img_size = 64 to count for images with different width and height i.e., also changing the process_img to:

def process_img(file_path, img_w, img_h):
  img = tf.io.read_file(file_path)
  img = tf.image.decode_jpeg(img, channels=3)
  img = tf.image.convert_image_dtype(img, tf.float32)
  img = tf.image.resize(img, size=(img_h, img_w), method='area')
  img = tf.image.convert_image_dtype(img, tf.uint8)
  return img

and the definition of the discriminator to:

def make_discriminator_model():
  disc = tf.keras.Sequential(
    [
      layers.Input(shape=(img_h, img_w, 3)),
...

and line 391 to: all_images.append(process_img(item, img_w, img_h))

The training crashes after the first epoch with: ValueError: Cannot reshape a tensor with 49152 elements to shape [32,128] (4096 elements) for '{{node Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32](discriminator/flatten/Reshape, Reshape/shape)' with input shapes: [32,1536], [2] and with input tensors computed as partial shapes: input[1] = [32,128].

Apparently, there is a problem here: real_first_output = tf.reshape(self.discriminator(images[i,...], training=True), (batch_size, disc_dim)). Somehow, the discriminator is not outputting correct dimension for reshaping. I have doubts that something is wrong with disc_dim but couldn't solve it.

I am using:

img_w = 256
img_h = 144

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.