text:
Has the Lovelace Test 2.0 been successfully used in an academic setting?
In October 2014, Dr. Mark Riedl published an approach to testing AI intelligence, called the "Lovelace Test 2.0", after being inspired by the original Lovelace Test (published in 2001). Mark believed that the original Lovelace Test would be impossible to pass, and therefore, suggested a weaker, and more practical version.
The Lovelace Test 2.0 makes the assumption that for an AI to be intelligent, it must exhibit creativity. From the paper itself:

The Lovelace 2.0 Test is as follows: artificial agent $a $ is challenged as follows:

$a$ must create an artifact $o$ of type $t$;
$o$ must conform to a set of constraints $C$ where $c_i ∈ C$ is
  any criterion expressible in natural language;
a human evaluator $h$, having chosen $t$ and $C$, is satisfied
  that $o$ is a valid instance of $t$ and meets $C$; and
a human referee $r$ determines the combination of $t$ and $C$
  to not be unrealistic for an average human.

Since it is possible for a human evaluator to come up with some pretty easy constraints for an AI to beat, the human evaluator is then expected to keep coming up with more and more complex constraints for the AI until the AI fails. The point of the Lovelace Test 2.0 is to compare the creativity of different AIs, not to provide a definite dividing line between 'intelligence' and 'nonintelligence' like the Turing Test would.
However, I am curious about whether this test has actually been used in an academic setting, or it is only seen as a thought experiment at the moment. The Lovelace Test seems easy to apply in academic settings (you only need to develop some measurable constraints that you can use to test the artificial agent), but it also may be too subjective (humans can disagree on the merits of certain constraints, and whether a creative artifact produced by an AI actually meets the final result).

No.
TL;DR: The Lovelace Test 2.0 is very vague, making it ill-suited for  evaluation of intelligence. It is also generally ignored by researchers of Computational Creativity, who already have their own tests to evaluate creativity.
Longer Answer:
According to Google Scholar, there are 10 references to the "Lovelace Test 2.0" paper. All of those references exist merely to point out that the Lovelace Test 2.0 exists. In fact, at least two of articles I consulted (A novel approach for identifying a human-like self-conscious behavior and FraMoTEC: A Framework for Modular Task-Environment Construction for Evaluating Adaptive Control Systems) proposed their own tests instead.
One of the authors who wrote the FraMoTEC paper also wrote his thesis on FraMoTEC, and indirectly critiqued the Lovelace Test 2.0 and other similar such tests:

The Piaget-MacGyver Room problem [Bringsjord and Licato, 2012], Lovelace Test 2.0 [Riedl, 2014] and Toy Box problem [Johnston, 2010] all come with the caveat of being defined very vaguely — these evaluation methods may be likely to come up with a reasonable evaluation for intelligence, but it is very difficult to compare two different agents (or controllers) that partake in the their own domain-specific evaluations, which is what frequently happens when agents are tailored to pass specific evaluations.

Another major issue with the Lovelace Test 2.0 is that there is a proliferation of other tests to "measure" the creativity of AI. Evaluating Evaluation: Assessing Progress in Computational Creativity Research, published by
Anna Jordanous in 2011 (3 years before the invention of the Lovelace Test 2.0) analyzed research papers about AI creativity and wrote:

Of the 18 papers that applied creativity evaluation methodologies to evaluate their system’s creativity, no one methodology emerged as standard across the community. Colton’s creative tripod framework (Colton 2008) was used most often (6 uses), with 4 papers using Ritchie’s empirical criteria (Ritchie 2007).

That leaves 10 papers with miscellaneous creativity evaluation methods.
The goal of "Evaluating Evaluation" was to standardize the process of evaluating creativity, to avoid the possibility of the field stagnating due to the proliferation of so many creativity tests.  Anna Jordanous still remained interested in evaluating creativity tests, publishing articles such as "Stepping Back to Progress Forwards: Setting Standards for Meta-Evaluation of Computational Creativity" and Four PPPPerspectives on Computational Creativity.
"Evaluating Evaluation" does provide some commentary to explain the proliferation of systems to evaluate creativity:

Evaluation standards are not easy to define. It is difficult to evaluate creativity and even more difficult to describe how we evaluate creativity, in human creativity as well as in computational creativity. In fact, even the very definition of creativity is problematic (Plucker, Beghetto, and Dow 2004). It is hard to identify what ’being creative’ entails, so there are no benchmarks or ground truths to measure against.

The fact that so many tests of creativity already exist (to the extent that Jordanous can make an academic career in studying them) means that it's very difficult for any new test (such as the Lovelace Test 2.0) to even be noticed (much less cited). Why would you want to use something like the Lovelace Test 2.0 when there's so many other tests you could use instead?


text:
What is an "inference kernel"?
In the recent event where ChatGPT "went crazy", this term was used in the official post-mortem to describe what happened:

In this case, the bug was in the step where the model chooses these numbers. Akin to being lost in translation, the model chose slightly wrong numbers, which produced word sequences that made no sense. More technically, inference kernels produced incorrect results when used in certain GPU configurations.

Now I know what inference is, at least wrt LLMs. It's when you use a trained LLM to generate text by giving it a prompt (feel free to offer a more technical clarification if necessary). As for kernel that has several meanings in computing generally, such as an operating system kernel being the core part of the OS, often in contrast to shells, including command lines and GUIs. Then there is the sense of kernel in image processing, also known as a convolution matrix. There's also Compute Kernels in GPGPU programming, with which I am the least familiar.
But what does the overall phrase "inference kernel" refer to technically? My hunch is that it's some kind of specialization of the GPU sense, though I read a comment in an AI-adjacent forum that it's related to the OS sense, which I doubt is accurate.
Other than that I can't actually find this term mentioned very much, and I can't find it defined at all.

EDIT
I found a definition of inference kernel but it's about automatic theorom provers and doesn't seem to be applicable to AI, not that I can follow it very well:

inference kernel : (n) The part of an LCF-style system that implements the deductive system of its formal logic, and relied upon by all subsequent deductive functionality for its soundness. It defines the datatype for internal theorems as an abstract datatype, with the primitive inference rules and the primitive assertion commands as its only primitive constructors. The inference kernel is a crucial trusted component of its system. See "language kernel", "logical core", "core system".

Given the context and similar usage, they're probably referring to compute kernels in GPUs. This OpenAI blog post seems informative for more on this topic.

I spoke briefly with ChatGPT on the matter; 3.5, I don't have access to 4.0. It says that it's not anything that it has or uses, so this is post-2022, so it's not anything that has to do with prompt replies in generic GPT systems, though it could have something to do with 4.0-related enhancements in this area.
As for "Inference Kernel", for LCF-systems (as it reminded me), you're essentially talking about Milner's type-checking system. I don't think 4.0 is implementing a Milner-type theorem prover or proof assistant as an "Inference Kernel", and 3.5 also expresses skepticism that this is what the term is referring to.
The use of "ML" in the Open AI HW/SW Co-Design Engineer Job Ad that was alluded to, indirectly, by the previous reply, alongside "GPU" and "CUDA", is almost certainly "Machine Learning", rather than Milner's LCF-based ML language. It would be interesting if their inference kernel did, indeed, have connection to this, since Milner's LCF and ML have evolved into Higher Order Logic (HOL) proof assistants, and there actually are such things as Higher Order Logic Theorem Provers (like this HOL Theorem Prover dot-com); which is an entire echelon above old-school theorem provers, and a step beyond proof assistants. The challenge of hybridizing connectionist / neural net & non-linear statistical models with old-school symbolic / logic-based models is still an open area of research.
Since the discussion is in the context of GPU configurations, 3.5 lists "hardware compatibility", "software bugs", and "optimization issues" that particularly apply to the GPU implementation of the inference kernel as issues to examine, and it suggests it's an issue that has to do with the GPU-based implementation of the "inference kernel". The link (ultimately) alluded to in the previous reply to Triton (GitHub) may be what this has to do with.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Is large language model and foundation model the same thing?
I read a lot about foundation model and large language model.
However, I dont find a clear definition what exactly is a foundation model. Is large language model and foundation model the same thing?

At this point in time, there does not appear to be a really widely-agreed-upon definition of "Foundation models". If you want one, the best place to go would be this paper from Stanford that coined the term. Generally at least some of the following ideas apply (according to some people they must all apply, according to others only some need to apply):

Trained using unsupervised or self-supervised learning.
Large (deep neural network) model.
Not intended to be used directly for any particular end-goal.
Intended to serve as a basis ("foundation"). You can think of this as "warm-starting", starting from a well-trained initial model, that you can then fine-tune with further training (for example, supervised learning) for any specific task you personally have in mind.
Trained on multimodal data (not just text, not just images, not just audio, etc., but a mix of things). In my personal opinion this point really is not strictly necessary, and I think most people would agree, but I've seen some people saying this.

Large Language Models would typically be trained specifically on language-related data (text). So, I suppose an LLM could sometimes serve as a Foundation model, but it's not necessarily the same thing.
NOTE: I would like to remark that, from many experts outside of Stanford, there is quite a bit of pushback against the particular term "Foundation model". There seems to be a bit of PR involved, where it seems like they may like to coin a new term for something that really doesn't need a new term. Just saying it's, for example, a large pre-trained model, may be more clear.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Why do DeconvNet use ReLU in the backward pass?
Why does DeconvNet (Zeiler, 2014) use ReLU in the backward pass (after unpooling)? Are not the feature maps values already positive due to the ReLU in the forward pass? So, why do the authors apply the ReLU again coming back to the input?
update:  I better explain my problem:
given an input image $x$ and ConvLayer $CL$ composed of:

