Course: Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and…
Week 1
Weekly Assignment: Your First Neural Network
Exercise 1: create_training_data
Your first task is to create the data that your model will be trained on. Use the scenario presented at the top of this notebook where a 1-bedroom house costs 100k, and increases by 50k for each additional bedroom.
To generate the training data (aka the features and the targets), you will use numpy to create a one-dimensional tensor with the number of bedrooms and another one-dimensional tensor with the corresponding price in hundreds of thousands of dollars (e.g. 1.0 means 100k). In this case, the number of bedrooms will be the features, which the network will try to map to the target of the prices. These tensors (or numpy arrays) should have six elements which will be the values (number of bedrooms and price in hundreds of thousands) for houses with 1 up to 6 bedrooms.
As part of solution, I have defined the numpy array as following:
n_bedrooms = code solutions removed as it is direct violation of code of conduct
price_in_hundreds_of_thousands = code solutions removed
But I am getting the following error:
Failed test case: incorrect values for price_in_hundreds_of_thousands tensor.
Expected: a numpy array with values of the prices for houses with 1 up to 6 bedrooms
Got: [150000. 200000. 250000. 300000. 350000. 400000.]
Can someone please guide.