Giter Club home page Giter Club logo

ai_physicist's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar

ai_physicist's Issues

ModuleAttributeError: 'MLP' object has no attribute 'DL'

Hi, I tried running theory_exp.py . I get the following error when trying to to collapse the net to symbolic expression. It will be great help if you can help me resolve it.

Thank you,
Vishy.

================================================
Simplifying mode: to_symbolic for model_0

original_loss: 0.0010860880138352513
{'loss': 0.00270480802282691, 'DL': 2413.6943754734334, 'model_DL': 206.7324614109332, 'data_DL': 2206.9619140625}

ModuleAttributeError Traceback (most recent call last)
in
359
360 # To symbolic:
--> 361 loss_record = T.pred_nets.simplify(X_train, y_train, valid_onehot, "to_symbolic", simplify_criteria = simplify_criteria, validation_data = validation_pred_nets, is_Lagrangian = is_Lagrangian)
362 T.pred_nets.get_sympy_expression()
363 record_data(info_dict_single["data_record_simplification-model"], [T.get_losses(X_test, y_test, **kwargs), loss_record, T.pred_nets.model_dict, "after_to_symbolic_and_snapping"], ["all_losses_dict", "loss_record", "pred_nets_model_dict", "event"])

~\AI_physicist\pytorch_net\net.py in simplify(self, X, y, idx, mode, validation_data, isplot, **kwargs)
2548 print("The {0}'th model has no corresponding data to simplify with, skip.".format(i))
2549 else:
-> 2550 new_model, loss_dict["model_{0}".format(i)] = simplify(model, X_chosen, y_chosen, mode = mode, validation_data = validation_data_chosen, isplot = isplot, target_name = "model_{0}".format(i), **kwargs)
2551 setattr(self, "model_{0}".format(i), new_model)
2552 return loss_dict

~\AI_physicist\pytorch_net\net.py in simplify(model, X, y, mode, isplot, target_name, validation_data, **kwargs)
1317 # Calculate the loss again:
1318 if X is not None:
-> 1319 criteria_new, criteria_result_new = get_criteria_value(model, X, y, criteria_type = simplify_criteria[0], criterion = criterion, **kwargs)
1320 if verbose >= 1:
1321 print("Prev_loss: {0}, new loss: {1}\tprev_DL: {2:.9f}, new DL: {3:.9f}".format(

~\AI_physicist\pytorch_net\util.py in get_criteria_value(model, X, y, criteria_type, criterion, **kwargs)
412 if not isinstance(model, list):
413 model = [model]
--> 414 model_DL = np.sum([model_ele.DL for model_ele in model])
415 DL = data_DL + model_DL
416 result["DL"] = DL

~\AI_physicist\pytorch_net\util.py in (.0)
412 if not isinstance(model, list):
413 model = [model]
--> 414 model_DL = np.sum([model_ele.DL for model_ele in model])
415 DL = data_DL + model_DL
416 result["DL"] = DL

c:\users\vkswa\appdata\local\programs\python\python38\lib\site-packages\torch\nn\modules\module.py in getattr(self, name)
776 if name in modules:
777 return modules[name]
--> 778 raise ModuleAttributeError("'{}' object has no attribute '{}'".format(
779 type(self).name, name))
780

ModuleAttributeError: 'MLP' object has no attribute 'DL'

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.