tailintalent / ai_physicist Goto Github PK
View Code? Open in Web Editor NEWAI Physicist, a paradigm with algorithms for learning theories from data, by Wu and Tegmark (2019)
License: MIT License
AI Physicist, a paradigm with algorithms for learning theories from data, by Wu and Tegmark (2019)
License: MIT License
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.
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'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.