a convolution
an activation function ReLU
a pool operation

$f$ is the output of ConvLayer given an input $x$, i.e. $f=CL(x)$.
So, the Deconv target is to "reverse" the output $f$ (the feature map) to restore an approximate version of $x$. To this aim, the authors define a function $CL^{-1}$ composed of 3 subfunctions:
a. unpool
b. activation function ReLU (useless in my opinion, because $f$ is already positive due to the application of the 2. step in $CL(f)$)
c. transposed convolution.
In other words $x\simeq CL^{-1}(f)$ where $CL^{-1} (f) = transpconv(relu(unpool(f)))$. But, if $f$ is the output computed as $f=CL(x)$, it is already positive, so the b. step is useless.
This is what I understood from the paper. Where I wrong?

While computing error (training phase) its just like any other layer. Error can be negative, hence the ReLU, I guess.

but in the paper seems that $CL^{-1}$ is applied to $f$ (which is the feature map computed in the forward pass)


text:
Function to update weights in back-propagation
I am trying to wrap my head around how weights get updated during back propagation. I've been going through a school book and I have the following setup for an ANN with 1 hidden layer, a couple of inputs and a single output.

The first line gives the error that will be used to update the weights going from the hidden layer to the output layer. $t$ represents the target output, $a$ represents the activation and the formula is using the derivative for the sigmoid function $(a(1-a))$. Then, the weights are updated with the learning rate, multiplied by the error and the activation of the given neuron which uses the weight $w_h$. Then, the next step is moving on to calculate the error with respect to the input going into the hidden layer from the input layer (sigmoid is the activation function on both the hidden and the output layer for this purpose). So we have the total error * derivative of the activation for the hidden layer * the weight for the hidden layer.
I am following this train of thought as it was provided, but my question is — if the activation is changed to $tanh$ for example and the derivative of $tanh$ is $1-f(x)^2$, then would we have the error formula update to $(t-a)*(1-a^2)$ where $a$ represents the activation function so $1-a^2$ is the derivative of $tanh$?

check http://karpathy.github.io/neuralnets/


text:
Are POS tagging, Chunking, Disambiguation, etc. subtasks of annotation?
I wonder about the legitimacy of using the terms "POS tagging", "Chunking", "Disambiguation" and "Categorization" to describe an activity that doesn't include writing code and database queries, or interacting with the NLP algorithm and database directly.
More specifically, let's suppose I use the following tools:

an "Annotator" for analyzing the input text (e.g. sentences copypasted from online newspapers) and choose and save proper values as regards to "POS" of tokens and words, "Words"(entities and collocations) and "Chunk". Tokens are already detected by default. I have to decide which words are entities and/or collocations or not and their typology, though. May the performed tasks be called "POS tagging", "Chunking" and "support to categorization"?
A knowledge base, for searching and choosing the proper synsets of the lemmas and assigning them to the words analyzed in the previous Annotation tool. May such a task be called "Disambiguation"?
A graphical user interface which shows how the NLP analyzes by default the input texts as regards to Lemmas, POS, Chunks, Senses, entities, domains, main concepts, dependency tree, in order to make analyses consistent with it.

If I want to define these activities in a few words, "Machine Learning annotation" may be the most correct.
But what if I want to be more specific? I don't know whether or not the terms "POS tagging", "Chunking", "Disambiguation" and "Support to categorization" may be appropriate for they generally come within "programming contexts", as far as I know. In other terms, do they involve writing algorithms and programming or are they / may they be referred to the "less-technical" activities described above?

The procedures you mention don't need to involve writing code. There are now many ready-made tools available which implement various algorithms.
POS-Tagging, Chunking, and Semantic Tagging/Disambiguation are knowledge-based procedures which can all be seen as classification/clustering tasks: POS-Tagging and Disambiguation are classifications, in that they propose a label (a POS- or semantic tag) that is assigned to a token. Chunking is a clustering algorithm, as it finds coherent groups in sequences of tokens. You could also view it as segmentation, as it splits a sentence into parts.
In principle they don't have anything to do with machine learning; the algorithm you are using (ML or not) is an implementation detail. Early Taggers were mostly rule-based, but with increasing availability of annotated data it became more feasible to use ML algorithms. This, however, has got nothing to do with how you classify the procedures.
In general I would call the activity you describe as 'annotation', as you enrich the source text by adding descriptive categories to tokens and token sequences.
So, no, they do not have to involve programming or implementing algorithms, and you don't need to be technical to perform them. Though some knowledge of linguistic concepts would help.

Than you for answering. What about the job role? May the person who performs these tasks ('annotation') be called "Computational Linguist"?

Computational linguist is a much broader description, but yes, one aspect of working as a computational linguist could be to do annotation.


text:
When is it time to switch to deep neural networks from simple networks in text classification problems?
I did an out of domain detection task (as a binary classification problem) and tried LR and Naive Bayes and BERT but the deep neural network didn't perform better than LR and NB. For the LR I just used BOW and it beats the 12-layer BERT.
In a lecture, Andrew Ng suggests "Build First System Quickly, Then Iterate", but it turns out that sometimes we don't need to iterate the model into a deep neural network and most of the time traditional shallow neural networks are good/competitive enough and much simpler for training.
As this tweet (and its replies) indicate, together with various papers [1, 2, 3, 4 etc], traditional SVM, LR, and Naive Bayes can beat RNN and some complicated neural networks.
Then my two questions are:

When should we switch to complicated neural networks like RNN, CNN, and transformer and etc? How can we see that from the data set or the results (by doing error analysis) of the simple neural networks?
The aforementioned experiments may be caused by the simple test set, then (how) is it possible for us to design a test set that can fail the traditional models?

Source: https://blog.easysol.net/building-ai-applications/
When data is too big, complex and nonlinear it's time to try deep learning. It's always good to try to add some layers to see it can eliminate bias and don't lead to high variance.
Deep learning models can be tweaked(hyperparameters) and regularized(parameters), and it is worth the work.


text:
How can I draw a conceptual dependency for the statement "Place all ingredients in a bowl and mix thoroughly"?
I stumbled across a question asking to draw a conceptual dependency for the following statement:

Place all ingredients in a bowl and mix thoroughly

My attempt so far

Explanation: Both the sender and recipient are the same, except that the states of their contents are different.
Something feels like it isn't right. I would appreciate if you could correct errors, if any.

As it's two clauses ("place in bowl" and "mix"), I would actually use two separate CD structures. The first one is a PTRANS (not ATRANS, as you don't change ownership, but location); the second one is a bit trickier.
Mix can be paraphrased as stir, or move around. You would typically do this with a spoon or similar implement. I would do it as a PROPEL with the instrument spoon and the object the ingredients. PROPEL, according to Schank (1975) is the "application of a physical force to an object".
So the first one is:
(PTRANS
  (ACTOR *you*)
  (OBJECT "all ingredients")
  (TO "bowl"))

And the second is:
(PROPEL
  (ACTOR *you*)
  (OBJECT "ingredients")
  (INSTRUMENT "a spoon")
  (DIRECTION "circular"))

It's debatable if you PROPEL the ingredients with the instrument spoon, or you PROPEL the object spoon with the target/location/direction ingredients.
If you draw them in a graphical representation, you can have both ACTs leading off the shared actor '*you*'; or you could have them as separate graphs linked by 'then' or some other indicator of sequentiality.
Schank, Roger (1975) The primitive ACTs of conceptual dependency, Proc of 1975 workshop on theoretical issues in natural language processing, 34-37


text:
How to distinguish between proper nouns and other words in NLP?
If an NLP system processes a text containing proper nouns like names, trade marks, etc. without knowing anything about the language (ie no lexicon), is it possible to recognise them?

Essentially you would need to train a named entity recognizer (NER) to recognize the names out of the common words.
There are many works that try to use a similar language to the language in question as a pivot to train a full NER model (for example, Cheap Translation for Cross-Lingual Named Entity Recognition).
Your task might be slightly simpler, as you are interested only in one class: whether it is a named entity or not. But in general it is very similar to this setup.


text:
DQN, how to choose the reward fucntion?
I built a simple AI system that tries to solve the 8 puzzle using DQN.
The problem is, if the agent gets only a reward greater than zero when winning, the training will take a long time, so I made a smooth reward function instead: $R=(n/9)^3$, where $n$ is the number of pieces that are in the right position.
The training became quicker but the AI chose to match 7 pieces out of 9 to get a reward of $(7/9)^3/(1-\gamma) = 0.47/(1-\gamma) = 4.7$, for $\gamma=0.9$, choosing to win and getting reward of 1 doesn't make sense to the AI, lowering $\gamma$ will result in the AI to choose instant reward instead of long-term reward, so that will not be very helpful; lowering rewards of non-winning stats will make the training very slow.
So, how do I choose a good reward function?

Try using Manhattan distance between current position and supposed position for all pieces, use that as negative reward.

Increase the reward for winning. The reward for winning should normally dwarf all other rewards.

Changed the reward of winning to 5, that didn't improve the results a lot somehow. i like the idea of negative rewards i will give it a go.


text:
How to detect any native language when written in Latin characters?
Assume somebody knows only to write in Latin characters. If they write words of any other language (example: Hindi, French, Latin)  using the Latin alphabet, how can I detect that language?
Example: If they write Hindi language word using the Latin alphabet)

kya kar raha hai

     >> the output is Hindi language

You need to distinguish between alphabet (Latin, Cyrillic, Greek,  Devangari, ...) and language (English, French, Hindi).

The most distinct words of a language are usually the function words (the, and, of, with,...); other lexical items are often (at least partly) shared between languages that had come in contact with each other. So looking for function words is usually the best way to identify the language in a given text.
This can be done by having a list of function words for each language you recognise, look those words up in your text, and then calculate the probability that the text belongs to each language given the frequencies of the words in your list. There will be overlaps, for example Dutch of is equivalent to the conjunction or in English, but also looks like the English of.
Another approach would be to take texts in your languages, and split them into n-grams, typically trigrams. Then you use a list of trigrams and compare the frequency distributions in your known and unknown texts to find which is most likely to match. This has the advantage that you don't need to know anything about the language structure (because you don't need to identify function words), and it also captures the morphology (eg the common English suffix -ing).
You can simply implement this in a fairly basic program, or you could train a machine learning classifier with it. The former seems easier to me, but is not as exciting as the latter.
However, for single words (as per your example) this might not work properly. Generally, the longer the text, the more precise the recognition.
UPDATE: On re-reading your question I think I have misunderstood it, and that you're asking about transliteration into Latin characters. In a way the same applies, that you need to first identify which language it is, and then choose the correct mapping from the Latin transliteration to the writing system that language natively uses.
Since the transliteration is purely symbolic, I don't think that an ML approach would be better than a simple lookup-table of equivalences. And of course there might be difficulties if the writing system has more distinct characters than the  Latin alphabet provides.
UPDATE 2: If the input is transliterated text, then your reference texts (where you know the language) also have to be transliterated in the same character set (eg Latin in your example).

@Oliver Mason.: thanks so much for the input. I edited my question. kindly go through it. go here : https://translate.google.co.in/?hl=en&tab=TT&authuser=0 and type "kya", google will say its "Hindi detected". How does that happen?

@ DuttaA : No characters. just the language is enough. we can easily convert it to hindi characters.


text:
How do map providers like Google calculate the distance between two coordinates and find turn by turn directions?
I have searched on how Google or any map provider calculates distance between two coordinates. The closest I could find is Haversine formula.
If I draw a straight line between two points, then Haversine formula can be helpful. But since no one will travel straight and typically move through the streets, I want to know if there are any methods to calculate turn by turn points and see how to find multiple ways to travel to the destination from the source.
Right now my idea is

Have the two coordinates within a map window.
Make an algorithm detect the white lines (path) in the window.
Make it understand how they are connected.
Feed it to an algorithm to solve the Travelling Salesman Problem to find the best path between them.

But these things see very memory and process intensive. Even with the knowledge that Google has the powerhouse to process, to serve so many directions and distance matrix in fractions of seconds in amazing. I want to know if there are different approaches to this?

Roads maps are well defined and you can access them online. For example you can visit OpenStreetMap to download road network of a given region.
Such a road network definition contains nodes (junctions) with lat/lon coordinates and edges between nodes (roads). An edge is defined by a connection of two nodes. Edges can represent one-way roads: you need to define double ways as two edges going in both ways. Haversine formula gives you the straight distance between two nodes: the length of the edge.
This definition of a road network gives you a graph (in the mathematical point of view) and is largely covered by the literature. You can search the graph and compute many of its parameters.
From a road network definition you can run shortest path algorithm to find the closest way between two nodes. From a given coordinate you can either pick the closest node or get the closest edge (and compute distance to the edge and the coordinates of the perpendicular projection point).
Algorithms like A* and Dijkstra are not so time consuming and you can find shortest path efficiently.

Obviously the way Google store their information is not published, but from the Directions API I would make the following educated guesses:

The roads/paths are stored as a graph database
Each path has additional information: type of road, transport link, etc.
Geocoordinates or placenames are mapped onto graph nodes

Finding a route then is a problem of finding the best path through the graph. This will be easier if you provide waypoints (which effectively split a long route into several shorter ones). As you have the physical coordinates, you can use something like the A* algorithm to traverse the graph.
From your question I assume that you'd want to work with map images, rather than a pre-processed graph. I would think that this is not feasible, and that you have to do this conversion into a graph first. You can probably semi-automate this by using image processing to identify roads, but ultimately this is probably something that has to be done at least partially with human intervention. You don't want to drive for ages only to find out there was a one-way street which you did not spot from the image.
Also, usually satnavs are aware of speed limits along the path. This again has to be added either manually or automated (by recognising traffic signs along the route, eg from a street view photography car). So image data alone is not sufficient.

Can you elaborate on how roads/paths are stored in the graph database? If I give a latitude and longitude points how will it be searched in the graph database of roads and paths?

As I said, educated guess only: you simply store long/lat with each node in the graph and then pick the closest match. You do that for both origin and destination, then you have two nodes in the graph -- now find the best path using a graph search algorithm.


text:
How to find the subject in a text?
I often develop bots and I need to understand what some people are saying.
Examples:
- I want an apple
- I want an a p p l e
How do I find the object (apple)? I honestly don't know where to start looking. Is there an API that I can send the text to which returns the object? Or perhaps I should manually code something that analyses the grammar?

It depends on the complexity on your sentences. If you have a limited range, you could do simple pattern matching on part-of-speech tags. Put your sentence through a tagger (there are plenty of them around) and look for the first noun following a verb:
I       want an         apple
Pronoun verb determiner noun

(I assume you mean the object, as the subject in that sentence would be I). Scan through the list until you hit a verb, then pick the next noun. This should work for most English sentences.
It gets a bit more complicated if your nouns have additional words around them, for example red apple (where red is an adjective) or bottle of beer (where you have the pattern noun OF noun). So if you want to capture those fully, you might need a few more complex matching rules.
Overall it should still be a lot easier than implementing a full-blown syntactic parser which creates a comprehensive structural analysis of your sentence, most of which you wouldn't need in the first place.

I'm trying to do something similar to this.  I would like to perform sentiment analysis, however I need to keep track of the subject, so I can be aware of what the sentiment applies to.   using SVO, to manually parse it might work, what would you reccomend?

Depends how precise it has to be. You can get quite far with simple heuristics, but every percentage accuracy in precision beyond say, 70-80 percent,  requires a lot more effort.

Thanks, I'm going to try a hybrid solution.  use AI to find the subject using a syntax parser, and then some list of rules to see if the subject from the previous sentence is the same

That sounds like a good approach.


text:
How could you generate sentences from lists of facts
Let's pretend we had a list of facts (similar to prolog tuples) that define some knowledge about some entities. e.g.
doing(clean, data)
done(collect, data)
todo(train, model)
todo(write, paper)

What methods could I use to generate sentences like:
You should be cleaning the data you collected, then you need to train your model and write your paper.

When you parse sentences you use grammatics to sentences to get the meaning (semantics).
Now you use sematics (tuples) and grammatics to make a sentence.
Your knowledge includes verb, noun and some kind of notion of readiness of the task defined by them.
To form sentences you also need knowledge / rules about the extra eligible words between these categories, as well as how time relates to verb grammatical tense.
You have to code a parser for tuples that codes the tuple in the three parts, formulate the grammatics,
and then apply the grammatics to the parsed tuple data.
After that you'll get the sentences.
More precise information on how to code that and this information plus the picture source:
http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/node93.html#l14.sec.nlg

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Machine learning to detect wrong address data
I want to use a machine learning algorithm to detect false address data. I learned about neural networks and machine learning at university, but I don't have much experience in this field.
Do you think it is feasible to use a high level algorithm for this or should I use simple queries and filters to catch out wrong data?

Can you manually do the same task?

What do you mean by "false"? Data that is not actually in the right format for an address, or addresses that are wrong for a particular location or person?

Yes I can do the task manually

My mistake the data is sometimes not in the right format, sometimes its in the right format but there are spelling errors and sometimes the street is not in the written city.

Well... Then you have to teach it the spelling rules of English. I'd honestly just use a regex, or check it against a database.

The comments are off base.  Having worked in validation of data as a consultant for Nasdac, Amex, and Lexis Nexis I can tell you that using the UNIX sed -r or pcrelib is insufficient to do a stellar cleansing of address data.
Although none of those companies did this at the time I was consulting, the application of current machine learning is easy to infer from the basic characteristics of data.  What is needed is a good record of incoming data, cleaned data, and rejected records to constantly use as a reference.
The manual process would be a nightmare.  For instance, misspellings are more indicative of true data than properly spelled ones in some but not all cases (unless the falsified data generator is programmed to synthesize the existing distribution of misspellings in authentic data sources).
Try to profile that in static code such that the data validation will adapt to data trends without requiring a maintenance workforce.  Those kinds of things never get addressed in a typical IT environment.  Non-adaptive validation would be a gross mistake, especially if the volume is high, like for M16 or Liberty Cross or the NSA or Interpol.
What you want is an extremely fast index of well authenticated good addresses (perhaps corroborated by public records with local authentication policies) and a feature extraction from it using auto encoding or some similar and perhaps better methodology and its associated algorithms.
Then you can train the classification of fake and authentic addresses based on extracted feature profiles.
You will also want reinforcement, because the attackers (those trying to create false identities using plausible addresses) will adapt to the training of the current system.  The authentication system must stay steps ahead of those trying to defeat it, which they will likely try to do once the existence of authentication automation is detected.
One can fend of attackers by placing misinformation strategically and then tracing the input sources back to the attacker based on the misinformation seeds.  That only works if you have law enforcement in your camp.


text:
Normalizing height data for CNN
A task I’m working on at the moment requires a CNN with a height map as one of the inputs. This is a matrix of floating point values in which each point is the height of that point above sea level.
I’m having trouble deciding how to normalize this data. I know there are networks that work on depth or distance data but that is different for several reasons:

Height can also be negative (as opposed to depth/distance which starts at 0)
Height has a very large range - can get values between -400 and +~9000.

For these reasons the common approach to normalisation, simply subtracting the mean and dividing by the standard deviation, will result in the loss of information in most cases (all values will be close to zero).
I thought of maybe subtracting the local mean for each input, rather than a general mean calculated from all the data, but I still don't know what to do with the standard deviation, since dividing by the local standard deviation can result in very “flat” and very “steep” inputs looking the same after normalization.

Could you apply a log transformation to it? That would mean that the more frequent data points close to NN (sea level) would still have a good range, while the (presumably rarer?) extreme values would be compressed.

Hi, thanks. I know that’s a common practice with depth/distance data but the problem as I mentioned is that my data can also be negative and log is undefined for non-positive values..

As you're only using the log to compress the range of the data, could you not just log the magnitude? So that -250 becomes -2.397?

that's an interesting idea but I think it's still problematic. let us say I'm working on a high altitude area. say 5000+. so all the small variations in height will be lost after I take the log. and if I take the same height structure to a low altitude place, say ~100, the representation will be very different.

i would suggest local-contrast-normalization.

This question should be migrated to: https://datascience.stackexchange.com/.


text:
Teaching a NN to manipulate pseudoRNG over a long time scale?
For speedrunning purposes, I am trying to train a neural network to identify human-executable ways to manipulate pseudo-RNG (in Pokemon Red, for the interested). The game runs at sixty frames per second, and the linear-congruential PRNG updates every frame, while many frames are unlikely to be relevant to the manipulation (and so should contain no actions from the neural net). Any given manipulation is likely to last 30sec-2min, and the advancement rate of the PRNG can change depending on location in the game-world.
I have some experience with coding AI/deep-learning. I've made some programs using Multilayer Perceptron and IndRNN approaches. From what I can tell, IndRNN or A3C would be my best bets. I'm not expert enough to know the correct approach, though, or to know if the dimensionality of the problem makes it outright unfeasible.
1) Is this problem reasonably solvable with NN/deep learning?
2) What approach would you recommend to tackle it?

The point of pseudoRNG is to be unmodable and unpredictable, making it hard to train an AI to learn. It would more likely be useful and more efficient to have the equation that the game uses for generation available, so that you can manually make the check, or to just have a list of the loop if the pseudoRNG is based on the time elapsed.

If the RNG in question really is a linear congruential as OP suggests, then it feasible to crack it with not much data. I agree that a more direct analysis would be better than AI approach, I think any supervised learning will struggle with the apparent complexity of the function.


text:
Which machine learning algorithm is suitable for detecting text w.r.t set of words
Considering the scenario where supervised training data-set in the form of sentence will be given to train the machine

The Bomb which had been planted by Terrorist on this morning was
  defused by the Counter Terrorist on joining hands with the
  Intelligence Force

Input strings in the sentence containing each words are broken into tokenised
arrays of single words with stop words removed.
Each word in the given sentence gets assigned a label w1, w2 and so on i.e,
w2  = Bomb
w6  = planted
w13 = defused
Calculating the scores for individual word combinations, the result should yield something like:
w2.w6  = Scores should be Positive (or > some threshold value)
w2.w13 = Scores should be Negative (or < some threshold value)
In case of words with polarity changers
Eg.: Bomb wasn't/haven't/didn't got defused.
The resulting scores should be positive

To accomplish this task I had implemented Sentiment Analysis with the threshold = 2.5 and ended up with the following scores

Actual Output:

< 2.5 : Low
  = 2.5 : Neutral
  > 2.5 : High

Expected Output:

Case 1: score = negative, since that bomb was defused or removed in the given sentence
Case 2: score = positive, vice versa of "Case 1"
Case 3: Otherwise score = 0, in case it can't predict either of the above two cases, it should be neutral

I am facing a severe problem every time I need to update the vocabulary list with upcoming new words that were not in the dictionary list, which is turning out to be Semi-supervised learning.
Referring to the above sentence to calculate the w(n-(1/2/3/...n) and wn word with reference to word = Bomb. The final resulting score should yield as negative.
So which machine learning algorithm would be appropriate that fits to yield a better solution and based on the given data set how will I train the machine to learn the above things?
Finally should I try to implement by keeping the model persistence. So that it doesn’t have to be trained on each run.

It looks like you are trying to compute some kind of word relationships. Can you be a bit more explicit about the purpose of the scores, and what they should reflect?

After scanning set of words in the given document file, the scores should reflect whether the bomb planted was defused or not at the end of the story @OliverMason

"whether the bomb planted was defused or not" Do you mean there is only one simple answer (defused/not defused)? why you don't try RNN with character level to overcome unknown words

If your main issue is dealing with new vocabulary, you could try using a parts-of-speech tagger as a pre-processing step. You would then effectively discover relationships between "noun" and "verb", which does not change with new words. Taggers usually can handle unknown words by using contextual information.
So you'd tag the words with their word class labels, and use those for training.
In 'application mode' you use p-o-s tags again, calculate the scores, and then map them back onto your original word tokens.
This does of course loose you some information, as you're only dealing with N-V, rather than bomb-plant or bomb-defuse. To solve this I'd use a hybrid approach: for your known vocabulary you use the word tokens, whereas for unknown words you fall back on tags. If you train two classifiers, one with tokens, one with tags, you have the tags one as a 'safety net' to handle out-of-vocab words.


text:
Kalman filter pre inovation
I am trying to track LIDAR objects using Kalman filter. The problem is that the innovation has the value 0, which makes the Kalman gain be Infinity. Here is a link with the Kalman equations. The values with which I initialized the measurement and process covariance matrix are listed below. The update code is also shown below. When I debug the code everything is fine until the innovation becomes 0.
this->lidar_R << std_laspx_, 0, 0, 0,
    0, std_laspy_, 0, 0,
    0, 0, 0, 0,
    0, 0, 0, 0;

this->lidar_H << 1.0, 0.0, 0.0, 0.0, 0.0,
    0.0, 1.0, 0.0, 0.0, 0.0,
    0.0, 0.0, 0.0, 0.0, 0.0,
    0.0, 0.0, 0.0, 0.0, 0.0;

P_ << 1000, 0, 0, 0, 0,
    0, 1000, 0, 0, 0,
    0, 0, 1000, 0, 0,
    0, 0, 0, 1000, 0,
    0, 0, 0, 0, 1000;

 MatrixXd PHt = this->P_ * H.transpose();
 //S becomes 0
 MatrixXd S = H * PHt + R;
 //S_inv becomes INFINITY
 MatrixXd S_inv_ = S.inverse();
 MatrixXd K = PHt * S_inv_;

VectorXd y = Z - Hx;

this->x_ = this->x_ + K*y;
MatrixXd I = MatrixXd::Identity(x_.size(), x_.size());
this->P_ = (I - K * H) * this->P_;

This question should be migrated to: https://datascience.stackexchange.com/.

I don't any questions here. Can you clarify what your question was?

From your matrix definitions, the issue is S always singular so it can never be inverted
I reimplemented the computation with numpy and here are the numbers
H = np.array([[1.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0]])

P = np.identity(5) * 1000

R = np.array([[100, 0, 0, 0], [0, 100, 0, 0], [0,0,0,0], [0,0,0,0]])

S=H.dot(P.dot(np.transpose(H)))+R

and S is
array([[1100.,    0.,    0.,    0.],
       [   0., 1100.,    0.,    0.],
       [   0.,    0.,    0.,    0.],
       [   0.,    0.,    0.,    0.]])

Basically the definition of H with its all zeros lines cancels part of the information (make it unobservable) and you also do not have any observation noise component for them

Check to see if the determinant of S is zero before you do the inverse. If that is the case, use pseudo inverse.


text:
Type of artificial neural network suitable for learning and then predicting forest growth
I'm trying to use an ANN to learn from a large amount of forest measurement data obtained from sampling plots across Ontario, Canada and associated climate data provided by regional climate modelling in this province.
So the following are the inputs to the ANN:

Location (GPS coordinates)
Measurement year and month
Tree species
Age
Soil type
Soil moisture regime
Seasonal or monthly average temperature
Seasonal or monthly average precipitation
Some more data are available to select

And the targets include:
- Average total tree height
- Average tree diameter at breast height
For each sampling plot, the trees have been measured for 1-4 times.
So my question is what type of ANN can best used to learn from the data and then it can be used for predicting with a set of new input data?

Welcome to AI.SE @JChen! Can you tell us what other techniques you have applied to this problem? Do you want to use a neural network because you've heard about it, or because simpler techniques fail? If those techniques fail, tell us why, and it will help us answer!

Hi John, Thanks a lot. Assessing climate change impacts on forest development is an urgent need. But the difficulty is a lack of data for using statistical methods, especially at a large scale. We have a total of ~4000 sampling plots (mostly boreal forests) measured by 1-5 times. But together, each of the a few dominant boreal forest tree species has been measured many times. Thus should contain enough information about the relationship between tree growth and the environmental conditions that can be extracted by training an ANN. All the best.

My suggestion is not to use an ANN, but instead to use a simpler regression algorithm. The main reason for this is that ANNs take a long time to train, and work better when a lot of data is used. They also require a lot of expertise in parameter tuning to apply well. Since you say you don't have a lot of data, and also don't have a lot of experience using them, I think you will be better off applying something else first. If the other techniques don't work at all, then you might think about using ANNs, but again, they tend to want a lot of data.
If you have tried ordinary least squares regression, and found it does not work well, my next choice would be a Classification And Regression Tree. These models can make good decisions with small amounts of data, and do not require a lot of time to train. They can handle real-valued outputs like the height and width of a tree. Weka's REPTree might be a good starting place.
If Trees don't work out, my next suggestion would be to try regression using a Support Vector Machine. SciKitLearn's SVR is a good choice for this. SVRs can sometimes be very effective when data is limited, because they make assumptions about how to handle data-poor regions that seem to be generally applicable. An SVM can also report low confidence when estimating in those regions. They also train fairly fast when using small amounts of data, and can learn non-linear functions from the data.
If you really want to use an ANN, I would start with a simple Multi-layer perceptron. This model has few parameters to play with, and can probably fit well to your regression. It may make strange decisions in regions with less data however.
Hope this helps!

Hi John, thanks a lot for taking time providing detailed comments. One thing I want to make it clear is that I don't have a lot of data for each plot, but the ~4000 plots together provide a lot of data for 6 dominant species.

And I'll follow your suggestions to see whether 1 or more options you provided will work. Again, appreciate all your help.

@JChen don't forget to report back, and upvote or formally accept the answer if it solves the problem.  good luck!

Thanks DukeZhou, I'll certainly report back when I have some good results.


text:
How is uniqueness quantification translated in First Oder Logic
I have this following natural language statement:
"There is only one house in area1 the size of which is less than 200m²."
which is mistranslated to FOL:
∃x.(house(x) ∧ In(x,area1) ∧ ∀y.(house(y) ∧ In(y,area1) ∧ size(y) < 200 -> x=y))

This translation is wrong according to my lecturer, because it is not necessary that the size of x must be less than 200. The statement is true if there only houses which are bigger.
I have two questions:

I don't get the FOL translation at all and don't see where the uniqueness part is expressed :
so translated it back : "if all houses in area1 have a size less then 200m² then there exists one house which equals to all houses ??"
why is not necessary that the size of x is less than 200, when it clearly says in the statement above that must exist one house with a size less then 200 ?

It would be much appreciated if people who down vote, explain why the question deserves a downvote, so I can edit it.

According to the Wikipedia entry on Uniqueness Quantification your lecturer is correct. There is no size requirement expressed in the FOL expression.
The point about the implication is that it can be true if the antecedent is false. So, there is a house in area1 (which we call x). And all houses in area1 which are smaller than 200 are the same as x. But if there aren't any, then the antecedent is false, and the consequence (x = y) is false, but the whole statement is still true.
As another example: "If Trump is the 31st president of the USA, then the moon is made of green cheese". Both antecedent and consequence are false, but the whole statement is still logically true. Same as "If there is a house in that area, and there are houses that are less than 200 (which there aren't), then that house is one of them."
Moving on to the correct expression: The unique quantifier (usually written as ∃!) can be rewritten using the existential and universal quantifiers as follows (see the above mentioned Wikipedia page):

∃x (P(x) ∧ ∀y (P(y) -> y = x))

This is not what you have got; you have got two different predicates, P1 and P2. Your P1(x) is (house(x) ∧ in(x, area1)), and your P2(x) is (house(x) ∧ in(x, area1) ∧ size(x) < 200)
The correct expression would require the same predicate for the quantifiers and would therefore be

∃x ((house(x) ∧ in(x, area1) ∧ size(x) < 200) ∧
    ∀y ((house(y) ∧ in(y, area1) ∧ size(y) < 200)
      -> y = x))

The difference is that you state that there is at least one house in the area with a size of less than 200. So the second predicate, that y is a house in the area with a size of less than 200, cannot be false.


text:
How to decrease accuracy from 99% to 80%~85% using keras for training a model
How do I decrease the accuracy value when training a model using Keras; which parameters can I change to decrease the value?
My objective is not to actually decrease it, but just to know which parameters influence the accuracy
sgd = optimizers.SGD(lr=1e-2)

You give like no information here! It's like you're saying "Hey I have a code. Where is my bug?" without giving the code. First of all: What model? There are so many models with so many types of parameters that this is impossible to answer specific to your problem. Second: What data do you have? Thirdly: Why would you want to decrease accuracy? Is this about overfitting?

Well not impossible per se. You COULD just take the accuracy=accuracy-13 which would, technically, give the correct response.

There are many things affecting accuracy. I'm gonna assume a lot here because you don't say anything about the model, what you're trying to achieve or how many classes you have. You're not even saying whether you're classifying or not. Also, you're not saying which accuracy you're using (classification, AUC, F1 etc.).
I'm gonna assume here that you have some classification problem.
Accuracy is the measure of how many classifications you got correct. In my experience 99% is a warning sign because it's too good to be true, and a result like that is often due to overfitting. Since this, in my experience, is the main reason you'd actually want the accuracy down, this is what I'm going to assume is your problem.
Overfitting occurs when you train "too much" and the model only learns things that are within your training set, and fails on everything else. That is: it generalized bad.
To prevent this there are a number of things you could do;
1) Data segmentation
The most common is to split your data into three bulks: training (~70% of the data), validation(~20%) test (~10%). These percentages are indications and would vary depending on how much data you have, and the balancing.
The idea is that you train on the training data, you run the validation through the network, and calculate the accuracy. When this accuracy, call it validation accuracy, is satisfactory, then you stop the training and run the test data through it. The latter accuracy (test accuracy) is the one that most papers publish (combined with AUC and F1 score.
Important: When you have split the data into these bulks you should put away the test, and not use it during training at all. You only use this at the very end to do an extra check that you haven't overfitted.
2) Regularization
There are many types of regularization. Two very popular regularization methods for preventing overfitting are the L2-regularization (see previous link) and the dropout methods.
Without going into detail, these methods prevent the model weights from becoming too large. This is a good thing since the model won't rely too much on one feature, which in turn attenuates overfitting.

I hope you learned something, and the most important lesson is that you should know what you're doing. If not, you could end up with a model that is not behaving like you thought. In the case of overfitting, you'd end up with a model that only works on your training data, which doesn't really do much good.
I really recommend the book by Goodfellow: deeplearningbook.org.

If you want to decrease the accuracy given the same optimizer/epochs/batch, you could add more layers and increase the number of parameters, it should now take a bit longer to converge. Hence for the same epochs you would get lower accuracy. You could also initialise your parameters in a non sensical way.


text:
Extracting keywords from messages
I'm starting a project where I want to extract keywords from given messages. The keywords are for example something like: "hard disk", "watch" or other technical components. I'm working with a dataset where a technician wrote a small text if he maintenanced something on a given object.
The messages are often very different in their form. For example sometimes the messages start with the repaired object and sometimes with the current date.
I looked into some NER-Libaries and it doesn't seem like they can handle tasks like that. Especially the German language makes it hard for those libaries to detect entities.
I had the idea to use CRFsuite to train my own NER-model. But I'm not sure how accurate the outcome will be. It would mean that I have to tag a lot of training data and I'm not sure if the outcome will match the time I have to spend to tag those keywords.
Does anybody have any experience with such custom NER-models? How accurate can such a model extract wanted keywords?

Hello. Could you please put your main specific question in the title?

I don't know that NER is the right approach here. It seems to me that you want to find words for certain technical components in free texts, written in German. But "Festplatte" is not a named entity. Named entities (cities, companies, countries, etc) in English (and other languages) are usually capitalised, so relatively easy to spot. In German this won't work as every noun is capitalised, named entity or not. But even in English a NER wouldn't help you with "hard disk", as it's not what is commonly understood as a named entity.
It's not really an AI solution, but I would get a list of relevant components (eg from a dictionary), and then simply match those in texts. Instead of annotating existing texts, you simply add the words to a list, which would be a bit quicker, generally. And list lookup is very easy to implement.
This, I think, would work a lot better than a machine learning approach. If you find that your technicians often mis-spell the words, use a fuzzy matching algorithm such as Levenshtein distance to allow for close matches; this might also help with inflections.


text:
How to build a custom morphological analyser for translation system
I want to build a machine translation system from English to Georgian. Georgian is a language similar (and simpler) to the Russian language. its syntax looks like base + suffix, only suffix changes, most of the time base is frozen, to describe the time the only suffix is changed. Unfortunately, I couldn't find a morphological analyser for the Georgian language, so could you link or provide useful resources to help me to build one? or can you give me some suggestions?

Do you mean a tokeniser or a morphological analyser?

i mean tokenizer, i have text( georgian, i will mention english for everybody to understand), "i am dato nefaridze, and living in Georgia", i think it should split these text into words ['i', 'am' 'dato', 'nefaridze' 'and' 'live' 'ing' 'in' 'Georgia']. it should put apart living word

That's not a tokeniser. A tokeniser is mostly language-agnostic and only splits a stream of characters into words and non-words. You're looking for a morphological analyser, which can identify component parts of words, and therefore relies on knowledge about the structure of the language.

Huggingface has a Helsinki-NLP/opus-mt-ka-en repository with a Georgian (Ka) to English (en) model. A tokenizer_config.json is available

i want to build my own translation system. i think it is already trained model for translation, i need tokenizer not whole model. Also i want english to georgian, not vice versa


text:
What is a Hebbian linear classifier?
I was reading Deep Learning of Representations for Unsupervised and Transfer Learning,
and they state the following:

They have only a small number of unlabeled examples (4096) and very few labeled examples (1
to 64 per class) available to a Hebbian linear classifier (which discriminates according to
the median between the centroids of two classes compared) applied separately to each class
against the others.

I have searched about what a Hebbian linear classifier is, but I couldn't find more than an explanation about what Hebbian learning is, so can anybody explain what Hebbian linear classifier is?


text:
Dot notation for matrix element index in formula of word2vec embedding calculation
In his article word2vec Parameter Learning Explained Xin Rong uses the dot notation as an index for matrix (at the second page in the first formula).
$$ h = W^{T}x = W^{T}_{(k,\cdot)} := {v^{T}}_{w_I} \tag 1$$
If I understand the notation correctly, it means summarizing all the elements.
Am I correct in thinking that in this case this is just a formalism in the notation since as it stated in the paper:
$$ x_k=1 \ \text{and} \ x_{k'}=0 \ \text{for} \ k' \neq k $$
all other elements will be zero and no summation is necessary?
Is this just a notation to keep operations on matrices and vector consistent or I am missing something important?
I found similar question in the What does a dot mean in matrix element index?, but the answer seems to be specific for that case and the link they provide in comments doesn't open. So, in case somebody could refer to book/textbook with introducing this notation, please help.

The notation $W_{k, \cdot}$ likely refers to the $k$-th row. The dot just suggests taking all the elements in the row. It is just a convenient way to index an entire row of a matrix.

@hff1, thank you, makes sense for this formula, although as I understand it contradicts to the What does a dot mean in matrix element index? (updated the question). Is there any source like a book or a textbook where this is introduced in math?

I know it appears in 'Linear Algebra Done Right' (3rd edition) by Sheldon Axler in one of the sections where he introduces matrices. You can also see it as 'numpy-like' notation: compare with W[k, :] for example

@hff1, thank you so much! Found in the book in the section 3.44 Notation .... Still not sure what are the roots of this notation (namely, when it comes from), but this answers the question just fine. If you like, post your comment as the answer so that I could accept it to make this beneficial for future readers.

The notation $W_{k, \cdot}$ likely refers to the $k$-th row of $W$. The dot just suggests taking all the elements in the row. It is just a convenient way to index an entire row of a matrix.
Similar usage of this indexing notation appears in 'Linear Algebra Done Right' (3rd edition) by Sheldon Axler in section 3.44.


text:
Did old-fashioned, rule-based systems die out when statistical learning broke through into NLP?
It is not quite clear to me whether the statistical approach superseded the rule-based system in the 90s.
McMahon and Smith (1998) report that many other researchers used "hybrids of statistical and formal approaches". What do they mean? Maybe it was still unclear which one was best suited for?

No. In commercial applications, rule-based systems are still widely used, because they are easier to explain and debug: if there is an error, you add or change a rule. In a statistical system you need to adjust the training data, re-train your system, and hope that it solved the problem.
What is sometimes used is a hybrid approach, where eg a stochastic part-of-speech tagger is used in conjunction with post-processing rules.
In some commercial areas (eg finance) there are regulatory constraints that mean you cannot rely purely on statistical systems.
[Note: obviously I cannot cite any sources, as this is not the kind of thing written about in academic papers. But I have in the past ten years worked at a number of businesses working on NLP, and they predominantly use rule-based systems, with a small proportion of stochastic components to support the rule-based one (intent-recognition, sentiment analysis, and pos-tagging).]


text:
What clustering algorithms work best for datasets with only binary categorical features?
I have a dataset with a lot of binary categorical features and a single continuous target value. I would like to cluster them, but I am not quite sure what to use.
In the past, I have used DBSCAN for something similar and it worked well, but that dataset also had lots of continuous features.
Do you have any tips and suggestions?
Would you suggest matrix factorization and then cluster?

By "binary categorical (one-hot encoded)", do you mean that you have $n$ features, and, for each input, only one of them is $1$ and all the others are $0$?

@nbro thanks for the comment! No, I have n features and any combination of 0, 1s among them is possible.
i.e. if n = 3, I may have, 000 or 010, or 111, etc.

Ok, then I don't think that's called one-hot encoded. 1-hot encoded is what I described, I think.

@nbro ah, apologies, I meant to convey that the individual features can only be either 0 or 1. I'll edit.

Any clustering algorithm should work -- the main issue is the similarity or distance metric that determines how similar (or different) two elements are. This is often something like Euclidean distance, but that won't work well with binary data.
I would suggest using the Jaccard Index or Dice Coefficient. These will be suitable for use as a metric when clustering such data.

Hey Oliver, thanks a lot! I'll try and experiment with using these distance metrics.


text:
Validation accuracy very low with transfer learning
I am using MobileNetV3 from TF keras for doing transfer learning; I removed the last layer, added two dense layers, and trained for 20 epochs.

How many dense layers should I add after the MobileNet and How dense should they be?

How many epochs should I train for?

Validation loss and validation accuracy have a strange pattern, is that normal?

Is there anything I am missing?

Hello. Maybe you should describe 1. the task you're trying to solve (and, of course, if it's a regression or classification task), 2. the dataset you're fine-tuning your model with (including its size), 3. hyper-parameters like the learning rate, the loss, optimizer and batch-size.

classify person vs no person, 2.my data is 2 2d images and one depth image arranged into 3 channel image, the original data is 32X32 pixel and resized to 224X224 pixel to match the MobileNet input layer, 3. I amusing sigmoid acvtivation for last layer, adam optmizer without setting its learning rate and binary_cross_entropy for loss

these two steps solved my problem

I found that I forget to freeze the per-trained model by setting trainable = False
It seams that I failed to load the weights when I get the model from keras.application even that the documentation mentioned

Weights are downloaded automatically when instantiating a model. They are stored at ~/.keras/models/.

so I get the model from tensorflow hub which worked correctly


text:
Probability that two words appear in the same sentence
How can I know if two words are likely to appear in the same sentence in (British) English (or English in general to enhance the chance of getting a result).
As I don't have access to a powerful machine, is there any relevant website? Or a pretrained model I can use? Or something else?

There isn't really such a thing as "English in general", you have to pick some kind of corpus. Some analysis might go a little beyond the corpus and generate probabilities for pairs that are not observed. But it would still need to be based on some database of sentences, and will give different results whether you include Shakespear or Wikipedia or 20th century newspaper editorials or Twitter etc.

I thought it was obvious that it means english you want. I prefer modern english.

It has to be based on an actual realised corpus. There is no corpus of "modern English". I am not asking you to name a corpus in the question, but trying to set expectations that you cannot get a result for english in general. Instead you may be able to get results trained from different corpuses. The numbers you get will be different depending on what sources are analysed by the model. If that is OK, and you are not looking for some "true" value for word pairs, then its fine.

You don't need a powerful machine or a pre-trained model. All you need
— as Neil Slater rightly says in his comment to your question — is a corpus of English texts to analyse. There are some corpora available for linguistic research, or you can collect your own.
Then you need to split the texts into sentences, and tokenise them, and you're ready to calculate probabilities.
In linguistics there are some commonly used co-occurrence measures, such as mutual information, log-likelihood, or t-score. These are all used to measure the associations between words, typically in a window around the target word, rarely within sentences (as it makes processing easier). Any textbook on statistics in corpus linguistics will tell you how to do that.
The exact parameters depend on what the purpose of your analysis is, but you won't be able to do this without a corpus.

Okay I can train a model myself, do you know a 2010+ british corpus ? for exemple BBC (news, sport, 2, 3, ....), the time, channel 4, BT sport, sky sports, sky news, ... ?

I thought about a pretrained model because it can train on a powerfull machine, for example if I want to know if "coffee" can appear with "run with floods." As even if it can it's very rare to catch this match, I think big company can do it but I probably can't.

Have a look at the BNC (British National Corpus)


text:
How to create a model for predicting the number of visitors
I want to create a model to predict the number of visitors.
Currently, I have a year's csv data for predicting the number of visitors, which is collected every 10 seconds.
I would like to predict the number of future visitors on a daily basis based on this data for the past year.
What kind of method or model can I use to achieve this? I can use a graphics board for learning.
If you have any page of sample codes, it would be very helpful.

Do you have any other data attributes, or just the time-of-day?

At the moment it is only time vs. count.
I may add weather and other information in the future.

Straight answer:
There is no right answer as it depends on many factors. But here are some keywords you can look into:
Keywords about your problem:

Time Series
Periodic
Forecasting.
Uni-variable

About the model, I'd recommend checking ARIMA. But before jumping into code.
A good problem solving with Data Science is a dynamic process for deeply understanding your business while testing hypothesis with data.
Business:

If you are predicting visitors in a beach, for instance, it will probably depend on weather, weekdays and holidays.
If it's a bank, you might have more visits on pay-day and people may choose the time with less expected line length.
If it's an emergency hospital, you'll find a whole new situation.

So I encourage you to think of your real problem before (or while) diving into math and programming.
Data:
Depending on your available data, you could test some hypothesis. For example: "The weekday won't interfere much on the visitors". Once you are familiar with your data and your business, than you can even model it into a simple periodic regression. For example:

Everyday my restaurant has 2 main peaks, one for lunch and other for dinner.
I'll assume my data is well described by 2 Gaussian distribution across the day.
Model it by a simple regression to find the best parameters for your Gaussian curves and than check how well it fits.
Check the cases where the model fails and set new hypothesis.

Thank you! I'll keep that as a reference! It was very informative with concrete examples!
I felt that factors such as the weather and temperature are also important, since in my case I have to take measurements in places where I am exposed to direct sunlight.

There are various cheat sheets to recommend what predictive model to use in different situations. Here’s a couple to guide you on options for your dataset.
 https://scikit-learn.org/stable/tutorial/machine_learning_map/index.html
For this first cheat sheet with your example, you would begin with the start icon. For the first question > 50 samples, the answer is yes. For the second question predict category, the answer is no. For the third question predict quantity, the answer is yes. For the fourth question, < 100K samples, the answer is yes . The suggested type of regression analysis to try from this cheat sheet is a SGD Regressor.
 https://docs.microsoft.com/en-us/azure/machine-learning/algorithm-cheat-sheet
For the cheat sheet you example begin with the question what do you want to do. The answer is predict values; so again we see this should be some type of regression analysis. There are a few options on this one that would be appropriate to try, such as a Poisson Regression.
After deciding which model to use the next decision is how to implement the model. Kimball made a statement a good decade ago,  In today’s environment, most organizations should use a vendor-supplied ETL tool as a general rule. This was mainly due to maintenance costs. We’ve reached the same level of maturity with data science tools that same logic can be applied for common data science models.

Hi, @Christopher! Those are nice guidelines. But maybe you could try to be more specific. At least guiding the user through this mindmap and helping them finding their case.


text:
Are neural networks invertible?
I am interested in learning about the inverse of neural networks and I would like to understand about the invertibility of neural networks, as for example described in On the Invertibility of Invertible Neural Networks.
Researchers who are working on this domain, can you help me understand these two questions.

Are all neural network invertible ?
What exactly qualifies a neural network to be invertible ?

The meaning of invertible here is the standard definition of invertibility for a mathematical function $f \colon X \to Y$. Invertible simply means "the function has an inverse map $f^{-1} \colon Y \to X$". Equivalently the function $f$ is bijective, which means the following two conditions hold:

$f$ is injective: for any two distinct $x_1, x_2 \in X$, $f(x_1) \ne f(x_2)$.

$f$ is surjective: for any $y \in Y$, there exists an $x \in X$ such that $f(x) = y$.

If this is unfamiliar, you should be able to find some helpful references on Google using these terms.
Most obvious neural network architectures cannot possibly be invertible. Consider for example a classifier which takes an image or some other high-dimensional input, and outputs a classification label. This network could only be invertible if there was only one possible input1 which corresponds to each label, which is not the goal of the network.

1 I mean this rather literally: if one pixel is even slightly different, this would be a different input to the network and would have to have a different output.

Thank you so much that explains it wonderfully!  The last point you referred to is exactly what I have been investigating how to invert a high dimensional input for a classification problem. Is there any literature you can refer me to which states that in such cases the invertibility is not possible?

@user157522 Glad to hear that. That fact follows from the definition of invertibility, so it might not be stated explicitly in the literature in the context of neural networks. You can probably prove it to yourself after thinking about the definitions (perhaps take a read through the Wikipedia article as a start). In particular there is no way to form an injective map from an infinite set to a finite one (you can find this in any text on set theory, or search for this result directly), which more or less settles the question for a classifier.

Thanks a lot, I understood it, but I kind of have to provide literature that explicitly states that to prove my point.

@user157522 Okay, it might be mentioned in passing in a paper on invertible networks, but I don't think the result will be particularly prominent unfortunately. Depending on your audience, assuming a knowledge of elementary concepts like bijections might be reasonable (although of course what is elementary to a mathematician who works with these concepts all day might not be elementary to someone else!). Perhaps giving a brief proof of the result would be sufficient, with references to a mathematical text for readers who would be interested?

Excellent answer. For @user157522, you may be interested to check out https://hci.iwr.uni-heidelberg.de/vislearn/inverse-problems-invertible-neural-networks/ and https://github.com/jaekookang/invertible_neural_networks. And a recent example from my field: https://www.science.org/doi/10.1126/science.aaw1147


text:
In neural networks, what does the term depth generally mean?
Is it

number of units in a layer
number of layers
overall complexity of the network (both 1 and 2)

Usually it refers to the number of layers that are sequential (i.e. one after the other). However, it isn't used much like a quantity (e.g. this network has a depth of 8), rather a qualitative characteristic of the network (e.g. this network is deeper than the other).

Very good question, I have heard it refered to all the 3 ways you described. I am not sure if there is a purely objective answer so I will answer with what I understand by "depth" generally:

If speaking of model architecture: the number of layers of the model.
If speaking of CNN layers: the number of filters (not to be confused with the size of the kernel).
If speaking of RNN layers: the number of time steps (temporal "depth").

On the other hand I have never heard about depth regarding to FC layers. As I said the term "depth" is very subjective depending on the speakers. It should not be this way, and maybe theoretically is not, but I speak from what I heard in my experience.

authors: Στέργιος Μιχαλόπουλος


text:
FastDownward PDDL Planner Limitations
I recently had a look at automated planners and experimented a little bit with FastDownward. As I wanted to start a toy project, I created a PDDL model for the ordinary 3D Rubik's Cube (of course using a planner may not be the most efficient approach).
Although my model may not necessary be "totally correct" yet, so far it consists of 24 predicates, 12 actions for the respective moves (each with 8 typed parameters, 4 "edge subcubes" and 4 "corner subcubes"). For each of the movable subcubes I have a domain object whose position is basically determined by the respective predicate; overall, at first glance this seemed to me as a model of quite moderate size.
It was indeed not a very complex task to come up with this model and although it currently does not consider orientations of subcubes yet, I simply wanted to give it a try with an instance where only a single move (so application of one action) has to be conducted — I assumed that such a plangraph should level off quite soon, so basically after the first layer where a goal state can be reached.
However, as I started the planner, it soon run out of memory and started to page.
Previously, I only read something on PDDL and the respective sections of Russell & Norvig. I took a closer look at the planner itself and found that it transform the PDDL description into some intermediate description.
I tried to only execute the transformation and after cutting off a third of my Rubik's Cube it — at least — terminated. I investigated the transformed model file and found that the planner/solver actually instantiates (flattens) the actions with its parameters.
Since the Rubik's Cube has a quite unrestricted domain and each action has apparently 8 parameters (4 corners, 4 edges), this inherently results in a huge number of flattened actions. Even more, although I added precondition constraints to ensure distinctness of the parameters (so the very same subcube cannot be both edgecube $e_1$ and $e_2$), the flattened version still contains these invalid actions.
I have the following questions:

are state-of-the-art planners even suitable for such a problem or are they designed for problems where flattening the actions is of great advantage (e.g. few parameters, moderate number of objects per class, etc.). IMHO this would be a major limitation for their applicability in contrast to e.g. CP solvers.
can anyone recommend another planner that is more appropriate and that maybe does not perform the model transformation, which seems to be quite expensive for my PDDL spec (e.g. from this list, https://ipc2018-classical.bitbucket.io, i have chosen FastDownward since it seemed to be among the best...)
does PDDL or even FastDownward allow to specify that the parameters have to be distinct (i just found this: https://www.ida.liu.se/~TDDC17/info/labs/planning/writing.shtml — search for distinct — but this is more than vague), cause this may already lead to a significant reduction of flattened actions.
I'd also be happy for any other recommendations or remarks

You have stumbled upon a common drawback of the vast majority of modern planning technology. The "flattening" you refer to is actually called "grounding" in the community.
Indeed, grounding is the first step of almost every planner out there.
Planners that don't do this grounding phase are typically referred to as "lifted planners", but their availability is far more limited (i.e., you'd likely need to reach out to an author of a paper to get access to their code).
That said, many of the planners, Fast Downward included, will try to be smart about the grounding phase. This includes simple things such as making sure that typing for the parameters (and the objects that instantiate them) is adhered to, but goes further with certain checks on reachability.
The process isn't flawless, but it usually does a good job when the true number of ground actions is relatively small. If your model really does have an astronomical number of ground actions, then you're kind of out of luck here.
To your questions specifically:

Yes, they are designed for problems where you can ground things. But the mark of suitability is the number of reachable ground actions. If this is small enough, then either

(1) the planners should be able to handle it or
(2) it presents a research opportunity for grounding things better.

This is the most recent work that comes to mind, as well as the papers that cite it:

Heuristic Evaluation Based on
Lifted Relaxed Planning Graphs
Heuristic evaluation based on lifted relaxed planning graphs

They aren't assumed to be distinct. There are situations when you wouldn't want them to be, and so it is up to the designer to add the preconditions that ensure they are distinct (note that this is one excellent way to equip the grounder with extra information about what it should generate).

Generally, having actions with many parameters is a recipe for problems that have too many ground actions. Either manually remodeling things yourself, or applying a technique like operator splitting is the approach most often taken.

Finally, if you'd like to have a more directed discussion, feel free to join us over on the slack channel. There may be more eyes on the questions you pose there.


text:
Recognize carp and give them a unique id
For my internship assignment I have to implement a proof of concept for an application that is supposed to scan a picture with a carp on it and identify which carp this is. All of the carps that are going to be scanned are known and they all exist in the database, so no new carps are scanned.
Is this possible? I've been searching a lot about this topic and the only thing I found is customvision.ai, but for using this I need to have at least 15 pictures of the same carp per tag, but the client only has 1 picture per carp.
What are your recommendations or do you think this is not possible?

I'm not sure I understood your question entirely so please correct me if i'm wrong. You're having all the carp tagged, so if I give you a picture of any of them you know exactly which one is in the picture right? If that is the case then you're dealing with a classic classification problem. One simple way of solving such problem will be to use CNN on the input image to extract features, and at the end of the network have N neurons, where each neuron matches one carp. Just apply a softmax over all the inputs to have a probability distribution, and select the highest value (or if the values is highest then a threshold). Regarding the number of labeled examples per class, having only one might be a problem. I would suggest you to look into few shot learning, which are trying to solve this exact problem (training decent models with limited training data).

Yes, it is supposed to know which carp it is. But i'm having trouble training because i need atleast 15 images of 1 tag. But if I read your answer correctly, I am supposed to look at few shot learning.

Yes, there are a lot of recent papers which takes this problem. Also how did you come up with the 15? Have you tried to train a model with the data you're having? As I understood it you don't need good generalization since you're not gonna predict craps that are different from your training set.

If I want to train a tag on customvision.ai I need atleast 15 images per tag otherwise I can't train the tag

I don't know your programming level, but implementing a model like the one i described shouldn't take too much  time.


text:
How can I use a Hidden Markov Model to recognize images?
How could I use a 16x16 image as an input in a HMM? And at the same time how would I train it? Can I use backpropagation?

You wouldn't, normally. A HMM is used to model sequences of observations, and it would not make sense to use it for image recognition. Unless they are sequential, such as strokes in handwriting.
HMMs are typically used in fields such as speech recognition and part-of-speech tagging. Here you observe a sequence of events that you want to fit to a model in order to classify the individual observations.
For training a HMM you would use something like the Baum-Welch Algorithm; for finding the most likely sequence (ie the recognition process) the Viterbi Algorithm is used.

Comments are not for extended discussion; this conversation has been moved to chat.


text:
Why multiplayer, imperfect information, trick-taking card games are hard for AI?
AI reached a super-human level in many complex games such as Chess, Go, Texas hold'em Poker, Dota2 and StarCraft2. However it still did not reach this level in trick-taking card games.
Why there is no super-human AI playing imperfect-information, multi-player, trick-taking card games such as Spades, Whist, Hearts, Euchre and Bridge?
In particular, what are the obstacles for making a super-human AI in those games?

I think those are the reasons that makes Spades hard for AI to master:

Imperfect information games pose two distinct problems: move selection and inference.

The size of the game tree isn't small, however larger games have been mastered.
I. History size: $14!^4 = 5.7\cdot10^{43}$
II. There are $\frac{52!}{13!^4}= 5.4\cdot10^{28}$ possible initial states.
III. Each initial information set can be completed into a full state in $\frac{39!}{13!^3}=8.45\cdot10^{16} $ ways

Evaluation only at terminal states.

Multiplayer games:
I. harder to prune - search algorithms are less effective
II. opponent modeling is hard
III. Goal choosing - several goals are available, need to change goals during rounds according to the reveled information.

Agent need to coordinate with a partner: conventions, signals.

Isn't poker an imperfect information and multi-player game? I think so. Therefore, I guess that you're only interested in knowing why games like spades (that are apparently called "trick-taking") have not yet been "solved" by an AI. Isn't a game like poker more difficult than spaces? I don't know because I don't think I'm familiar with spades, but I'm certainly familiar with 1 version of poker. If yes, then maybe there isn't yet some AI that solves spaces simply because nobody got interested in the game. This is really just a guess.

There been extensive research on trick-tacking games, especially Bridge.
Research on Spades have been made mostly by Sturtevant at el. https://webdocs.cs.ualberta.ca/~nathanst/papers/mpuct_icga.pdf
and AI factory https://core.ac.uk/download/pdf/157854537.pdf

The first paper has more than 10 years, while the second is more recent. Just to have an idea, because now I don't have the time to read them, have they (in the second example, at least) tried to use recent techniques that have also been used in the case of say poker or AlphaGo, or are they using maybe some more traditional approaches? To be honest, I'm not familiar with the all details not even of AlphaGo, but, as far as I recall, it uses MCTS and RL. Most of the others that you mention that achieved superhuman performance probably use these techniques too (at least, RL).

Yes, they both tried MCTS / UCT.  I have used MCTS and Supervised learning for the bidding phase at https://ecai2020.eu/papers/235_paper.pdf   however on my implementation, UCT is helpful in the playing phase only close to the round's end (~5 last tricks) partly because of a strict time/computation limit.

@Cohensius I noticed you yourself have published a paper on this (https://arxiv.org/abs/1912.11323) so perhaps we should be asking you this question! I'm very curious if you have an idea why Poker has been solvable for AI to superhuman standards (DeepStack, Libratus, Pluribus) but trick-taking cardgames like Spades, Hearts, etc cannot be addressed by the same approaches?

@MobeusZoom, I will add my thoughts, but I am not an AI-expert (yet) so I might be way wrong.

Since no answers to my question were made, I will try to answer it myself, however while I do write AI agents, am not an expert.
Trick-taking games are too large to be solved with current search algorithms and computation capabilities [RSBS19].
The reason is the following:

Counterfactual Regret Minimization (CFR) is the leading framework for solving large imperfect information games.[BLGS19]

CFR requires building strategies for all players and iterating over all information sets.[ZJBP07]

CFR reached super-human level in poker, but does not work well in Spades and other trick-taking games because:
(a) Large number of information sets. My estimation for Spades is 10^58.
(b) No good abstractions (found yet). While for comparison, in Poker abstractions significantly reduce the size of the game trees.[LSBF10]

After improving my Spades-agent, it wins more than 60% of her
games Vs recreational players. Unfortunately, I never tested
her Vs experts.

If DeepMind or someone in their caliber will try to make a super-human trick-taking agent, I guess that they will succeed.

Very interesting and the point about abstractions seems very pertinent :) Regarding number of information sets - I guess it's probably accurate to say that most trick-taking games like Spades/Hearts/Whist will have more information sets than Poker, because of the larger number of cards in players' hands?

@MobeusZoom, exactly.  I was also interested about the size of poker, in  https://ai.stackexchange.com/q/26637/4335 I state what I found, and what I did not.

Made a couple of comments there. It's worth noting that even if Poker with a large stack-size could have more game states than a game like a Spades, I'd guess Poker decisions which differ only slightly in the continuous space of bids yield very similar effects (so we can get very close to equilibrium playstrength without a full solution).

You are right, they discretized the bets into several buckets. For example: 1/3 pot, 1/2 pot 2/3 pot, pot, 2pots, 4pots+.  A bet of 100$ and a bet of 101$ are treated the same.

Thats awesome information! Thanks for sharing!


text:
What is meant by the expected BLEU cost when training with BLEU and SIMILE?
Recently I was reading a paper based on a new evaluation metric SIMILE. In a section, validation loss comparison had been made for SIMILE and BLEU. The plot showed the expected BLEU cost when training with BLEU and SIMILE.
What I'm unable to understand is what is meant by the expected BLEU cost when training with BLEU and SIMILE? Are there any separate cost functions defined for these scores?
I'm attaching the image of the graph.

It looks like the method they use for training takes a set of candidate hypotheses $\mathcal{U}(x)$, along with associated probabilities, and then minimizes the expected value of the cost function over that distribution. Section 3 has the loss function being minimized:
$ \mathcal{L}_{Risk} = \sum\limits_{u \in \mathcal{U}(x)} cost(t, u) \frac{p(u|x)}{\sum_{u' \in \mathcal{U}(x)} p(u'|x)} $.
One of the cost functions used is $1 - \texttt{BLEU}(t, h)$, where $t$ is the target and $h$ is the generated hypothesis. I'm not sure where $p(u|x)$ is coming from, but $1 - \mathcal{L}_{Risk}$ for the BLEU cost function is probably what they're refering to when they mention Expected BLEU.