Hacker News new | past | comments | ask | show | jobs | submit login

I get that this was just a toy, but naturally I wanted to think through how to make it useful. Like imagining building a real car from lego.

I know very little about machine learning or cooking or chemistry in general. How would one make this actually useful and interesting?

My guess is you would need to provide a lot more context to the database. Things like chemical composition seem like the most fundamental component of recipes.

Backwards planning from the composition, you could teach it actions that generate those chemicals such as methods of cooking, and the source foods that provide the building blocks i.e. ingredients.

Then at some point you could link it back to the recipes to create standardized instructions for generating certain chemical patterns.

Does that sound like the right way to make this more realistic?




Related I worked on a real project that used a database of recipes and nutritional information to build varied meal plans to meet certain dietary requirements and goals.

We used a linear solver and added a lot heuristics e.g. what time of day certain recipes were 'acceptible' suggestions. We also needed a lot variants e.g. proportions to meet kJ targets.


That's not how neural networks er work. This one is trained to predict the next character in a sequence. It's trained on raw, unstructured text, not high-level concepts like "chemical composition" or "actions that generate chemicals" etc. Its inputs are character sequences and its outputs are character sequences. There is no way to "provide context to the database" (there is no database, just character sequences) or anything like that. If any relations like that are useful to its task of predicting the next character then your best hope is that it will somehow magickally learn them from its input text. Otherwise, the knowlede of how cooking works will simply not be encoded in its trained model.


I don't know enough about machine learning to specify which neural network type is correct for a given use case or which algorithm gets the most relevant results, but I do know enough to use them for things once an engineer hands me the tool.

I'm not talking about how this specific network is trained. I'm talking about how this toy could be perhaps turned into something useful, like my original analogy to building a car out of lego.

I understand enough about neural networks to know they are useful as Boolean supersets. It's all about how the training is defined with your training data containing the Boolean true/false values.

So what I'm saying is, in order to provide context and make this toy useful, you could change your Boolean choices from sequence-based letter chains to something with a little more value like popular chemical combinations.

To go further, consider how a restaurant picks its menu. That is a simple Boolean statement of "accept" or "reject". So how do you work backwards from there? Right now you require a combination of a head chef that has years of experience (your database) and an owner that has a vision.

Don't miss the forest for the trees!


>> Don't miss the forest for the trees!

I'm sorry, I think you took my comment in the wrong way. I didn't mean it as some kind of put down. I wished to explain how this kind of thing works.

In the same spirit, of a friendly sharing of knowledge, I would also now explain that what you are proposing, "buildig a car out of lego", or in general assembling structure out of modular components, is not what neural nets do best. Neural nets are best at mapping between sets of objects. Typically, one set represents some entities we are interested to categorise and the other set represents the categories to which we want to assign the entities in the first set. To "build a car out of lego" you would need a different type of AI, like a program synthesis algorithm, or an Inductive Programming algorithm (machine learning algorithms that learn programs from examples; and which I study). In such a setting, your "lego" would be functions or sub-programs and your "car" would be a program created by combinations of the given sub-programs.

Also, neural nets, especially more modern ones of the "deep learning" variety are not limited to boolean features ("data containing Boolean true/false values") and can instead be trained on arbitrary real-valued data. What is often done when training language models is to encode training data in a "one-hot encoding" manner, in which the "features" are very long boolean vectors, with one element for each word or character in the raw text and with a "0" representing "no occurrence" and a "1" "occurrence", of a particular character or word. This is not the case for other types of data, e.g. in machine vision the feature values are raw pixel data, in time series regression they're arbitrary precision real numbers etc.

I confess that I'm not sure how the data looks for neural nets trained to predict chemical structures. It's possible they're one-hot encoded vectors, like for text.

No doubt you can train a neural net classifier to make yes/no decisions about possible items on a menu, but my guess is that a system of this kind would look at customer preferences primarily, rather than the chemical composition of food items. After all, the chemical composition of a dish will vary a lot more than the preference of a particular individual, or group of individuals, for that dish. By which I mean, if I like spaghetti carbonara, I will probably like it regardless of its exact chemical composition, but I won't like it. e.g. if it lacks pancetta. My guess is that the relevant elements of the dish are in the scale of cooking ingredients, rather than the scale of molecules. So a system like the one you describe would be better off taking into account the composition of a dish on that scale.

On the other hand, if you wanted to assemble a menu with finished dishes from a list of ingredients and examples of recipes, then you would need a system like the ones I describe above, in the program synthesis or (preferrably) Inductive Programming category. Or of course you could write a program encoding the rules you have in mind by hand. This is not a task where AI is absolutely necessary, I feel.


IBM's Watson did an interesting thing around pairing flavours. There's some discussion here: https://news.ycombinator.com/item?id=9593085


You're right in that you'd need to teach the system more than just ingredient lists.

I would go even further: It's not enough for the system to know how to generate any given "chemical pattern", but to also know which chemical patterns are desirable.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: