Giter Club home page Giter Club logo

deepsymreg's People

Contributors

samuelkim314 avatar wongsihan 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

deepsymreg's Issues

How solve ''TypeError: Invalid NaN comparison'' error?

Hello,
First of all, thanks so much for your helpful algorithms,
some times I run the algorithm it works fine, but some times I get TypeError: Invalid NaN comparison

I want to know how can I solve this problem?
I attach the error pic

is

Thanks in advance,

minimal example

Hello,

I tried to use the minimal example. It seems it's not working.
First, I received "x_dim" not defined. After I fixed this issue by assigning 100 for x_dim, I received "y" is not defined. So, I moved them to the top of the code. I still receive some errors. Now the error is:

__init__() missing 1 required positional argument: 'learning_rate'

the code is:

import numpy as np
import tensorflow as tf
from utils import functions, pretty_print
from utils.symbolic_network import SymbolicNetL0
from utils.regularization import l12_smooth


funcs = functions.default_func
x_dim = 100
x = np.random.rand(100, 1)
y = x ** 2

# Set up TensorFlow graph for the EQL network
x_placeholder = tf.placeholder(shape=(None, x_dim), dtype=tf.float32)
sym = SymbolicNetL0(symbolic_depth=2, funcs=funcs)
y_hat = sym(x_placeholder)

# Set up loss function with L0.5 loss
mse = tf.losses.mean_squared_error(labels=y, predictions=y_hat)
loss = mse + 1e-2 * l12_smooth(sym.get_weights())

# Set up TensorFlow graph for training
opt = tf.train.RMSPropOptimizer()
train = opt.minimize(loss)

# Random data for a simple function
x = np.random.rand(100, 1)
y = x ** 2

# Training
with tf.Session as sess:
  sess.run(tf.global_variables_initializer())
  for i in range(1000):
    sess.run(train, feed_dict={x_placeholder: x})

  # Print out the expression
  weights = sess.run(sym.get_weights())
  expr = pretty_print.network(weights, funcs, ['x'])
  print(expr)

Is the minimal example working?

Can EQL have multiple outputs?

For example, change

# Initialize weights for last layer (without activation functions)
self.output_weight = tf.Variable(tf.random_uniform(shape=(self.symbolic_layers[-1].n_funcs, 1)))

in symbolic_network.py line 280-281
to

# Initialize weights for last layer (without activation functions)
self.output_weight = tf.Variable(tf.random_uniform(shape=(self.symbolic_layers[-1].n_funcs, 4)))

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.