Comments (6)
Updated code successfully tested with python 3.6.3, Keras 2.0.8, TF 1.3.0. There were enough required changes to the model_train.py though that I think it makes sense to have a separate python script for it. Or maybe should there should still just be one python file and a variable that allows you to choose to build a keras v2 compatible model or keras v1 compatible model. What do you think @cczhu ? The downside of having two separate python scripts is that any future changes to non-model functions will have to be changed in two files vs. one...
from deepmoon.
Agreed that having two files that do almost the same thing is pretty clunky. I tried to streamline it into one file, and created some tests to go along with it. Please see pull request #11.
I did check that model.summary()
looks the same in either Keras 1 or 2 using your code and my pull request, but didn't check if the entire script runs properly or not. Would you be able to check that? Also, it would be great if we could check something basic, like if you throw in a fake training set of ten 256x256 images compsed of all 1s or something and set the Keras seed to a fixed value, then you get exactly the same output in your code and mine. That kind of test could then go in the new test_model_train.py
file.
from deepmoon.
Re: simple model test - I'm not sure if python guarantees that np.seed(42) is the same thing on your machine and mine. I know Hanno had to make internal functions for rebound to ensure that. Also, such a test might be testing more Keras stuff vs. DeepMoon stuff, i.e. input_data -> black_box -> output_data -> see if output_data matches on two machines. What if they don't match, what would that indicate? That something in Keras is broken? I guess that would be good to know.... I'm just not sure if there's anything we could do to fix it other than submit an issue with Keras. I'll think on that test.
Your compatibility solution looks really good! Thanks for taking the time to do that. Yes, I'll definitely check that your new streamlined code works and fix any minor bugs should they come up.
from deepmoon.
(This is a repeat of my e-mail to you; apologies for the duplication!)
I wasn't suggesting that we test Keras's internal functionality, but rather that we ensure that any future modifications we make doesn't mess with the CNN structure. Right now the tests I implemented just use the total number of trainable/non-trainable parameters as a kind of checksum, but ideally we'd be able to take all the information you get by doing model.get_config()
and check things layer by layer. I fiddled with Keras a bit and unless we hack the backend its only possible to get the configuration printed to screen.
(Maybe I should submit a PR to Francois so that get_config has the option of printing to string, or to dict? :) )
If you can think of any additional tests to ensure that the model is doing predictable things, I think we should implement them. I agree that np.seed()
is probably a bad idea, but what about keras.initializers.Ones()
to set everything to 1?
from deepmoon.
Confirmed that @cczhu compatibility solution runs perfectly fine on python 3.6.3, Keras 2.0.8, TF 1.3.0., and also separately works on Python 2.7.12, keras 1.2.2., tensorflow 0.10.0rc0.
We can keep this issue open until we figure out a model unit test.
from deepmoon.
Great, thanks @silburt !
from deepmoon.
Related Issues (15)
- bug somewhere in get_unique_craters.py HOT 3
- uploading datasets HOT 5
- Possible CNN tests following `mltest`
- Please mention the Projection of DEM image HOT 3
- Can you provide Mercury DEM images? HOT 4
- Do you encounter a situation in which the loss is equal to βNanβ during operation?
- About "USGS Astrogeology Cloud Processing service"
- Data Leakage
- I encountered a format type problem
- During data preprocessing, please run minn, maxx = np.min(img[img > 0]), np.max(img[img > 0]) ValueError: zero-size array to reduction operation minimum which has no identity
- Can anyone help to explain the function estimate_longlatdiamkm
- Unit tests need to be revised, and created for `model_training.py` and `get_unique_craters.py` HOT 2
- Improved latitude distortion compensation needs to be added to `get_unique_craters.py` HOT 2
- `pytest test_get_unique_craters.py` returns no detections in (my environment for) Python 3 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepmoon.